128template <
typename TData>
129class MassOp :
public ElmtOp<FieldState::Coeff, FieldState::Coeff, TData>
155 static std::shared_ptr<MassOp<TData>>
Create(
156 const MultiRegions::ExpListSharedPtr &expansionList,
157 const std::vector<std::string> &components,
158 const std::string &execStr = "", const std::string &implStr = "")
161 template Create<MassOp, MassBlockOp>(expansionList, components,
167 static inline const std::string
name =
"Mass";
182 for (
unsigned int blk = 0; blk < this->
m_blockOp.size(); ++blk)
198 for (
unsigned int blk = 0; blk < this->
m_blockOp.size(); ++blk)
206 std::vector<std::shared_ptr<MassBlockOp<TData>>>
m_blockOp;
217 const std::vector<std::string> &components)
241 ASSERTL1(in.GetNumComponents() == out.GetNumComponents(),
242 "Number of input and output components differ");
244 ASSERTL1(in.GetNumHomoModes() == out.GetNumHomoModes(),
245 "Number of input and output homogeneous modes differ");
248 for (
unsigned int blk = 0; blk < this->m_blockOp.size(); ++blk)
251 auto &inblock = in.GetBlocks()[blk];
252 auto &outblock = out.GetBlocks()[blk];
254 this->m_blockOp[blk]->Apply(inblock, outblock);
Whole-field base class and factory machinery shared by every element-operator family in the MultiRegi...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Per-block interface of the Mass element operator.
A Field represents expansion data to be operated on.
Common base class of the element-operator interfaces: an operator applied independently to every elem...
Whole-field interface of the mass operator: applies each element's mass matrix to a coefficient-space...
void v_Apply(LibUtilities::Field< TData, FieldState::Coeff > &in, LibUtilities::Field< TData, FieldState::Coeff > &out) override
Apply the operator block by block.
static const std::string name
Operator base name; Create() appends the execution space to it to form the operator-factory key.
MassOp(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
Construct the interface part of a concrete operator; called by the factory-registered creator functio...
static std::shared_ptr< MassOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Build a complete Mass operator through the operator and block-operator factories.
void SetAppend(const bool &append)
Switch all block operators between overwrite and accumulate mode.
~MassOp() override=default
void SetScale(const TData &scale)
Set the factor every block operator multiplies its result by. The initial value is 1.
std::vector< std::shared_ptr< MassBlockOp< TData > > > m_blockOp
One block operator per element block, filled by Create().
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
FieldState
Possible states for Field data.