Nektar++
Loading...
Searching...
No Matches
BwdTransOpImpl.hpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: BwdTransOpImpl.hpp
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Factory-registered whole-field implementation of the
32// backward transform
33//
34///////////////////////////////////////////////////////////////////////////////
35
36/**
37 * @file BwdTransOpImpl.hpp
38 * @brief Factory-registered whole-field implementation of the
39 * backward-transform operator.
40 *
41 * @note CMake includes this header into the registration translation
42 * units it generates for this operator, one per execution space and
43 * data type; it should not normally be included by any other
44 * translation unit. Other code goes through BwdTransOp.hpp and the
45 * operator factory.
46 */
47
48#pragma once
49
51
53{
54
55/**
56 * @brief Whole-field implementation of BwdTransOp, registered with the
57 * operator factory once per execution space.
58 *
59 * The class adds no behaviour of its own: the whole-field stage of the
60 * backward transform is execution-space independent -- it is the block
61 * loop in BwdTransOp::v_Apply -- and all numerical work happens in the
62 * per-block detail::BwdTransBlockOpImpl objects that ElmtOp::Create
63 * builds alongside it. The ExecSpace template parameter exists so that
64 * the CMake-generated factory declaration code can register a separate
65 * entry ("BwdTransSerial", "BwdTransAVX", "BwdTransDevice") for each
66 * execution space enabled in the build.
67 *
68 * @tparam ExecSpace Execution space the factory entry is registered
69 * for.
70 * @tparam TData Floating-point type of the field data.
71 *
72 * @see BwdTransOp for the whole-field interface this class completes.
73 */
74template <typename ExecSpace, typename TData>
75class BwdTransOpImpl : public BwdTransOp<TData>
76{
77public:
78 /**
79 * @brief Construct the whole-field operator; called by the
80 * factory-registered creator function Instantiate().
81 *
82 * @param expansionList Expansion list the operator runs over.
83 * @param components Names of the field components the
84 * operator is applied to.
85 */
87 const std::vector<std::string> &components)
88 : BwdTransOp<TData>(expansionList, components)
89 {
90 }
91
92 /// Operator-factory registration key, `"BwdTrans" + execution space`.
93 /// Defined by the CMake-generated declaration file, whose
94 /// initialiser performs the registration.
95 static std::string className;
96
97 /**
98 * @brief Creator function registered with the operator factory
99 * under #className.
100 *
101 * @param expansionList Expansion list the operator runs over.
102 * @param components Names of the field components the
103 * operator is applied to.
104 *
105 * @return The newly created whole-field operator.
106 */
107 static std::unique_ptr<Operator<TData>> Instantiate(
108 const MultiRegions::ExpListSharedPtr &expansionList,
109 const std::vector<std::string> &components)
110 {
111 return std::make_unique<BwdTransOpImpl<ExecSpace, TData>>(expansionList,
112 components);
113 }
114};
115
116} // namespace Nektar::MultiRegions::detail
Public interface of the backward-transform (BwdTrans) element operator, which maps a field from coeff...
Whole-field interface of the backward transform: evaluates a coefficient-space field at the quadratur...
Whole-field implementation of BwdTransOp, registered with the operator factory once per execution spa...
BwdTransOpImpl(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
Construct the whole-field operator; called by the factory-registered creator function Instantiate().
static std::string className
Operator-factory registration key, "BwdTrans" + execution space. Defined by the CMake-generated decla...
static std::unique_ptr< Operator< TData > > Instantiate(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
Creator function registered with the operator factory under className.
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.