114template <
typename TData>
116 :
public ElmtOp<FieldState::Phys, FieldState::Phys, TData>
121 using
ElmtOp<FieldState::Phys, FieldState::Phys, TData>
::Apply;
127 static std::shared_ptr<PhysLiftProjectOp<TData>>
Create(
128 const MultiRegions::ExpListSharedPtr &expansionList,
129 const std::vector<std::string> &components,
130 const std::string &execStr = "", const std::string &implStr = "")
133 template Create<PhysLiftProjectOp, PhysLiftProjectBlockOp>(
134 expansionList, components, execStr, implStr);
139 static inline const std::string
name =
"PhysLiftProject";
161 for (
unsigned int blk = 0; blk <
m_blockOp.size(); ++blk)
171 for (
unsigned int blk = 0; blk <
m_blockOp.size(); ++blk)
178 std::vector<std::shared_ptr<PhysLiftProjectBlockOp<TData>>>
m_blockOp;
181 const std::vector<std::string> &components)
193 ASSERTL1(in.GetNumComponents() == out.GetNumComponents(),
194 "Number of input and output components differ");
195 ASSERTL1(in.GetNumHomoModes() == out.GetNumHomoModes(),
196 "Number of input and output homogeneous modes differ");
198 for (
unsigned int blk = 0; blk <
m_blockOp.size(); ++blk)
200 m_blockOp[blk]->Apply(in.GetBlocks()[blk], out.GetBlocks()[blk]);
210 ASSERTL1(in.GetNumComponents() == out.GetNumComponents() &&
212 "Number of input, trace and output components differ");
213 ASSERTL1(in.GetNumHomoModes() == out.GetNumHomoModes() &&
215 "Number of input, trace and output homogeneous modes differ");
217 for (
unsigned int blk = 0; blk <
m_blockOp.size(); ++blk)
219 m_blockOp[blk]->ApplyLift(in.GetBlocks()[blk],
221 out.GetBlocks()[blk]);
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 PhysLiftProject element operator, and the choice of its form for a block.
A Field represents expansion data to be operated on.
std::vector< BlockAccessor< TData, TState > > & GetBlocks()
Get BlockAccessors for the field.
unsigned int GetNumHomoModes() const
Gets the number of homogeneous modes.
unsigned int GetNumComponents() const
Gets the number of components for a vector field.
Common base class of the element-operator interfaces: an operator applied independently to every elem...
Whole-field interface of the lift-and-project operator: holds one PhysLiftProjectBlockOp per element ...
void SetScale(const TData &scale)
The factor the result is scaled by, on every block.
void SetAppend(const bool &append)
Accumulate onto the output instead of overwriting it, on every block.
void Apply(LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &trace, LibUtilities::Field< TData, FieldState::Phys > &out)
out (+)= scale * B M^{-1} B^T (in + L trace).
static const std::string name
Operator base name; Create() appends the execution space to it to form the factory key.
static std::shared_ptr< PhysLiftProjectOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Create the operator through the operator and block-operator factories (see ElmtOp::Create()).
void v_Apply(LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &out) override
The projection of in alone.
virtual void v_ApplyLift(LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &trace, LibUtilities::Field< TData, FieldState::Phys > &out)
Implementation hook for the three-argument Apply().
~PhysLiftProjectOp() override=default
PhysLiftProjectOp(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
std::vector< std::shared_ptr< PhysLiftProjectBlockOp< TData > > > m_blockOp
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
FieldState
Possible states for Field data.