Nektar++
Loading...
Searching...
No Matches
MultiplyByElmtInvMassOpImpl.hpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: MultiplyByElmtInvMassOpImpl.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:
32//
33///////////////////////////////////////////////////////////////////////////////
34
35/**
36 * @file MultiplyByElmtInvMassOpImpl.hpp
37 * @brief Factory shell for the whole-field MultiplyByElmtInvMass operator.
38 *
39 * @details
40 * The whole-field behaviour of the operator is implemented entirely in
41 * MultiplyByElmtInvMassOp (MultiplyByElmtInvMassOp.hpp); the class here
42 * exists only so that a "MultiplyByElmtInvMass" + execution-space key
43 * ("MultiplyByElmtInvMassSerial", "MultiplyByElmtInvMassAVX",
44 * "MultiplyByElmtInvMassDevice") can be registered with the operator
45 * factory. The numerical work is done by the block operators created
46 * alongside it (see MultiplyByElmtInvMassBlockOpSerialAVXGeneric.hpp and
47 * MultiplyByElmtInvMassBlockOpDeviceGeneric.hpp). CMake-generated translation
48 * units instantiate and register this class for each enabled execution
49 * space.
50 *
51 * @note CMake includes this header into the registration translation
52 * units it generates for this operator, one per execution space and
53 * data type; it should not normally be included by any other
54 * translation unit. Other code goes through MultiplyByElmtInvMassOp.hpp and the
55 * operator factory.
56 */
57
58#pragma once
59
61
63{
64
65/**
66 * @brief Execution-space registration shell of MultiplyByElmtInvMassOp;
67 * adds no behaviour of its own.
68 *
69 * @details
70 * The whole-field stage of the operator is execution-space independent
71 * (the block loop in MultiplyByElmtInvMassOp::v_Apply), and all numerical
72 * work happens in the per-block detail::MultiplyByElmtInvMassBlockOpImpl
73 * objects created alongside it by ElmtOp::Create. The ExecSpace template
74 * parameter exists so that the generated factory declaration code can
75 * register a separate entry for each execution space enabled in the build.
76 *
77 * @tparam ExecSpace Execution space the instance is registered for; used
78 * only to distinguish factory entries.
79 * @tparam TData Floating-point type of the field data.
80 */
81template <typename ExecSpace, typename TData>
83{
84public:
85 /// @brief Construct the operator for @p expansionList and
86 /// @p components; forwards to MultiplyByElmtInvMassOp.
88 const MultiRegions::ExpListSharedPtr &expansionList,
89 const std::vector<std::string> &components)
90 : MultiplyByElmtInvMassOp<TData>(expansionList, components)
91 {
92 }
93
94 /// Operator class name; defined by the generated factory code.
95 static std::string className;
96
97 /// Creator function registered with OperatorFactory.
98 static std::unique_ptr<Operator<TData>> Instantiate(
99 const MultiRegions::ExpListSharedPtr &expansionList,
100 const std::vector<std::string> &components)
101 {
102 return std::make_unique<MultiplyByElmtInvMassOpImpl<ExecSpace, TData>>(
103 expansionList, components);
104 }
105};
106
107} // namespace Nektar::MultiRegions::detail
Whole-field interface of the MultiplyByElmtInvMass element operator, which multiplies a coefficient-s...
Whole-field interface of the element-wise inverse mass operator: replaces every element's coefficient...
Execution-space registration shell of MultiplyByElmtInvMassOp; adds no behaviour of its own.
MultiplyByElmtInvMassOpImpl(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
Construct the operator for expansionList and components; forwards to MultiplyByElmtInvMassOp.
static std::unique_ptr< Operator< TData > > Instantiate(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
Creator function registered with OperatorFactory.
static std::string className
Operator class name; defined by the generated factory code.
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.