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

Base class of the per-block mass operators: applies the element mass matrix to every element of one block, coefficient space to coefficient space. More...

#include <MassBlockOp.hpp>

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

Public Member Functions

void SetAppend (const bool &append)
 Set overwrite (false, the default) or accumulate (true) mode for subsequent Apply() calls; see MassOp::SetAppend().
 
void SetScale (const TData &scale)
 Set the scalar factor applied to the result; see MassOp::SetScale.
 
- Public Member Functions inherited from Nektar::MultiRegions::ElmtBlockOp< FieldState::Coeff, FieldState::Coeff, TData >
void Apply (LibUtilities::BlockAccessor< TData, TFieldIn > &inblock, LibUtilities::BlockAccessor< TData, TFieldOut > &outblock)
 Apply the element operation to every element of the block.
 
void operator() (LibUtilities::BlockAccessor< TData, TFieldIn > &inblock, LibUtilities::BlockAccessor< TData, TFieldOut > &outblock)
 Call operator; equivalent to Apply().
 
- Public Member Functions inherited from Nektar::MultiRegions::BlockOperator< TData >
virtual ~BlockOperator ()=default
 

Static Public Member Functions

static std::shared_ptr< MassBlockOp< TData > > Create (const unsigned int block_idx, const LocalRegions::ExpansionSharedPtr &exp, LibUtilities::NekDataWarehouseSharedPtr dataWarehouse, const std::string &execStr, const std::string &implStr)
 Create one Mass block operator through the block-operator factory.
 
- Static Public Member Functions inherited from Nektar::MultiRegions::ElmtBlockOp< FieldState::Coeff, FieldState::Coeff, TData >
static std::shared_ptr< TOperator< TData > > Create (const unsigned int block_idx, const LocalRegions::ExpansionSharedPtr &exp, LibUtilities::NekDataWarehouseSharedPtr dataWarehouse, const std::string &execStr, const std::string &implStr)
 Create one block operator through the block-operator factory.
 
- Static Public Member Functions inherited from Nektar::MultiRegions::BlockOperator< TData >
template<template< typename > typename TOperator>
static std::shared_ptr< TOperator< TData > > Create (const unsigned int block_idx, const LocalRegions::ExpansionSharedPtr &exp, LibUtilities::NekDataWarehouseSharedPtr dataWarehouse, const std::string &execStr)
 Create a concrete block-operator instance through the block-operator factory.
 

Static Public Attributes

static const std::string name = "BlockMass"
 Block-operator base name; Create() appends the execution space and implementation to it to form the factory key.
 

Protected Member Functions

 MassBlockOp (const unsigned int block_idx, const LocalRegions::ExpansionSharedPtr &exp, LibUtilities::NekDataWarehouseSharedPtr dataWarehouse)
 Construct the interface part of a concrete block operator; called by the factory-registered creator functions.
 
 ~MassBlockOp () override=default
 
- Protected Member Functions inherited from Nektar::MultiRegions::ElmtBlockOp< FieldState::Coeff, FieldState::Coeff, TData >
 ElmtBlockOp (const unsigned int block_idx, const LocalRegions::ExpansionSharedPtr &exp, LibUtilities::NekDataWarehouseSharedPtr dataWarehouse)
 Construct the interface part of a concrete block operator; called by the factory-registered creator functions.
 
 ~ElmtBlockOp () override=default
 
virtual void v_Apply (LibUtilities::BlockAccessor< TData, TFieldIn > &inblock, LibUtilities::BlockAccessor< TData, TFieldOut > &outblock)=0
 Implementation hook for Apply().
 
- Protected Member Functions inherited from Nektar::MultiRegions::BlockOperator< TData >
 BlockOperator (const unsigned int block_idx, const LocalRegions::ExpansionSharedPtr &exp, LibUtilities::NekDataWarehouseSharedPtr dataWarehouse)
 Construct the interface part of a concrete block operator; called by the factory-registered creator functions.
 

Protected Attributes

TData m_scale = 1.0
 Scalar factor applied to the result (default 1).
 
bool m_append = false
 When true, Apply() adds the scaled result onto the output block's existing values instead of overwriting them.
 
- Protected Attributes inherited from Nektar::MultiRegions::ElmtBlockOp< FieldState::Coeff, FieldState::Coeff, TData >
bool m_warnOnceTemplate
 Set once the generated ShapeBlock switch code has warned that an element size outside the templated switch range fell back to the runtime-sized OperatorND call, so that the warning is issued only once per block operator (see the BlockOpSwitch templates in LibUtilities/BasicUtils/Switch).
 
- Protected Attributes inherited from Nektar::MultiRegions::BlockOperator< TData >
unsigned int m_block_idx
 Index of the block within the expansion list's Collections.
 
LocalRegions::ExpansionSharedPtr m_exp
 Representative expansion of the block (its first element).
 
LibUtilities::NekDataWarehouseSharedPtr m_dataWarehouse
 Data warehouse shared with the other operators on the expansion list.
 

Additional Inherited Members

- Public Types inherited from Nektar::MultiRegions::ElmtBlockOp< FieldState::Coeff, FieldState::Coeff, TData >
using InBlock = LibUtilities::BlockAccessor< TData, TFieldIn >
 Accessor type of this operator's input block.
 
using OutBlock = LibUtilities::BlockAccessor< TData, TFieldOut >
 Accessor type of this operator's output block; see InBlock.
 
- Static Protected Member Functions inherited from Nektar::MultiRegions::ElmtBlockOp< FieldState::Coeff, FieldState::Coeff, TData >
static void ShapeSwitch (const LibUtilities::ShapeType shape, TFunc &&func)
 Call func with the runtime shape as a compile-time constant, std::integral_constant<LibUtilities::ShapeType, ...>.
 
static void DispatchAppendFlag (const bool append, TFunc &&func)
 Call func with std::true_type if append and std::false_type otherwise.
 
static void DispatchScaleFlag (const TData scale, TFunc &&func)
 Call func with std::false_type if scale is one and std::true_type otherwise.
 
static void DispatchDeformedFlag (const bool deformed, TFunc &&func)
 Call func with std::true_type if deformed and std::false_type otherwise.
 
- Static Protected Member Functions inherited from Nektar::MultiRegions::BlockOperator< TData >
template<typename MemSpace >
static TData * GetStaticWorkSpace (const size_t size, const unsigned int streamID=0)
 Return a per-stream scratch buffer in MemSpace, sized to hold at least size elements of TData, growing and reallocating it as needed.
 

Detailed Description

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

Base class of the per-block mass operators: applies the element mass matrix to every element of one block, coefficient space to coefficient space.

Sets the block states accepted by Apply() at compile time – coefficient space in and out – and stores the two settings shared by every implementation: the scale factor m_scale and the append flag m_append. MassOp::SetScale and SetAppend forward to the setters here block by block; the implementations read the settings in their v_Apply(). The concrete implementations are the detail::MassBlockOpImpl definitions listed in MassOp.hpp.

CMake generates one registration translation unit per execution space, implementation and data type (from ElmtOps/ElmtBlockOpFactoryDec.cpp.in) that includes exactly one detail::MassBlockOpImpl header and registers it under the matching execution-space/implementation key.

Template Parameters
TDataFloating-point type of the field data.

Definition at line 77 of file MassBlockOp.hpp.

Constructor & Destructor Documentation

◆ MassBlockOp()

template<typename TData >
Nektar::MultiRegions::MassBlockOp< TData >::MassBlockOp ( const unsigned int  block_idx,
const LocalRegions::ExpansionSharedPtr &  exp,
LibUtilities::NekDataWarehouseSharedPtr  dataWarehouse 
)
inlineprotected

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

Parameters
block_idxIndex of the block within the expansion list's Collections.
expRepresentative expansion of the block.
dataWarehouseData warehouse shared with the other operators on the expansion list.

Definition at line 146 of file MassBlockOp.hpp.

149 : ElmtBlockOp<FieldState::Coeff, FieldState::Coeff, TData>(
150 block_idx, exp, dataWarehouse)
151 {
152 }

◆ ~MassBlockOp()

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

Member Function Documentation

◆ Create()

template<typename TData >
static std::shared_ptr< MassBlockOp< TData > > Nektar::MultiRegions::MassBlockOp< TData >::Create ( const unsigned int  block_idx,
const LocalRegions::ExpansionSharedPtr &  exp,
LibUtilities::NekDataWarehouseSharedPtr  dataWarehouse,
const std::string &  execStr,
const std::string &  implStr 
)
inlinestatic

Create one Mass block operator through the block-operator factory.

The factory key is name + execStr + implStr; see ElmtBlockOp::Create for the lookup and fall-back rules.

Parameters
block_idxIndex of the block within the expansion list's Collections.
expRepresentative expansion of the block.
dataWarehouseData warehouse shared with the other operators on the expansion list.
execStrExecution-space part of the key.
implStrImplementation part of the key.
Returns
The newly created block operator.

Definition at line 98 of file MassBlockOp.hpp.

103 {
105 TData>::template Create<MassBlockOp>(block_idx, exp,
106 dataWarehouse,
107 execStr,
108 implStr);
109 }
ElmtBlockOp(const unsigned int block_idx, const LocalRegions::ExpansionSharedPtr &exp, LibUtilities::NekDataWarehouseSharedPtr dataWarehouse)
Construct the interface part of a concrete block operator; called by the factory-registered creator f...

References Nektar::Coeff.

◆ SetAppend()

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

Set overwrite (false, the default) or accumulate (true) mode for subsequent Apply() calls; see MassOp::SetAppend().

Definition at line 117 of file MassBlockOp.hpp.

118 {
120 }
bool m_append
When true, Apply() adds the scaled result onto the output block's existing values instead of overwrit...
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 const bool append

References Nektar::MultiRegions::MassBlockOp< TData >::m_append.

◆ SetScale()

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

Set the scalar factor applied to the result; see MassOp::SetScale.

Definition at line 124 of file MassBlockOp.hpp.

125 {
126 m_scale = scale;
127 }
TData m_scale
Scalar factor applied to the result (default 1).

References Nektar::MultiRegions::MassBlockOp< TData >::m_scale.

Member Data Documentation

◆ m_append

template<typename TData >
bool Nektar::MultiRegions::MassBlockOp< TData >::m_append = false
protected

◆ m_scale

template<typename TData >
TData Nektar::MultiRegions::MassBlockOp< TData >::m_scale = 1.0
protected

◆ name

template<typename TData >
const std::string Nektar::MultiRegions::MassBlockOp< TData >::name = "BlockMass"
inlinestatic

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

Definition at line 113 of file MassBlockOp.hpp.