|
Nektar++
|
#include <BndCondPhysOp.hpp>
Public Member Functions | |
| void | SetStreamID (const unsigned int streamID) |
Refill the storage on stream streamID, the default stream unless set. The trace flux operator sets the one it reads the storage on. | |
| void | ResetStreamID () |
| Refill on the default stream again, undoing SetStreamID(). | |
| size_t | GetNumBlocks () const |
| Number of blocks the boundary data is stored in. | |
| size_t | GetNumComponents () const |
| Components held per block, i.e. the range valid for GetBndCondType(). | |
| void | UpdateBndPhys (const TData &time=0.0) |
Bring the stored values up to date for time time. | |
| void | GetTraceLocation (const size_t tid, unsigned &blk, size_t &offset, size_t &compOffset) |
Where the data for global trace tid lives. | |
| bool | HasTrace (const size_t tid) const |
Does this operator hold boundary data for global trace tid? | |
| const TData * | GetBlockPtr (const unsigned blk, const unsigned int streamID=0) |
Base pointer for block blk, fetched through the memory manager on stream streamID. | |
| TData * | UpdateBlockPtr (const unsigned blk, const unsigned int streamID=0) |
Writable base pointer for block blk. | |
| size_t | GetBlockCompStride (const unsigned blk) const |
Phys points in block blk, i.e. the stride between its components and equally the number of points to walk when transforming the whole block. | |
| const TData * | GetBlockNormals (const unsigned blk) |
Outward normals of block blk, in the same layout as its values: component major, GetBlockCompStride() apart, one component per coordinate direction. | |
| SpatialDomains::BoundaryConditionType | GetBndCondType (const unsigned blk, const unsigned comp) const |
Condition type component comp of block blk carries. | |
| const std::string & | GetBndUserDefined (const unsigned blk, const unsigned comp) const |
USERDEFINEDTYPE of component comp of block blk. | |
| bool | GetBndUserDefinedParam (const unsigned blk, const unsigned comp, const std::string &name, TData &value) const |
| A named parameter carried on the boundary tag. | |
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< BndCondPhysOp< TData > > | Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="") |
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 = "BndCondPhys" |
Protected Member Functions | |
| BndCondPhysOp (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components) | |
| ~BndCondPhysOp () override=default | |
| virtual size_t | v_GetNumBlocks () const =0 |
| virtual void | v_GetTraceLocation (const size_t tid, unsigned &blk, size_t &offset, size_t &compOffset)=0 |
| virtual bool | v_HasTrace (const size_t tid) const =0 |
| virtual const TData * | v_GetBlockPtr (const unsigned blk, const unsigned int streamID)=0 |
| virtual TData * | v_UpdateBlockPtr (const unsigned blk, const unsigned int streamID)=0 |
| virtual size_t | v_GetBlockCompStride (const unsigned blk) const =0 |
| virtual const TData * | v_GetBlockNormals (const unsigned blk)=0 |
| virtual SpatialDomains::BoundaryConditionType | v_GetBndCondType (const unsigned blk, const unsigned comp) const =0 |
| virtual bool | v_GetBndUserDefinedParam (const unsigned blk, const unsigned comp, const std::string &name, TData &value) const =0 |
| virtual const std::string & | v_GetBndUserDefined (const unsigned blk, const unsigned comp) const =0 |
| virtual void | v_UpdateBndPhys (const TData &time)=0 |
Protected Attributes | |
| unsigned int | m_opStreamID = m_defaultStreamID |
| Stream the storage is refilled on. See SetStreamID(). | |
| bool | m_bndPhysInitialised = false |
| Set once the constructor's initial evaluation has happened, so that UpdateBndPhys() can skip regions that will never change. | |
| bool | m_hasTimeDependentBndPhys = false |
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. | |
Static Protected Attributes | |
| static constexpr unsigned int | m_defaultStreamID = 0 |
| Stream the storage is refilled on unless SetStreamID() says otherwise. | |
Definition at line 48 of file BndCondPhysOp.hpp.
|
inlineprotected |
Definition at line 268 of file BndCondPhysOp.hpp.
|
overrideprotecteddefault |
|
inlinestatic |
Definition at line 52 of file BndCondPhysOp.hpp.
Referenced by TestBndCondPhys< TData >::RunTestCase().
|
inline |
Phys points in block blk, i.e. the stride between its components and equally the number of points to walk when transforming the whole block.
Definition at line 169 of file BndCondPhysOp.hpp.
References Nektar::MultiRegions::BndCondPhysOp< TData >::v_GetBlockCompStride().
|
inline |
Outward normals of block blk, in the same layout as its values: component major, GetBlockCompStride() apart, one component per coordinate direction.
Cached in the data warehouse, so repeated calls are free and every boundary condition that needs a normal direction - a symmetry plane, a characteristic inflow, an outflow deciding whether it is subsonic - draws on one copy.
Definition at line 184 of file BndCondPhysOp.hpp.
References Nektar::MultiRegions::BndCondPhysOp< TData >::v_GetBlockNormals().
|
inline |
Base pointer for block blk, fetched through the memory manager on stream streamID.
Definition at line 144 of file BndCondPhysOp.hpp.
References Nektar::MultiRegions::BndCondPhysOp< TData >::v_GetBlockPtr().
|
inline |
Condition type component comp of block blk carries.
Values of every type are stored identically; what differs is how they must be interpreted, so a consumer that treats a Neumann or Robin boundary differently from a Dirichlet one asks here. Never SpatialDomains::ePeriodic - those regions hold no values and are not given a block.
Definition at line 198 of file BndCondPhysOp.hpp.
References Nektar::MultiRegions::BndCondPhysOp< TData >::v_GetBndCondType().
|
inline |
USERDEFINEDTYPE of component comp of block blk.
Empty when the session gives none. The tags are solver specific, so this hands back the session's own string rather than a code: a compressible flow solver knows what "WallAdiabatic" means and this operator does not. A condition so tagged is still an ordinary condition of its GetBndCondType() as far as the storage here goes.
Host side only - the string is not something a kernel can read. A caller that needs the distinction on device should resolve these once into its own per-block table of codes, as it must do for its own enum anyway.
Definition at line 217 of file BndCondPhysOp.hpp.
References Nektar::MultiRegions::BndCondPhysOp< TData >::v_GetBndUserDefined().
|
inline |
A named parameter carried on the boundary tag.
A USERDEFINEDTYPE may carry parameters after the condition itself,
USERDEFINEDTYPE="WallViscous:twall=300.15" USERDEFINEDTYPE="WallViscous:twall=TInf"
so that a quantity belonging to one region is written on that region rather than as a session-wide parameter. Two regions may then hold different values, which a session parameter cannot express.
The value is evaluated as an expression against the session, as the Rotated: periodic tag does, so it may name session parameters and use arithmetic rather than having to be a literal.
GetBndUserDefined() returns the condition with any such parameters stripped, so a condition that takes none - and the check that every tag is claimed by some operator - are unaffected by their presence.
| blk | - Storage block. |
| comp | - Component; a region carries one tag for all of them. |
| name | - Parameter name, matched without regard to case. |
| value | - Set only when the parameter is present, so a caller may seed it with a default and ignore the return. |
Definition at line 251 of file BndCondPhysOp.hpp.
References Nektar::MultiRegions::BndCondPhysOp< TData >::name, and Nektar::MultiRegions::BndCondPhysOp< TData >::v_GetBndUserDefinedParam().
|
inline |
Number of blocks the boundary data is stored in.
Definition at line 77 of file BndCondPhysOp.hpp.
References Nektar::MultiRegions::BndCondPhysOp< TData >::v_GetNumBlocks().
|
inline |
Components held per block, i.e. the range valid for GetBndCondType().
Definition at line 83 of file BndCondPhysOp.hpp.
References Nektar::MultiRegions::Operator< TData >::m_components.
|
inline |
Where the data for global trace tid lives.
The mapping is fixed once the operator is constructed, so a caller that gathers many traces can resolve it up front and keep only the integers, rather than paying a virtual call and two map lookups per trace. The base pointer is deliberately not returned: it must come from GetBlockPtr() at the point of use, so that the memory manager still sees every access.
Definition at line 121 of file BndCondPhysOp.hpp.
References Nektar::MultiRegions::BndCondPhysOp< TData >::v_GetTraceLocation().
|
inline |
Does this operator hold boundary data for global trace tid?
GetTraceLocation() assumes it does and asserts otherwise, which only reports in a debug build. This is the question asked before that, by a caller holding a trace it cannot pair locally: a trace on no boundary region of this rank is one whose neighbour lives on another, and it is the answer here rather than an out-of-range read that must decide which.
Definition at line 137 of file BndCondPhysOp.hpp.
References Nektar::MultiRegions::BndCondPhysOp< TData >::v_HasTrace().
|
inline |
Refill on the default stream again, undoing SetStreamID().
Definition at line 71 of file BndCondPhysOp.hpp.
References Nektar::MultiRegions::BndCondPhysOp< TData >::m_defaultStreamID, and Nektar::MultiRegions::BndCondPhysOp< TData >::m_opStreamID.
|
inline |
Refill the storage on stream streamID, the default stream unless set. The trace flux operator sets the one it reads the storage on.
Definition at line 65 of file BndCondPhysOp.hpp.
References Nektar::MultiRegions::BndCondPhysOp< TData >::m_opStreamID.
|
inline |
Writable base pointer for block blk.
For an operator that computes boundary values rather than evaluating them from the session - a wall state derived from the interior trace, say. Writing here rather than intercepting the gather keeps the flux path unchanged: consumers refetch through GetBlockPtr() on every apply and so pick the new values up without knowing where they came from.
The layout is the region's own component-major phys layout, the same one GetTraceLocation() resolves into.
Definition at line 162 of file BndCondPhysOp.hpp.
References Nektar::MultiRegions::BndCondPhysOp< TData >::v_UpdateBlockPtr().
|
inline |
Bring the stored values up to date for time time.
The constructor evaluates every region once, so this is only needed where a condition actually depends on time; it returns immediately otherwise. Callers on the DG path should invoke it once per step, as LinearSystemOp does with the corresponding CG operators - without it a time-dependent condition stays pinned at the value it had when the operator was built.
Consumers need do nothing to see the new values: they reach the data through GetBlockPtr(), which is refetched per apply.
Definition at line 101 of file BndCondPhysOp.hpp.
References Nektar::MultiRegions::BndCondPhysOp< TData >::m_bndPhysInitialised, Nektar::MultiRegions::BndCondPhysOp< TData >::m_hasTimeDependentBndPhys, and Nektar::MultiRegions::BndCondPhysOp< TData >::v_UpdateBndPhys().
Referenced by Nektar::MultiRegions::detail::BndCondPhysOpImpl< ExecSpace, TData >::BndCondPhysOpImpl().
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
Implemented in Nektar::MultiRegions::detail::BndCondPhysOpImpl< ExecSpace, TData >.
Referenced by Nektar::MultiRegions::BndCondPhysOp< TData >::GetBlockPtr().
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
Implemented in Nektar::MultiRegions::detail::BndCondPhysOpImpl< ExecSpace, TData >.
Referenced by Nektar::MultiRegions::BndCondPhysOp< TData >::GetNumBlocks().
|
protectedpure virtual |
|
protectedpure virtual |
Implemented in Nektar::MultiRegions::detail::BndCondPhysOpImpl< ExecSpace, TData >.
Referenced by Nektar::MultiRegions::BndCondPhysOp< TData >::HasTrace().
|
protectedpure virtual |
|
protectedpure virtual |
Implemented in Nektar::MultiRegions::detail::BndCondPhysOpImpl< ExecSpace, TData >.
Referenced by Nektar::MultiRegions::BndCondPhysOp< TData >::UpdateBndPhys().
|
protected |
Set once the constructor's initial evaluation has happened, so that UpdateBndPhys() can skip regions that will never change.
Definition at line 265 of file BndCondPhysOp.hpp.
Referenced by Nektar::MultiRegions::BndCondPhysOp< TData >::UpdateBndPhys(), and Nektar::MultiRegions::detail::BndCondPhysOpImpl< ExecSpace, TData >::v_UpdateBndPhys().
|
staticconstexprprotected |
Stream the storage is refilled on unless SetStreamID() says otherwise.
Definition at line 259 of file BndCondPhysOp.hpp.
Referenced by Nektar::MultiRegions::BndCondPhysOp< TData >::ResetStreamID().
|
protected |
Definition at line 266 of file BndCondPhysOp.hpp.
Referenced by Nektar::MultiRegions::detail::BndCondPhysOpImpl< ExecSpace, TData >::BndCondPhysOpImpl(), and Nektar::MultiRegions::BndCondPhysOp< TData >::UpdateBndPhys().
|
protected |
Stream the storage is refilled on. See SetStreamID().
Definition at line 261 of file BndCondPhysOp.hpp.
Referenced by Nektar::MultiRegions::detail::BndCondPhysOpImpl< ExecSpace, TData >::EvaluateRegion(), Nektar::MultiRegions::BndCondPhysOp< TData >::ResetStreamID(), and Nektar::MultiRegions::BndCondPhysOp< TData >::SetStreamID().
|
inlinestatic |
Definition at line 61 of file BndCondPhysOp.hpp.
Referenced by Nektar::MultiRegions::BndCondPhysOp< TData >::GetBndUserDefinedParam(), and Nektar::MultiRegions::detail::BndCondPhysOpImpl< ExecSpace, TData >::v_GetBndUserDefinedParam().