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

Whole-field interface of the backward transform: evaluates a coefficient-space field at the quadrature points of every element. More...

#include <BwdTransOp.hpp>

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

Public Member Functions

void SetAppend (const bool &append)
 Switch all block operators between overwrite and accumulate mode.
 
- Public Member Functions inherited from Nektar::MultiRegions::ElmtOp< FieldState::Coeff, 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< BwdTransOp< TData > > Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
 Create a backward-transform operator through the operator and block-operator factories.
 
- Static Public Member Functions inherited from Nektar::MultiRegions::ElmtOp< FieldState::Coeff, 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 = "BwdTrans"
 Operator base name; Create() appends the execution space to it to form the factory key.
 

Protected Member Functions

 BwdTransOp (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.
 
 ~BwdTransOp () override=default
 
void v_Apply (LibUtilities::Field< TData, FieldState::Coeff > &in, LibUtilities::Field< TData, FieldState::Phys > &out) override
 Apply the backward transform block by block.
 
- Protected Member Functions inherited from Nektar::MultiRegions::ElmtOp< FieldState::Coeff, 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< BwdTransBlockOp< 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::Phys, TData >
 

Detailed Description

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

Whole-field interface of the backward transform: evaluates a coefficient-space field at the quadrature points of every element.

As with the other element-operator families, this class exists to fix the Apply() parameter types at compile time – input in FieldState::Coeff, output in FieldState::Phys – and to drive the per-block operators: it holds one BwdTransBlockOp per element block, and v_Apply() hands each block of the input and output fields to the matching entry. All numerical work happens in the block operators.

By default Apply() overwrites the output field; after SetAppend(true) it instead accumulates the transform onto the output's existing values.

Template Parameters
TDataFloating-point type of the field data.
See also
BwdTransBlockOp for the per-block interface and the implementation strategies available per execution space.

Definition at line 99 of file BwdTransOp.hpp.

Constructor & Destructor Documentation

◆ BwdTransOp()

template<typename TData >
Nektar::MultiRegions::BwdTransOp< TData >::BwdTransOp ( 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 171 of file BwdTransOp.hpp.

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

◆ ~BwdTransOp()

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

Member Function Documentation

◆ Create()

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

Create a backward-transform operator through the operator and block-operator factories.

Builds the interface object under the factory key "BwdTrans" + execStr and one block operator per element block under "BlockBwdTrans" + execStr + implStr; see ElmtOp::Create for the two-stage construction and for the session defaults used when execStr or implStr are empty.

Parameters
expansionListExpansion list the operator acts on.
componentsNames of the field components the operator is set up for.
execStrExecution space ("Serial", "AVX" or "Device"); session default if empty.
implStrBlock implementation ("StdMat", "SumFac", "SumFacTOP" (Device only)); session default if empty.
Returns
The fully assembled operator, ready to Apply().

Definition at line 125 of file BwdTransOp.hpp.

129 {
131 template Create<BwdTransOp, BwdTransBlockOp>(
132 expansionList, components, execStr, implStr);
133 }

Referenced by Nektar::detail::HOPressureBndCondOpImpl< ExecSpace, TData >::BuildBoundaryVelocityData(), Nektar::MultiRegions::detail::LinAdvDiffReactionOpImpl< ExecSpace, TData >::LinAdvDiffReactionOpImpl(), TestBwdTrans< TData >::RunTestCase(), TestPhysLiftProject< TData >::RunVariant(), and Nektar::FilterReynoldsStresses::v_Initialise().

◆ SetAppend()

template<typename TData >
void Nektar::MultiRegions::BwdTransOp< TData >::SetAppend ( const bool &  append)
inline

Switch all block operators between overwrite and accumulate mode.

With append set, subsequent Apply() calls add the backward transform onto the output field's existing contents instead of overwriting them. The default is overwrite.

Parameters
appendAccumulate into the output when true.

Definition at line 149 of file BwdTransOp.hpp.

150 {
151 // Loop over the blocks.
152 for (unsigned int blk = 0; blk < m_blockOp.size(); ++blk)
153 {
154 this->m_blockOp[blk]->SetAppend(append);
155 }
156 }
std::vector< std::shared_ptr< BwdTransBlockOp< TData > > > m_blockOp
One block operator per element block of the expansion list; populated by ElmtOp::Create().

References Nektar::MultiRegions::BwdTransOp< TData >::m_blockOp.

◆ v_Apply()

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

Apply the backward transform block by block.

Checks that in and out conform – equal component and homogeneous-mode counts – then hands each pair of blocks to the corresponding entry of m_blockOp.

Parameters
inCoefficient-space input field.
outPhysical-space output field; overwritten, or accumulated into when append mode is set.

Definition at line 191 of file BwdTransOp.hpp.

193 {
194 ASSERTL1(in.GetNumComponents() == out.GetNumComponents(),
195 "Number of input and output components differ");
196
197 ASSERTL1(in.GetNumHomoModes() == out.GetNumHomoModes(),
198 "Number of input and output homogeneous modes differ");
199
200 // Loop over the blocks.
201 for (unsigned int blk = 0; blk < this->m_blockOp.size(); ++blk)
202 {
203 // Block dependent.
204 auto &inblock = in.GetBlocks()[blk];
205 auto &outblock = out.GetBlocks()[blk];
206
207 this->m_blockOp[blk]->Apply(inblock, outblock);
208 }
209 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
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.

Friends And Related Symbol Documentation

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

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

Definition at line 1 of file BwdTransOp.hpp.

Member Data Documentation

◆ m_blockOp

template<typename TData >
std::vector<std::shared_ptr<BwdTransBlockOp<TData> > > Nektar::MultiRegions::BwdTransOp< TData >::m_blockOp
protected

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

Definition at line 161 of file BwdTransOp.hpp.

Referenced by Nektar::MultiRegions::BwdTransOp< TData >::SetAppend().

◆ name

template<typename TData >
const std::string Nektar::MultiRegions::BwdTransOp< TData >::name = "BwdTrans"
inlinestatic

Operator base name; Create() appends the execution space to it to form the factory key.

Definition at line 137 of file BwdTransOp.hpp.