Nektar++
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
Nektar::MultiRegions::PhysDerivOp< TData > Class Template Referenceabstract

Element-block operator that computes the physical-space derivative \(\nabla u\) over a collection of elements. More...

#include <PhysDerivOp.hpp>

Inheritance diagram for Nektar::MultiRegions::PhysDerivOp< TData >:
[legend]

Static Public Member Functions

static std::shared_ptr< PhysDerivOp< TData > > Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
 Create a physical-derivative operator, its per-block operators and, for a multi-plane 3DH1 expansion, its homogeneous z-derivative.
 
- 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 = "PhysDeriv"
 Operator base name; ElmtOp::Create() appends the execution space to it to form the factory key, and uses it to look up the session's default block implementation.
 

Protected Member Functions

 PhysDerivOp (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.
 
 ~PhysDerivOp () override=default
 
void v_Apply (LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &out) override
 Apply the physical derivative block by block, adding the homogeneous z-derivative for a multi-plane 3DH1 field.
 
virtual void v_ApplyFFT (LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &out)=0
 Homogeneous z-derivative, called by v_Apply() after the block loop; writes the z component of every output block of a multi-plane 3DH1 field and leaves any other field untouched.
 
- 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< PhysDerivBlockOp< 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::Phys, FieldState::Phys, TData >
 

Additional Inherited Members

- 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.
 

Detailed Description

template<typename TData>
class Nektar::MultiRegions::PhysDerivOp< TData >

Element-block operator that computes the physical-space derivative \(\nabla u\) over a collection of elements.

Definition at line 110 of file PhysDerivOp.hpp.

Constructor & Destructor Documentation

◆ PhysDerivOp()

template<typename TData >
Nektar::MultiRegions::PhysDerivOp< TData >::PhysDerivOp ( const MultiRegions::ExpListSharedPtr &  expansionList,
const std::vector< std::string > &  components 
)
inlineprotected

Construct the interface part of a concrete implementation; called by the factory-registered creator functions.

Parameters
expansionListExpansion list the operator acts on.
componentsComponent names the operator is set up for.

Definition at line 172 of file PhysDerivOp.hpp.

175 components)
176 {
177 }
friend class ElmtOp< FieldState::Phys, FieldState::Phys, TData >

◆ ~PhysDerivOp()

template<typename TData >
Nektar::MultiRegions::PhysDerivOp< TData >::~PhysDerivOp ( )
overrideprotecteddefault

Member Function Documentation

◆ Create()

template<typename TData >
static std::shared_ptr< PhysDerivOp< TData > > Nektar::MultiRegions::PhysDerivOp< TData >::Create ( const MultiRegions::ExpListSharedPtr &  expansionList,
const std::vector< std::string > &  components,
const std::string &  execStr = "",
const std::string &  implStr = "" 
)
inlinestatic

Create a physical-derivative operator, its per-block operators and, for a multi-plane 3DH1 expansion, its homogeneous z-derivative.

Builds the interface object under the factory key "PhysDeriv" + execStr and one block operator per element block under "BlockPhysDeriv" + execStr + implStr; see ElmtOp::Create for the two-stage construction and for the session defaults used when execStr or implStr are empty. If expansionList is a 3D-homogeneous-1D expansion holding more than one homogeneous plane on this rank, the constructor of detail::PhysDerivOpImpl additionally builds its z-derivative, detail::PhysDerivOpImpl::m_zOp; for every other expansion that is left null.

Parameters
expansionListExpansion list the operator acts on.
componentsNames of the field components the operator is set up for; these name the input components, the output field carrying coordDim (or, for multi-plane 3DH1, three) of them each.
execStrExecution space ("Serial", "AVX" or "Device"); session default if empty.
implStrBlock implementation ("StdMat", "SumFac" or, on the Device space, "SumFacTOP"); session default if empty.
Returns
The fully assembled operator, ready to Apply.

Definition at line 144 of file PhysDerivOp.hpp.

148 {
150 template Create<PhysDerivOp, PhysDerivBlockOp>(
151 expansionList, components, execStr, implStr);
152 }

Referenced by Nektar::detail::HOutflowBndCondOpImpl< ExecSpace, TData >::BuildBoundaryElementData(), TestFusedElmt< Policy, VISCOUS >::Reference(), and TestPhysDeriv< TData >::RunTestCase().

◆ v_Apply()

template<typename TData >
void Nektar::MultiRegions::PhysDerivOp< TData >::v_Apply ( LibUtilities::Field< TData, FieldState::Phys > &  in,
LibUtilities::Field< TData, FieldState::Phys > &  out 
)
inlineoverrideprotected

Apply the physical derivative block by block, adding the homogeneous z-derivative for a multi-plane 3DH1 field.

Requires that the fields conform – out must have exactly coordDim times as many components as in for a field with a single homogeneous mode and exactly three times as many for one with several, and the same number of homogeneous modes – 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 writes the z component of every output block.

Parameters
inPhysical-space input field.
outPhysical-space output field, overwritten; see the file notes for its component count.

Definition at line 198 of file PhysDerivOp.hpp.

200 {
201 ASSERTL1(in.GetNumComponents() ==
202 out.GetNumComponents() /
203 (in.GetNumHomoModes() == 1
204 ? static_cast<unsigned int>(
205 this->m_expansionList->GetCoordim(0))
206 : 3u),
207 "Number of input and output components differ");
208
209 ASSERTL1(in.GetNumHomoModes() == out.GetNumHomoModes(),
210 "Number of input and output homogeneous modes differ");
211
212 // Loop over the blocks.
213 for (unsigned int blk = 0; blk < this->m_blockOp.size(); ++blk)
214 {
215 // Block dependent.
216 auto &inblock = in.GetBlocks()[blk];
217 auto &outblock = out.GetBlocks()[blk];
218
219 this->m_blockOp[blk]->Apply(inblock, outblock);
220 }
221
222 // Apply FFT.
223 v_ApplyFFT(in, out);
224 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
virtual void v_ApplyFFT(LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &out)=0
Homogeneous z-derivative, called by v_Apply() after the block loop; writes the z component of every o...
std::vector< std::shared_ptr< PhysDerivBlockOp< TData > > > m_blockOp
One block operator per element block of the expansion list; populated by ElmtOp::Create().
NEK_DEVICE_KERNEL void const TData *NEK_RESTRICT const TData *NEK_RESTRICT const size_t const unsigned int const unsigned int const unsigned int const unsigned int const size_t const TData *NEK_RESTRICT const TData *NEK_RESTRICT const TUseSharedWsp TData *NEK_RESTRICT const TData *NEK_RESTRICT in
NEK_DEVICE_KERNEL void const TData *NEK_RESTRICT const TData *NEK_RESTRICT const size_t const unsigned int const unsigned int const unsigned int const unsigned int const size_t const TData *NEK_RESTRICT const TData *NEK_RESTRICT const TUseSharedWsp TData *NEK_RESTRICT const TData *NEK_RESTRICT TData *NEK_RESTRICT out

References ASSERTL1, and Nektar::MultiRegions::PhysDerivOp< TData >::v_ApplyFFT().

◆ v_ApplyFFT()

template<typename TData >
virtual void Nektar::MultiRegions::PhysDerivOp< TData >::v_ApplyFFT ( LibUtilities::Field< TData, FieldState::Phys > &  in,
LibUtilities::Field< TData, FieldState::Phys > &  out 
)
protectedpure virtual

Homogeneous z-derivative, called by v_Apply() after the block loop; writes the z component of every output block of a multi-plane 3DH1 field and leaves any other field untouched.

Implemented in Nektar::MultiRegions::detail::PhysDerivOpImpl< ExecSpace, TData >.

Referenced by Nektar::MultiRegions::PhysDerivOp< TData >::v_Apply().

Friends And Related Symbol Documentation

◆ ElmtOp< FieldState::Phys, FieldState::Phys, TData >

template<typename TData >
friend class ElmtOp< FieldState::Phys, FieldState::Phys, TData >
friend

Definition at line 1 of file PhysDerivOp.hpp.

Member Data Documentation

◆ m_blockOp

template<typename TData >
std::vector<std::shared_ptr<PhysDerivBlockOp<TData> > > Nektar::MultiRegions::PhysDerivOp< TData >::m_blockOp
protected

One block operator per element block of the expansion list; populated by ElmtOp::Create().

Definition at line 162 of file PhysDerivOp.hpp.

◆ name

template<typename TData >
const std::string Nektar::MultiRegions::PhysDerivOp< TData >::name = "PhysDeriv"
inlinestatic

Operator base name; ElmtOp::Create() appends the execution space to it to form the factory key, and uses it to look up the session's default block implementation.

Definition at line 157 of file PhysDerivOp.hpp.