96template <
typename TData>
121 static std::shared_ptr<AdvectionOp<TData>>
Create(
122 const MultiRegions::ExpListSharedPtr &expansionList,
123 const std::vector<std::string> &components,
124 const std::string &execStr = "", const std::string &implStr = "")
127 template Create<AdvectionOp, AdvectionBlockOp>(
128 expansionList, components, execStr, implStr);
133 static inline const std::string
name =
"Advection";
145 for (
unsigned int blk = 0; blk < this->
m_blockOp.size(); ++blk)
166 for (
unsigned int blk = 0; blk < this->
m_blockOp.size(); ++blk)
197 ?
static_cast<unsigned int>(
198 this->m_expansionList->GetCoordim(0))
200 "Advection velocity must have coordDim components, or three "
201 "on a 3DH1 expansion");
204 for (
unsigned int blk = 0; blk < this->
m_blockOp.size(); ++blk)
216 std::vector<std::shared_ptr<AdvectionBlockOp<TData>>>
m_blockOp;
227 const std::vector<std::string> &components)
251 ASSERTL1(in.GetNumComponents() == out.GetNumComponents(),
252 "Number of input and output components differ");
254 ASSERTL1(in.GetNumHomoModes() == out.GetNumHomoModes(),
255 "Number of input and output homogeneous modes differ");
258 "Advection velocity has not been set."
259 "Set the value with SetAdvVel() before calling Apply().");
262 for (
unsigned int blk = 0; blk < this->m_blockOp.size(); ++blk)
265 auto &inblock = in.GetBlocks()[blk];
266 auto &outblock = out.GetBlocks()[blk];
268 this->m_blockOp[blk]->Apply(inblock, outblock);
Per-block interface of the advection element operator.
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....
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.
Whole-field interface of the advection element operator: writes scale * (V . grad u) at every quadrat...
void v_Apply(LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &out) override
Apply the advection operator block by block.
virtual void v_SetAdvVelFFT(LibUtilities::Field< TData, FieldState::Phys > &advVel)=0
Pass the advection velocity on to the homogeneous term; called by SetAdvVel().
virtual void v_SetScaleFFT(const TData &scale)=0
Pass the scale factor on to the homogeneous term; called by SetScale().
~AdvectionOp() override=default
virtual void v_ApplyFFT(LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &out)=0
Add the homogeneous term to out; called by v_Apply() after the block loop.
bool m_isSetAdvVel
Whether SetAdvVel() has been called; checked by v_Apply().
void SetAdvVel(LibUtilities::Field< TData, FieldState::Phys > &advVel)
Supply the advection velocity field V; must be called before the first Apply().
static std::shared_ptr< AdvectionOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Build a complete advection operator through the operator and block-operator factories.
AdvectionOp(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...
void SetAppend(const bool &append)
Choose between overwriting and accumulating output.
std::vector< std::shared_ptr< AdvectionBlockOp< TData > > > m_blockOp
One block operator per element block, filled by Create().
void SetScale(const TData &scale)
Set the scalar factor applied to the advection term on every block and on the homogeneous term,...
static const std::string name
Operator base name; Create() appends the execution space to it to form the operator-factory key.
Common base class of the element-operator interfaces: an operator applied independently to every elem...
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
FieldState
Possible states for Field data.