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

Whole-field interface of the curl-curl element operator: replaces the quadrature-point values of a vector field u by those of curl(curl u), element by element. More...

#include <CurlCurlOp.hpp>

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

Static Public Member Functions

static std::shared_ptr< CurlCurlOp< TData > > Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
 Build a complete curl-curl 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 = "CurlCurl"
 Operator base name; Create() appends the execution space to it to form the operator-factory key.
 

Protected Member Functions

 CurlCurlOp (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.
 
 ~CurlCurlOp () override=default
 
void v_Apply (LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &out) override
 Apply the curl-curl operator block by block.
 
virtual void v_ApplyFFT (LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &out)=0
 Complete the double curl of a multi-plane 3DH1 field, of which the block operators have left the plane part of the first curl in out; does nothing on any other expansion.
 
- 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< CurlCurlBlockOp< TData > > > m_blockOp
 One block operator per element block, filled by 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::CurlCurlOp< TData >

Whole-field interface of the curl-curl element operator: replaces the quadrature-point values of a vector field u by those of curl(curl u), element by element.

Writing the input components as (u0, u1, u2) along the Cartesian directions (x0, x1, x2):

The operator is defined for two- and three-dimensional expansions whose coordinate dimension equals the shape dimension (both asserted by the block-implementation constructors); embedded manifolds are not supported. The input field must carry at least as many components as the shape dimension: the block implementations read the first two (2D) or three (3D) and write the same number of output components. A multi-plane 3DH1 field must carry exactly three components (asserted).

As with the other element-operator families, this class sets the Apply() field states at compile time – physical space in and out – and drives one CurlCurlBlockOp per element block, followed by v_ApplyFFT(). On a multi-plane 3DH1 field each block operator forms only the plane part of one curl, and detail::CurlCurlOpImpl adds the z parts and runs the block operators again for the second curl; everywhere else the block operators take both curls and v_ApplyFFT() does nothing. See ElmtOp for the block decomposition and factory scheme.

Template Parameters
TDataFloating-point type of the field data.

Definition at line 115 of file CurlCurlOp.hpp.

Constructor & Destructor Documentation

◆ CurlCurlOp()

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

Construct the interface part of a concrete operator; 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 164 of file CurlCurlOp.hpp.

167 components)
168 {
169 }
friend class ElmtOp< FieldState::Phys, FieldState::Phys, TData >

◆ ~CurlCurlOp()

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

Member Function Documentation

◆ Create()

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

Build a complete curl-curl operator through the operator and block-operator factories.

See ElmtOp::Create for the two-stage construction and the execution-space/implementation lookup rules.

Parameters
expansionListExpansion list the operator acts on.
componentsNames of the field components.
execStrExecution space ("Serial", "AVX" or "Device"); the session's setting is used if empty.
implStrImplementation ("StdMat", "SumFac" or, on Device, "SumFacTOP"); the session's setting is used if empty.
Returns
The fully assembled operator, ready to Apply().

Definition at line 138 of file CurlCurlOp.hpp.

142 {
144 template Create<CurlCurlOp, CurlCurlBlockOp>(
145 expansionList, components, execStr, implStr);
146 }

Referenced by Nektar::detail::HOPressureBndCondOpImpl< ExecSpace, TData >::BuildBoundaryElementData(), and TestCurlCurl< TData >::RunTestCase().

◆ v_Apply()

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

Apply the curl-curl operator block by block.

Checks that the two fields agree in their number of homogeneous modes, hands each input/output block pair to the corresponding entry of m_blockOp, then calls v_ApplyFFT().

Parameters
inPhysical-space input field holding the components of u.
outPhysical-space output field receiving the components of curl(curl u).

Definition at line 185 of file CurlCurlOp.hpp.

187 {
188 ASSERTL1(in.GetNumHomoModes() == out.GetNumHomoModes(),
189 "Number of input and output homogeneous modes differ");
190
191 // Loop over the blocks.
192 for (unsigned int blk = 0; blk < this->m_blockOp.size(); ++blk)
193 {
194 // Block dependent.
195 auto &inblock = in.GetBlocks()[blk];
196 auto &outblock = out.GetBlocks()[blk];
197
198 this->m_blockOp[blk]->Apply(inblock, outblock);
199 }
200
201 // Apply FFT.
202 v_ApplyFFT(in, out);
203 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
std::vector< std::shared_ptr< CurlCurlBlockOp< TData > > > m_blockOp
One block operator per element block, filled by Create().
virtual void v_ApplyFFT(LibUtilities::Field< TData, FieldState::Phys > &in, LibUtilities::Field< TData, FieldState::Phys > &out)=0
Complete the double curl of a multi-plane 3DH1 field, of which the block operators have left the plan...
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::CurlCurlOp< TData >::v_ApplyFFT().

◆ v_ApplyFFT()

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

Complete the double curl of a multi-plane 3DH1 field, of which the block operators have left the plane part of the first curl in out; does nothing on any other expansion.

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

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

Member Data Documentation

◆ m_blockOp

template<typename TData >
std::vector<std::shared_ptr<CurlCurlBlockOp<TData> > > Nektar::MultiRegions::CurlCurlOp< TData >::m_blockOp
protected

One block operator per element block, filled by Create().

Definition at line 154 of file CurlCurlOp.hpp.

Referenced by Nektar::MultiRegions::detail::CurlCurlOpImpl< ExecSpace, TData >::v_ApplyFFT().

◆ name

template<typename TData >
const std::string Nektar::MultiRegions::CurlCurlOp< TData >::name = "CurlCurl"
inlinestatic

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

Definition at line 150 of file CurlCurlOp.hpp.