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::PhysLiftProjectOp< TData > Class Template Reference

Whole-field interface of the lift-and-project operator: holds one PhysLiftProjectBlockOp per element block and hands each block of the fields to it. More...

#include <PhysLiftProjectOp.hpp>

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

Public Member Functions

void Apply (LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &trace, LibUtilities::Field< TData, FieldState::Phys > &out)
 out (+)= scale * B M^{-1} B^T (in + L trace).
 
void SetScale (const TData &scale)
 The factor the result is scaled by, on every block.
 
void SetAppend (const bool &append)
 Accumulate onto the output instead of overwriting it, on every block.
 
- 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< PhysLiftProjectOp< TData > > Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
 Create the operator through the operator and block-operator factories (see ElmtOp::Create()).
 
- 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 = "PhysLiftProject"
 Operator base name; Create() appends the execution space to it to form the factory key.
 

Protected Member Functions

 PhysLiftProjectOp (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
 
 ~PhysLiftProjectOp () override=default
 
void v_Apply (LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &out) override
 The projection of in alone.
 
virtual void v_ApplyLift (LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &trace, LibUtilities::Field< TData, FieldState::Phys > &out)
 Implementation hook for the three-argument Apply().
 
- 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< PhysLiftProjectBlockOp< TData > > > m_blockOp
 
- 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 >
 

Detailed Description

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

Whole-field interface of the lift-and-project operator: holds one PhysLiftProjectBlockOp per element block and hands each block of the fields to it.

Template Parameters
TDataFloating-point type of the field data.

Definition at line 115 of file PhysLiftProjectOp.hpp.

Constructor & Destructor Documentation

◆ PhysLiftProjectOp()

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

Definition at line 180 of file PhysLiftProjectOp.hpp.

183 components)
184 {
185 }

◆ ~PhysLiftProjectOp()

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

Member Function Documentation

◆ Apply()

template<typename TData >
void Nektar::MultiRegions::PhysLiftProjectOp< TData >::Apply ( LibUtilities::Field< TData, FieldState::Phys > &  in,
LibUtilities::Field< TData, FieldState::Phys > &  trace,
LibUtilities::Field< TData, FieldState::Phys > &  out 
)
inline

out (+)= scale * B M^{-1} B^T (in + L trace).

Parameters
inVolume inner products, laid out by GetBlockAttributes().
traceValues on the elements' own traces, laid out by GetLocTraceBlockAttributes(), with the components of in.
outVolume field, written or accumulated onto.

Definition at line 151 of file PhysLiftProjectOp.hpp.

154 {
155 v_ApplyLift(in, trace, out);
156 }
virtual void v_ApplyLift(LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &trace, LibUtilities::Field< TData, FieldState::Phys > &out)
Implementation hook for the three-argument Apply().

References Nektar::MultiRegions::PhysLiftProjectOp< TData >::v_ApplyLift().

◆ Create()

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

Create the operator through the operator and block-operator factories (see ElmtOp::Create()).

Definition at line 127 of file PhysLiftProjectOp.hpp.

131 {
133 template Create<PhysLiftProjectOp, PhysLiftProjectBlockOp>(
134 expansionList, components, execStr, implStr);
135 }

Referenced by TestPhysLiftProject< TData >::RunVariant().

◆ SetAppend()

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

Accumulate onto the output instead of overwriting it, on every block.

Definition at line 169 of file PhysLiftProjectOp.hpp.

170 {
171 for (unsigned int blk = 0; blk < m_blockOp.size(); ++blk)
172 {
173 m_blockOp[blk]->SetAppend(append);
174 }
175 }
std::vector< std::shared_ptr< PhysLiftProjectBlockOp< TData > > > m_blockOp

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

◆ SetScale()

template<typename TData >
void Nektar::MultiRegions::PhysLiftProjectOp< TData >::SetScale ( const TData &  scale)
inline

The factor the result is scaled by, on every block.

Definition at line 159 of file PhysLiftProjectOp.hpp.

160 {
161 for (unsigned int blk = 0; blk < m_blockOp.size(); ++blk)
162 {
163 m_blockOp[blk]->SetScale(scale);
164 }
165 }

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

◆ v_Apply()

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

The projection of in alone.

Definition at line 190 of file PhysLiftProjectOp.hpp.

192 {
193 ASSERTL1(in.GetNumComponents() == out.GetNumComponents(),
194 "Number of input and output components differ");
195 ASSERTL1(in.GetNumHomoModes() == out.GetNumHomoModes(),
196 "Number of input and output homogeneous modes differ");
197
198 for (unsigned int blk = 0; blk < m_blockOp.size(); ++blk)
199 {
200 m_blockOp[blk]->Apply(in.GetBlocks()[blk], out.GetBlocks()[blk]);
201 }
202 }
#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, and Nektar::MultiRegions::PhysLiftProjectOp< TData >::m_blockOp.

◆ v_ApplyLift()

template<typename TData >
virtual void Nektar::MultiRegions::PhysLiftProjectOp< TData >::v_ApplyLift ( LibUtilities::Field< TData, FieldState::Phys > &  in,
LibUtilities::Field< TData, FieldState::Phys > &  trace,
LibUtilities::Field< TData, FieldState::Phys > &  out 
)
inlineprotectedvirtual

Implementation hook for the three-argument Apply().

Definition at line 205 of file PhysLiftProjectOp.hpp.

209 {
210 ASSERTL1(in.GetNumComponents() == out.GetNumComponents() &&
211 trace.GetNumComponents() == in.GetNumComponents(),
212 "Number of input, trace and output components differ");
213 ASSERTL1(in.GetNumHomoModes() == out.GetNumHomoModes() &&
214 trace.GetNumHomoModes() == in.GetNumHomoModes(),
215 "Number of input, trace and output homogeneous modes differ");
216
217 for (unsigned int blk = 0; blk < m_blockOp.size(); ++blk)
218 {
219 m_blockOp[blk]->ApplyLift(in.GetBlocks()[blk],
220 trace.GetBlocks()[blk],
221 out.GetBlocks()[blk]);
222 }
223 }

References ASSERTL1, Nektar::LibUtilities::Field< TData, TState >::GetBlocks(), Nektar::LibUtilities::Field< TData, TState >::GetNumComponents(), Nektar::LibUtilities::Field< TData, TState >::GetNumHomoModes(), and Nektar::MultiRegions::PhysLiftProjectOp< TData >::m_blockOp.

Referenced by Nektar::MultiRegions::PhysLiftProjectOp< TData >::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 PhysLiftProjectOp.hpp.

Member Data Documentation

◆ m_blockOp

template<typename TData >
std::vector<std::shared_ptr<PhysLiftProjectBlockOp<TData> > > Nektar::MultiRegions::PhysLiftProjectOp< TData >::m_blockOp
protected

◆ name

template<typename TData >
const std::string Nektar::MultiRegions::PhysLiftProjectOp< TData >::name = "PhysLiftProject"
inlinestatic

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

Definition at line 139 of file PhysLiftProjectOp.hpp.