172template <
typename TData>
200 static std::shared_ptr<HelmholtzOp<TData>>
Create(
201 const MultiRegions::ExpListSharedPtr &expansionList,
202 const std::vector<std::string> &components,
203 const std::string &execStr = "", const std::string &implStr = "")
206 template Create<HelmholtzOp, HelmholtzBlockOp>(
207 expansionList, components, execStr, implStr);
212 static inline const std::string
name =
"Helmholtz";
230 for (
unsigned int blk = 0; blk < this->
m_blockOp.size(); ++blk)
255 for (
unsigned int blk = 0; blk < this->
m_blockOp.size(); ++blk)
257 this->
m_blockOp[blk]->SetDiffCoeff(diffCoeff);
277 "Diffusion coefficient blocks must match the expansion");
278 for (
unsigned int blk = 0; blk < this->
m_blockOp.size(); ++blk)
297 std::vector<std::shared_ptr<HelmholtzBlockOp<TData>>>
m_blockOp;
308 const std::vector<std::string> &components)
332 ASSERTL1(in.GetNumComponents() == out.GetNumComponents(),
333 "Number of input and output components differ");
335 ASSERTL1(in.GetNumHomoModes() == out.GetNumHomoModes(),
336 "Number of input and output homogeneous modes differ");
339 "lambda has not been set."
340 "Set the value with SetLambda() before calling Apply().");
343 "diffusion coefficient has not been set. "
344 "Set the value with SetDiffCoeff() or SetVarDiffCoeff() "
345 "before calling Apply().");
348 "can't set both DiffCoeff and VarDiffCoeff. "
349 "Set the value with SetDiffCoeff() or SetVarDiffCoeff() "
350 "before calling Apply().");
353 for (
unsigned int blk = 0; blk < this->m_blockOp.size(); ++blk)
356 auto &inblock = in.GetBlocks()[blk];
357 auto &outblock = out.GetBlocks()[blk];
359 this->m_blockOp[blk]->Apply(inblock, outblock);
Whole-field base class and factory machinery shared by every element-operator family in the MultiRegi...
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Per-block interface class of the weak Helmholtz operator.
A Field represents expansion data to be operated on.
std::vector< BlockAccessor< TData, TState > > & GetBlocks()
Get BlockAccessors for the field.
Common base class of the element-operator interfaces: an operator applied independently to every elem...
Whole-field interface of the weak Helmholtz operator: maps coefficient-space fields to coefficient sp...
bool m_isSetVarDiffCoeff
Whether a spatially varying tensor is selected.
bool m_isSetLambda
Set by SetLambda(); checked by v_Apply() in debug builds.
void SetLambda(TData lambda)
Set the scalar weight of the mass term used by subsequent Apply() calls.
~HelmholtzOp() override=default
void SetDiffCoeff(std::vector< TData > &diffCoeff)
Set the constant symmetric diffusion tensor used by subsequent Apply() calls.
static std::shared_ptr< HelmholtzOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Create a weak-Helmholtz operator through the operator and block-operator factories.
HelmholtzOp(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
Construct the interface part of a concrete implementation; called by the factory-registered creator f...
static const std::string name
Operator base name; Create() appends the execution space to it to form the factory key.
void SetVarDiffCoeff(LibUtilities::Field< TData, FieldState::Phys > &diffCoeff)
Set a spatially varying symmetric diffusion tensor.
virtual void v_ApplyFFT(LibUtilities::Field< TData, FieldState::Coeff > &in, LibUtilities::Field< TData, FieldState::Coeff > &out)=0
Weak z-Laplacian, called by v_Apply() after the block loop; adds it to every output block of a multi-...
void v_Apply(LibUtilities::Field< TData, FieldState::Coeff > &in, LibUtilities::Field< TData, FieldState::Coeff > &out) override
Apply the weak Helmholtz operator block by block.
bool m_isSetDiffCoeff
Set by SetDiffCoeff(); checked by v_Apply() in debug builds.
std::vector< std::shared_ptr< HelmholtzBlockOp< TData > > > m_blockOp
One block operator per element block of the expansion list; populated by ElmtOp::Create().
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
FieldState
Possible states for Field data.