|
Nektar++
|
Whole-field interface of the trace extraction: interpolates the volume field of every element onto that element's trace quadrature points. More...
#include <PhysTraceExtractOp.hpp>
Public Member Functions | |
| void | ExtractTrace (const unsigned traceid, LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &out, const unsigned outOffset) |
Extract a single trace of every element into out at outOffset. | |
| void | ExtractTrace (const unsigned traceid, LibUtilities::BlockAccessor< TData, FieldState::Phys > &inblock, LibUtilities::BlockAccessor< TData, FieldState::Phys > &outblock, const unsigned outOffset, const unsigned blk) |
Extract a single trace of every element of block blk into outblock at outOffset. | |
| void | SetIsCollocated (const bool isCollocated) |
| Set the tangential collocation flags of every block operator, passing false to force the fast path off. | |
| void | ApplyNormalComponent (LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &out) |
The outward normal component of a vector-valued field on the element-local traces; see PhysTraceExtractBlockOp:: ApplyNormalComponent(). in has nvar * ndim components, ndim being the coordinate dimension, and out has nvar. The normals are each element's own (MultiRegions::LocalTraceNormalKey), on the element's trace points, so the Gauss-Lobatto trace points are not supported. A scratch trace field is built on first use, for the block implementations that extract every component first. | |
| void | SetUseGLLTracePoints (const bool useGLLTracePoints) |
| Extract onto the Gauss-Lobatto trace points rather than the element's own. | |
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< PhysTraceExtractOp< TData > > | Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="") |
| Create a trace extraction 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 = "PhysTraceExtract" |
| Operator base name; Create() appends the execution space to it to form the factory key. | |
Protected Member Functions | |
| PhysTraceExtractOp (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. | |
| ~PhysTraceExtractOp () override=default | |
| void | v_Apply (LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &out) override |
| Extract every trace of every element, block by block. | |
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 | |
| std::vector< std::shared_ptr< PhysTraceExtractBlockOp< TData > > > | m_blockOp |
| One block operator per element block of the expansion list; populated by ElmtOp::Create(). | |
| bool | m_useGLLTracePoints = false |
| The trace quadrature the blocks interpolate onto; see SetUseGLLTracePoints(). | |
| LibUtilities::Field< TData, FieldState::Phys > | m_normalScratch |
| Every component's trace for ApplyNormalComponent(), for the block implementations that extract them before contracting. | |
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 trace extraction: interpolates the volume field of every element onto that element's trace quadrature points.
As with the other element-operator families, this class exists to set the Apply() parameter types at compile time and to drive the per-block operators: it holds one PhysTraceExtractBlockOp per element block, and v_Apply() hands each block of the input/output fields to the matching entry. All numerical work happens in the block operators.
Both fields are in FieldState::Phys, but they are not the same shape and the type system does not tell them apart:
This is the mirror image of IProductWRTPhysTrace, which reads the packed trace layout and writes the volume one. The conformance checks in v_Apply() and ExtractTrace() compare only component counts and homogeneous-mode counts, so passing the two layouts the wrong way round is not caught here.
This operator has no append flag: both paths write the entries they are responsible for.
| TData | Floating-point type of the field data. |
Definition at line 181 of file PhysTraceExtractOp.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 444 of file PhysTraceExtractOp.hpp.
|
overrideprotecteddefault |
|
inline |
The outward normal component of a vector-valued field on the element-local traces; see PhysTraceExtractBlockOp:: ApplyNormalComponent(). in has nvar * ndim components, ndim being the coordinate dimension, and out has nvar. The normals are each element's own (MultiRegions::LocalTraceNormalKey), on the element's trace points, so the Gauss-Lobatto trace points are not supported. A scratch trace field is built on first use, for the block implementations that extract every component first.
Definition at line 353 of file PhysTraceExtractOp.hpp.
References ASSERTL0, ASSERTL1, Nektar::LibUtilities::Field< TData, TState >::GetBlocks(), Nektar::LibUtilities::Field< TData, TState >::GetNumComponents(), Nektar::MultiRegions::PhysTraceExtractOp< TData >::m_blockOp, Nektar::MultiRegions::Operator< TData >::m_expansionList, Nektar::MultiRegions::PhysTraceExtractOp< TData >::m_normalScratch, and Nektar::MultiRegions::PhysTraceExtractOp< TData >::m_useGLLTracePoints.
|
inlinestatic |
Create a trace extraction operator through the operator and block-operator factories.
Builds the interface object under the factory key "PhysTraceExtract" + execStr and one block operator per element block under "BlockPhysTraceExtract" + 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 resolves to SumFac on the host and SumFacTOP on the device, see the file notes. |
Definition at line 208 of file PhysTraceExtractOp.hpp.
Referenced by Nektar::MultiRegions::detail::PhysTraceExtractBndCond< ExecSpace, TData >::PhysTraceExtractBndCond(), TestFusedElmt< Policy, VISCOUS >::Reference(), TestAdvectionWeakDG< TData >::RunTestCase(), TestPhysTraceExtract< TData >::RunTestCase(), TestPhysTraceExtract< TData >::RunTestCaseExtractTrace(), and TestIProductWRTPhysNormalDerivTrace< TData >::SetTestCaseDivTest().
|
inline |
Extract a single trace of every element of block blk into outblock at outOffset.
The block-level counterpart of the Field overload above, for a caller holding single blocks rather than Fields.
| traceid | Local trace index within the element's shape. |
| inblock | Volume-shaped input block, laid out as block blk of GetBlockAttributes(). |
| outblock | Packed trace block, laid out as block blk of GetLocTraceBlockAttributes(), written at outOffset. |
| outOffset | Offset of this trace's data within one element's packed trace entries, counted in entries per element. |
| blk | Index of the block of the operator's expansion list whose block operator is applied. |
Definition at line 291 of file PhysTraceExtractOp.hpp.
References ASSERTL1, Nektar::LibUtilities::BlockAccessor< TData, TState >::GetNumComponents(), Nektar::LibUtilities::BlockAccessor< TData, TState >::GetNumHomoModes(), and Nektar::MultiRegions::PhysTraceExtractOp< TData >::m_blockOp.
|
inline |
Extract a single trace of every element into out at outOffset.
The per-trace counterpart of Apply(): rather than filling the whole packed record it interpolates onto trace traceid alone and writes that trace's entries, leaving the rest of the record untouched by this call. A caller assembling the whole boundary therefore issues one call per trace, advancing outOffset in the packed order of the traces rather than in trace-id order; that is how the operator-level unit tests drive it, for instance 3, 1, 0, 2 on a quadrilateral and 4, 2, 1, 3, 0, 5 on a hexahedron.
| traceid | Local trace index within the element's shape, in the Nektar edge/face numbering; the implementations map it to a (normal direction, position) pair. |
| in | Volume-shaped input field; see the class notes for its layout. |
| out | Packed trace field, written at outOffset. |
| outOffset | Offset of this trace's data within one element's packed trace entries, counted in entries per element. |
out left unwritten.ntbasis row stride as an explicit tstride argument rather than from the face-loop bound, which is one on this path; the defect the file notes describe is on the bulk path. Definition at line 258 of file PhysTraceExtractOp.hpp.
References Nektar::MultiRegions::PhysTraceExtractOp< TData >::ExtractTrace(), and Nektar::MultiRegions::PhysTraceExtractOp< TData >::m_blockOp.
Referenced by Nektar::MultiRegions::PhysTraceExtractOp< TData >::ExtractTrace().
|
inline |
Set the tangential collocation flags of every block operator, passing false to force the fast path off.
The implementations record one collocation flag per (normal direction, tangential direction) at setup, six of them in three dimensions, set when the trace quadrature points of that direction coincide with the volume quadrature points of the corresponding direction. Where the flag is set the tangential interpolation collapses to a straight copy of the plane. Clearing the flags selects the general contraction instead, which is how the unit tests reach that code path on meshes whose points do coincide; it is a different route to the same mathematical operation.
| isCollocated | Value written to every flag of every block. |
Definition at line 334 of file PhysTraceExtractOp.hpp.
References Nektar::MultiRegions::PhysTraceExtractOp< TData >::m_blockOp.
|
inline |
Extract onto the Gauss-Lobatto trace points rather than the element's own.
The operator evaluates the volume field at whichever trace points the expansion reports, so the choice is a choice of table, not an extra stage: passing true builds the interpolation against the Gauss-Lobatto variant and the values land directly on it.
It matters on the collapsed direction of a face of a tetrahedron, prism or pyramid, where the element's own trace quadrature is Gauss-Radau and has no point at the collapsed end, while the trace and boundary expansions of a continuous field carry Gauss-Lobatto with one point more. Extracting onto a continuous field's boundary needs that variant; a discontinuous field's trace keeps the element's own, and passing true there would interpolate onto points the destination does not have.
The output storage must be sized the same way; see MultiRegions::GetLocTraceBlockAttributes(), whose last argument carries the same choice. The collocation flags are worked out again for the new points, replacing any set by SetIsCollocated(), so call this first.
| useGLLTracePoints | True for the Gauss-Lobatto variant. |
Definition at line 415 of file PhysTraceExtractOp.hpp.
References Nektar::MultiRegions::PhysTraceExtractOp< TData >::m_blockOp, and Nektar::MultiRegions::PhysTraceExtractOp< TData >::m_useGLLTracePoints.
|
inlineoverrideprotected |
Extract every trace of every element, block by block.
Checks that the fields agree in component count and in number of homogeneous modes – not that their block layouts are the volume and trace ones described in the class notes – then hands each pair of blocks to the corresponding entry of m_blockOp, which fills the whole packed trace record of each element.
| in | Volume-shaped input field. |
| out | Packed trace output field. |
Definition at line 468 of file PhysTraceExtractOp.hpp.
References ASSERTL1.
|
friend |
Definition at line 1 of file PhysTraceExtractOp.hpp.
|
protected |
One block operator per element block of the expansion list; populated by ElmtOp::Create().
Definition at line 428 of file PhysTraceExtractOp.hpp.
Referenced by Nektar::MultiRegions::PhysTraceExtractOp< TData >::ApplyNormalComponent(), Nektar::MultiRegions::PhysTraceExtractOp< TData >::ExtractTrace(), Nektar::MultiRegions::PhysTraceExtractOp< TData >::ExtractTrace(), Nektar::MultiRegions::PhysTraceExtractOp< TData >::SetIsCollocated(), and Nektar::MultiRegions::PhysTraceExtractOp< TData >::SetUseGLLTracePoints().
|
protected |
Every component's trace for ApplyNormalComponent(), for the block implementations that extract them before contracting.
Definition at line 434 of file PhysTraceExtractOp.hpp.
Referenced by Nektar::MultiRegions::PhysTraceExtractOp< TData >::ApplyNormalComponent().
|
protected |
The trace quadrature the blocks interpolate onto; see SetUseGLLTracePoints().
Definition at line 431 of file PhysTraceExtractOp.hpp.
Referenced by Nektar::MultiRegions::PhysTraceExtractOp< TData >::ApplyNormalComponent(), and Nektar::MultiRegions::PhysTraceExtractOp< TData >::SetUseGLLTracePoints().
|
inlinestatic |
Operator base name; Create() appends the execution space to it to form the factory key.
Definition at line 220 of file PhysTraceExtractOp.hpp.