|
Nektar++
|
Whole-field interface of the weak Helmholtz operator: maps coefficient-space fields to coefficient space. More...
#include <HelmholtzOp.hpp>
Public Member Functions | |
| void | SetLambda (TData lambda) |
| Set the scalar weight \(\lambda\) of the mass term used by subsequent Apply() calls. | |
| void | SetDiffCoeff (std::vector< TData > &diffCoeff) |
| Set the constant symmetric diffusion tensor \(\mathbf{D}\) used by subsequent Apply() calls. | |
| void | SetVarDiffCoeff (LibUtilities::Field< TData, FieldState::Phys > &diffCoeff) |
| Set a spatially varying symmetric diffusion tensor. | |
Public Member Functions inherited from Nektar::MultiRegions::ElmtOp< FieldState::Coeff, FieldState::Coeff, TData > | |
| void | Apply (LibUtilities::Field< TData, TFieldIn > &in, LibUtilities::Field< TData, TFieldOut > &out) |
Apply the operator to in, writing the result to out. | |
| void | operator() (LibUtilities::Field< TData, TFieldIn > &in, LibUtilities::Field< TData, TFieldOut > &out) |
| Call operator; equivalent to Apply(). | |
Public Member Functions inherited from Nektar::MultiRegions::Operator< TData > | |
| virtual | ~Operator ()=default |
| Operator (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > components) | |
| Construct the interface part of a concrete operator; called by the factory-registered creator functions. | |
Static Public Member Functions | |
| 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. | |
Static Public Member Functions inherited from Nektar::MultiRegions::ElmtOp< FieldState::Coeff, FieldState::Coeff, TData > | |
| static std::shared_ptr< TOperator< TData > > | Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="") |
| Build a complete element operator: the whole-field interface object plus one block operator per element block. | |
| static std::string | GetOpImpl (const std::string &opName, const std::string &opExecSpace, LibUtilities::SessionReaderSharedPtr session, const StdRegions::StdExpansionSharedPtr &exp=nullptr, const std::string &policyName="") |
| Return the implementation for an operator. | |
Static Public Member Functions inherited from Nektar::MultiRegions::Operator< TData > | |
| template<template< typename > typename TOperator> | |
| static std::shared_ptr< TOperator< TData > > | Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > components, const std::string &execStr) |
| Create a concrete operator instance through the operator factory. | |
| static std::string | GetOpExecSpace (std::shared_ptr< LibUtilities::SessionReader > session, const bool warn=true) |
| Return the execution space name ("opExecSpace") for an operator. | |
| static const DefaultOpImplRule * | GetDefaultOpImplRule (const StdRegions::StdExpansionSharedPtr &exp, const std::string &execSpace) |
| Return the row of the default implementation table (DefaultOpImplTable.hpp) that a block of elements takes, or null if none does. | |
| static std::string | GetDefaultOpImpl (const StdRegions::StdExpansionSharedPtr &exp, const std::string &execSpace) |
| Return the implementation a block of elements takes when neither the command line nor the session names one for its operator. | |
| static std::vector< unsigned int > | GetDefaultInterleaveWidths (const MultiRegions::ExpListSharedPtr &expansionList) |
Return the default interleave widths, one per block of expansionList, that persistent Fields (e.g. solution storage, time-integration and linear-solver workspace) built on it should be constructed with. | |
| static bool | IsDiscontinuousProjection (std::shared_ptr< LibUtilities::SessionReader > session) |
| Return true if the session uses a Discontinuous (DG) projection. | |
Static Public Attributes | |
| static const std::string | name = "Helmholtz" |
| Operator base name; Create() appends the execution space to it to form the factory key. | |
Protected Member Functions | |
| 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 functions. | |
| ~HelmholtzOp () override=default | |
| void | v_Apply (LibUtilities::Field< TData, FieldState::Coeff > &in, LibUtilities::Field< TData, FieldState::Coeff > &out) override |
| Apply the weak Helmholtz operator block by block. | |
| 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-plane 3DH1 field and leaves any other field untouched. | |
Protected Member Functions inherited from Nektar::MultiRegions::ElmtOp< FieldState::Coeff, FieldState::Coeff, TData > | |
| ElmtOp (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components) | |
| Construct the interface part of a concrete operator; called by the factory-registered creator functions. | |
| ~ElmtOp () override=default | |
| virtual void | v_Apply (LibUtilities::Field< TData, TFieldIn > &in, LibUtilities::Field< TData, TFieldOut > &out)=0 |
| Implementation hook for Apply(). | |
Protected Attributes | |
| bool | m_isSetLambda = false |
| Set by SetLambda(); checked by v_Apply() in debug builds. | |
| bool | m_isSetDiffCoeff = false |
| Set by SetDiffCoeff(); checked by v_Apply() in debug builds. | |
| bool | m_isSetVarDiffCoeff = false |
| Whether a spatially varying tensor is selected. | |
| std::vector< std::shared_ptr< HelmholtzBlockOp< TData > > > | m_blockOp |
| One block operator per element block of the expansion list; populated by ElmtOp::Create(). | |
Protected Attributes inherited from Nektar::MultiRegions::Operator< TData > | |
| MultiRegions::ExpListSharedPtr | m_expansionList |
| Expansion list the operator acts on. | |
| std::vector< std::string > | m_components |
| Names of the field components the operator was built for. | |
| LibUtilities::NekDataWarehouseSharedPtr | m_dataWarehouse |
| Data warehouse shared with the other operators on the expansion list, used to build and cache shared tables (basis matrices, mode indices, geometric factors) once. | |
Friends | |
| class | ElmtOp< FieldState::Coeff, FieldState::Coeff, TData > |
Whole-field interface of the weak Helmholtz operator: maps coefficient-space fields to coefficient space.
As with the other element-operator families, this class sets the Apply() field states at compile time – input and output in FieldState::Coeff – and drives one HelmholtzBlockOp per element block, followed by v_ApplyFFT(), which detail::HelmholtzOpImpl implements to add the weak z-Laplacian of a multi-plane 3DH1 field. See ElmtOp for the block decomposition and factory scheme.
Apply() always overwrites the output field.
Two settings specify what the block operators compute: the mass weight lambda and the packed symmetric diffusion tensor, forwarded to every block operator by SetLambda() and SetDiffCoeff().
| TData | Floating-point type of the field data. |
Definition at line 173 of file HelmholtzOp.hpp.
|
inlineprotected |
Construct the interface part of a concrete implementation; called by the factory-registered creator functions.
| expansionList | Expansion list the operator acts on. |
| components | Component names the operator is set up for. |
Definition at line 307 of file HelmholtzOp.hpp.
|
overrideprotecteddefault |
|
inlinestatic |
Create a weak-Helmholtz operator through the operator and block-operator factories.
Builds the interface object under the factory key "Helmholtz" + execStr and one block operator per element block under "BlockHelmholtz" + execStr + implStr (see ElmtOp::Create for the two-stage construction and for the session defaults used when execStr / implStr are empty).
| expansionList | Expansion list the operator acts on. |
| components | Names of the field components the operator is set up for. |
| execStr | Execution space ("Serial", "AVX" or "Device"); session default if empty. |
| implStr | Block implementation ("StdMat", "SumFac", "SumFacTOP"); session default if empty. |
Definition at line 200 of file HelmholtzOp.hpp.
Referenced by TestHelmholtz< TData >::RunTestCase(), and TestPreconOps< TData >::RunTestCase().
|
inline |
Set the constant symmetric diffusion tensor \(\mathbf{D}\) used by subsequent Apply() calls.
The tensor is passed in packed upper-triangular form, one entry per independent component, so diffCoeff holds ncoord * (ncoord + 1) / 2 values for a coordinate dimension of ncoord: {D00} in 1D, {D00, D01, D11} in 2D and {D00, D01, D11, D02, D12, D22} in 3D – the order the kernels index through LibUtilities::GetDiffCoeffMap() and the one the factors map onto. The values are copied down to every block operator; calling this again replaces them.
| diffCoeff | Packed tensor entries, in the order above. |
Definition at line 252 of file HelmholtzOp.hpp.
References Nektar::MultiRegions::HelmholtzOp< TData >::m_blockOp, Nektar::MultiRegions::HelmholtzOp< TData >::m_isSetDiffCoeff, and Nektar::MultiRegions::HelmholtzOp< TData >::m_isSetVarDiffCoeff.
|
inline |
Set the scalar weight \(\lambda\) of the mass term used by subsequent Apply() calls.
The value is copied down to every block operator; calling this again replaces it. A lambda of zero leaves the plain weak Laplacian – the StdMat implementations then skip the mass term's two matrix multiplications entirely, while the sum-factorised ones take no special path: they carry the zero through as a scaling of the physical values.
| lambda | Weight of the \((\phi_{pq}, u)\) term. |
Definition at line 227 of file HelmholtzOp.hpp.
References Nektar::MultiRegions::HelmholtzOp< TData >::m_blockOp, and Nektar::MultiRegions::HelmholtzOp< TData >::m_isSetLambda.
|
inline |
Set a spatially varying symmetric diffusion tensor.
Physical-space components use the same packed upper-triangular order as the constant overload: D00, D01, D11, D02, D12, D22. The field is borrowed and must outlive Apply(); changes to its values are visible on the next application. Implementations may change its interleaving. For homogeneous expansions these are the plane tensor components; the existing unit-coefficient homogeneous diffusion is retained.
Definition at line 273 of file HelmholtzOp.hpp.
References ASSERTL0, Nektar::LibUtilities::Field< TData, TState >::GetBlocks(), Nektar::MultiRegions::HelmholtzOp< TData >::m_blockOp, Nektar::MultiRegions::HelmholtzOp< TData >::m_isSetDiffCoeff, and Nektar::MultiRegions::HelmholtzOp< TData >::m_isSetVarDiffCoeff.
|
inlineoverrideprotected |
Apply the weak Helmholtz operator block by block.
Checks that in and out conform (equal component and homogeneous-mode counts) and that lambda and the diffusion tensor have been set, then hands each pair of blocks to the corresponding entry of m_blockOp. It then calls v_ApplyFFT(), which for a field with more than one homogeneous mode adds the weak z-Laplacian to out.
| in | Coefficient-space input field. |
| out | Coefficient-space output field; overwritten. |
Definition at line 329 of file HelmholtzOp.hpp.
References ASSERTL1, Nektar::MultiRegions::HelmholtzOp< TData >::m_isSetDiffCoeff, Nektar::MultiRegions::HelmholtzOp< TData >::m_isSetLambda, Nektar::MultiRegions::HelmholtzOp< TData >::m_isSetVarDiffCoeff, and Nektar::MultiRegions::HelmholtzOp< TData >::v_ApplyFFT().
|
protectedpure virtual |
Weak z-Laplacian, called by v_Apply() after the block loop; adds it to every output block of a multi-plane 3DH1 field and leaves any other field untouched.
Implemented in Nektar::MultiRegions::detail::HelmholtzOpImpl< ExecSpace, TData >.
Referenced by Nektar::MultiRegions::HelmholtzOp< TData >::v_Apply().
|
friend |
Definition at line 1 of file HelmholtzOp.hpp.
|
protected |
One block operator per element block of the expansion list; populated by ElmtOp::Create().
Definition at line 297 of file HelmholtzOp.hpp.
Referenced by Nektar::MultiRegions::HelmholtzOp< TData >::SetDiffCoeff(), Nektar::MultiRegions::HelmholtzOp< TData >::SetLambda(), and Nektar::MultiRegions::HelmholtzOp< TData >::SetVarDiffCoeff().
|
protected |
Set by SetDiffCoeff(); checked by v_Apply() in debug builds.
Definition at line 291 of file HelmholtzOp.hpp.
Referenced by Nektar::MultiRegions::HelmholtzOp< TData >::SetDiffCoeff(), Nektar::MultiRegions::HelmholtzOp< TData >::SetVarDiffCoeff(), and Nektar::MultiRegions::HelmholtzOp< TData >::v_Apply().
|
protected |
Set by SetLambda(); checked by v_Apply() in debug builds.
Definition at line 289 of file HelmholtzOp.hpp.
Referenced by Nektar::MultiRegions::HelmholtzOp< TData >::SetLambda(), and Nektar::MultiRegions::HelmholtzOp< TData >::v_Apply().
|
protected |
Whether a spatially varying tensor is selected.
Definition at line 293 of file HelmholtzOp.hpp.
Referenced by Nektar::MultiRegions::HelmholtzOp< TData >::SetDiffCoeff(), Nektar::MultiRegions::HelmholtzOp< TData >::SetVarDiffCoeff(), and Nektar::MultiRegions::HelmholtzOp< TData >::v_Apply().
|
inlinestatic |
Operator base name; Create() appends the execution space to it to form the factory key.
Definition at line 212 of file HelmholtzOp.hpp.