|
Nektar++
|
Whole-field interface of the advection element operator: writes scale * (V . grad u) at every quadrature point of every component u of the input field. More...
#include <AdvectionOp.hpp>
Public Member Functions | |
| void | SetScale (const TData &scale) |
| Set the scalar factor applied to the advection term on every block and on the homogeneous term, so that Apply() produces scale * (V . grad u). | |
| void | SetAppend (const bool &append) |
| Choose between overwriting and accumulating output. | |
| void | SetAdvVel (LibUtilities::Field< TData, FieldState::Phys > &advVel) |
| Supply the advection velocity field V; must be called before the first Apply(). | |
Public Member Functions inherited from Nektar::MultiRegions::ElmtOp< FieldState::Phys, FieldState::Phys, 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< 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. | |
Static Public Member Functions inherited from Nektar::MultiRegions::ElmtOp< FieldState::Phys, FieldState::Phys, 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 = "Advection" |
| Operator base name; Create() appends the execution space to it to form the operator-factory key. | |
Protected Member Functions | |
| 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 functions. | |
| ~AdvectionOp () override=default | |
| 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_SetScaleFFT (const TData &scale)=0 |
| Pass the scale factor on to the homogeneous term; called by SetScale(). | |
| 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_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. | |
Protected Member Functions inherited from Nektar::MultiRegions::ElmtOp< FieldState::Phys, FieldState::Phys, 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_isSetAdvVel = false |
| Whether SetAdvVel() has been called; checked by v_Apply(). | |
| std::vector< std::shared_ptr< AdvectionBlockOp< TData > > > | m_blockOp |
| One block operator per element block, filled by 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::Phys, FieldState::Phys, TData > |
Whole-field interface of the advection element operator: writes scale * (V . grad u) at every quadrature point of every component u of the input field.
The operator maps physical space to physical space. Before the first Apply() the advection velocity V must be supplied through SetAdvVel(); Apply() then evaluates, element by element, \( s \sum_k V_k \, \partial u / \partial x_k \) at each quadrature point – overwriting the output, or accumulating onto it when SetAppend(true) is set – with s the factor given by SetScale() (default 1). The same velocity is applied to every component of the input field. On a multi-plane 3DH1 expansion the sum includes the homogeneous term w du/dz, added after the block loop through the v_SetScaleFFT(), v_SetAdvVelFFT() and v_ApplyFFT() hooks.
As with the other element-operator families, this class sets the Apply() field states at compile time and drives one AdvectionBlockOp per element block; the per-execution-space behaviour lives in the block operators and, for the homogeneous term, in the z-operator owned by detail::AdvectionOpImpl, which implements the hooks. See ElmtOp for the block decomposition and factory scheme.
| TData | Floating-point type of the field data. |
Definition at line 97 of file AdvectionOp.hpp.
|
inlineprotected |
Construct the interface part of a concrete operator; 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 226 of file AdvectionOp.hpp.
|
overrideprotecteddefault |
|
inlinestatic |
Build a complete advection operator through the operator and block-operator factories.
See ElmtOp::Create for the two-stage construction and the execution-space/implementation lookup rules.
| expansionList | Expansion list the operator acts on. |
| components | Names of the field components. |
| execStr | Execution space ("Serial", "AVX" or "Device"); the session's setting is used if empty. |
| implStr | Implementation ("StdMat", "SumFac" or, on Device, "SumFacTOP"); the session's setting is used if empty. |
Definition at line 121 of file AdvectionOp.hpp.
Referenced by TestAdvection< TData >::RunTestCase().
|
inline |
Supply the advection velocity field V; must be called before the first Apply().
advVel must be built on the operator's expansion list and hold one component per coordinate dimension of the mesh, or three on a 3DH1 expansion, each a physical-space scalar field; the component count is checked with a level-1 assertion. Each block accessor is handed to the corresponding block operator, which keeps a non-owning pointer to it, and the whole field to v_SetAdvVelFFT(), so the field must outlive the operator's use. The block implementations reshape the velocity storage in place to their own interleave width the first time Apply() finds it at another width, updating the accessor's recorded width: the field's interleave width is modified as a side effect.
| advVel | Advection velocity field, one component per coordinate dimension (three on 3DH1). |
Definition at line 191 of file AdvectionOp.hpp.
References ASSERTL1, Nektar::LibUtilities::Field< TData, TState >::GetBlocks(), Nektar::LibUtilities::Field< TData, TState >::GetNumComponents(), Nektar::LibUtilities::Field< TData, TState >::GetNumHomoModes(), Nektar::MultiRegions::AdvectionOp< TData >::m_blockOp, Nektar::MultiRegions::AdvectionOp< TData >::m_isSetAdvVel, and Nektar::MultiRegions::AdvectionOp< TData >::v_SetAdvVelFFT().
|
inline |
Choose between overwriting and accumulating output.
With append set, Apply() adds scale * (V . grad u) onto the existing contents of the output field instead of overwriting it – useful when the advection term is one of several contributions to a right-hand side.
| append | True to accumulate, false (the initial state) to overwrite. |
Definition at line 163 of file AdvectionOp.hpp.
References Nektar::MultiRegions::AdvectionOp< TData >::m_blockOp.
|
inline |
Set the scalar factor applied to the advection term on every block and on the homogeneous term, so that Apply() produces scale * (V . grad u).
| scale | New scale factor (initially 1). |
Definition at line 142 of file AdvectionOp.hpp.
References Nektar::MultiRegions::AdvectionOp< TData >::m_blockOp, and Nektar::MultiRegions::AdvectionOp< TData >::v_SetScaleFFT().
|
inlineoverrideprotected |
Apply the advection operator block by block.
Checks that the fields conform (component and homogeneous-mode counts) and that the advection velocity has been set, then hands each input/output block pair to the corresponding entry of m_blockOp, and finally calls v_ApplyFFT() to add the homogeneous term.
| in | Physical-space input field. |
| out | Physical-space output field; overwritten, or accumulated onto when append is set. |
Definition at line 248 of file AdvectionOp.hpp.
References ASSERTL1, Nektar::MultiRegions::AdvectionOp< TData >::m_isSetAdvVel, and Nektar::MultiRegions::AdvectionOp< TData >::v_ApplyFFT().
|
protectedpure virtual |
Add the homogeneous term to out; called by v_Apply() after the block loop.
Implemented in Nektar::MultiRegions::detail::AdvectionOpImpl< ExecSpace, TData >.
Referenced by Nektar::MultiRegions::AdvectionOp< TData >::v_Apply().
|
protectedpure virtual |
Pass the advection velocity on to the homogeneous term; called by SetAdvVel().
Implemented in Nektar::MultiRegions::detail::AdvectionOpImpl< ExecSpace, TData >.
Referenced by Nektar::MultiRegions::AdvectionOp< TData >::SetAdvVel().
|
protectedpure virtual |
Pass the scale factor on to the homogeneous term; called by SetScale().
Implemented in Nektar::MultiRegions::detail::AdvectionOpImpl< ExecSpace, TData >.
Referenced by Nektar::MultiRegions::AdvectionOp< TData >::SetScale().
|
friend |
Definition at line 1 of file AdvectionOp.hpp.
|
protected |
One block operator per element block, filled by Create().
Definition at line 216 of file AdvectionOp.hpp.
Referenced by Nektar::MultiRegions::AdvectionOp< TData >::SetAdvVel(), Nektar::MultiRegions::AdvectionOp< TData >::SetAppend(), and Nektar::MultiRegions::AdvectionOp< TData >::SetScale().
|
protected |
Whether SetAdvVel() has been called; checked by v_Apply().
Definition at line 214 of file AdvectionOp.hpp.
Referenced by Nektar::MultiRegions::AdvectionOp< TData >::SetAdvVel(), and Nektar::MultiRegions::AdvectionOp< TData >::v_Apply().
|
inlinestatic |
Operator base name; Create() appends the execution space to it to form the operator-factory key.
Definition at line 133 of file AdvectionOp.hpp.