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