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::ReynoldsStressOp< TData > Class Template Referenceabstract

Accumulate the scaled pairwise products of the velocity components. More...

#include <ReynoldsStressOp.hpp>

Inheritance diagram for Nektar::ReynoldsStressOp< TData >:
[legend]

Public Member Functions

void Configure (const std::vector< unsigned int > &velocityComponents)
 velocityComponents are the indices of the velocity components in the velocity field, which may hold further components.
 
void SetScale (const TData scale)
 Set the factor applied to the products before they are added.
 
void Apply (LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &products)
 Add the scaled products of velocity to products, which leave at the interleave width of velocity.
 
void operator() (LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &products)
 As 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< ReynoldsStressOp< TData > > Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="")
 
static std::vector< std::string > ProductNames (const std::vector< std::string > &velocityNames)
 Names of the product components, e.g. uu, uv, uw, vv, vw, ww, formed from the names of the selected velocity components.
 
- 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 = "ReynoldsStress"
 

Protected Member Functions

 ReynoldsStressOp (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components)
 
 ~ReynoldsStressOp () override=default
 
virtual void v_Configure (const std::vector< unsigned int > &velocityComponents)=0
 
virtual void v_Apply (LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &products)=0
 

Protected Attributes

TData m_scale = TData{1}
 Factor applied to the products before they are added.
 
- 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.
 

Detailed Description

template<typename TData>
class Nektar::ReynoldsStressOp< TData >

Accumulate the scaled pairwise products of the velocity components.

For the \( d \) velocity components \( u_a \) selected with Configure(), Apply() adds \( s \, u_a u_b \), \( a \le b \), pointwise to the \( d(d+1)/2 \) components of a product field, ordered \( (a,b) = (0,0), (0,1), \ldots, (0,d-1), (1,1), \ldots, (d-1,d-1) \), i.e. \( uu, uv, uw, vv, vw, ww \) in three dimensions, which include a 3DH1 expansion, its products formed on every local plane. The scale \( s \) is one unless changed with SetScale().

The velocity field may carry further components, such as passive scalars; only the selected ones are read. The product field has the operator's block attributes. A product block at another interleave width than the velocity's is reshaped to it, keeping its content, so that the products leave Apply() laid out like the velocity. Block \( b \) executes on stream \( b+1 \).

Definition at line 64 of file ReynoldsStressOp.hpp.

Constructor & Destructor Documentation

◆ ReynoldsStressOp()

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

Definition at line 126 of file ReynoldsStressOp.hpp.

128 : MultiRegions::Operator<TData>(expansionList, components)
129 {
130 }

◆ ~ReynoldsStressOp()

template<typename TData >
Nektar::ReynoldsStressOp< TData >::~ReynoldsStressOp ( )
overrideprotecteddefault

Member Function Documentation

◆ Apply()

template<typename TData >
void Nektar::ReynoldsStressOp< TData >::Apply ( LibUtilities::Field< TData, FieldState::Phys > &  velocity,
LibUtilities::Field< TData, FieldState::Phys > &  products 
)
inline

Add the scaled products of velocity to products, which leave at the interleave width of velocity.

Definition at line 109 of file ReynoldsStressOp.hpp.

111 {
112 v_Apply(velocity, products);
113 }
virtual void v_Apply(LibUtilities::Field< TData, FieldState::Phys > &velocity, LibUtilities::Field< TData, FieldState::Phys > &products)=0

References Nektar::ReynoldsStressOp< TData >::v_Apply().

◆ Configure()

template<typename TData >
void Nektar::ReynoldsStressOp< TData >::Configure ( const std::vector< unsigned int > &  velocityComponents)
inline

velocityComponents are the indices of the velocity components in the velocity field, which may hold further components.

Definition at line 96 of file ReynoldsStressOp.hpp.

97 {
98 v_Configure(velocityComponents);
99 }
virtual void v_Configure(const std::vector< unsigned int > &velocityComponents)=0

References Nektar::ReynoldsStressOp< TData >::v_Configure().

◆ Create()

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

Definition at line 67 of file ReynoldsStressOp.hpp.

71 {
72 return MultiRegions::Operator<TData>::template Create<ReynoldsStressOp>(
73 expansionList, components, execStr);
74 }

Referenced by Nektar::FilterReynoldsStresses::v_Initialise().

◆ operator()()

template<typename TData >
void Nektar::ReynoldsStressOp< TData >::operator() ( LibUtilities::Field< TData, FieldState::Phys > &  velocity,
LibUtilities::Field< TData, FieldState::Phys > &  products 
)
inline

As Apply().

Definition at line 116 of file ReynoldsStressOp.hpp.

118 {
119 v_Apply(velocity, products);
120 }

References Nektar::ReynoldsStressOp< TData >::v_Apply().

◆ ProductNames()

template<typename TData >
static std::vector< std::string > Nektar::ReynoldsStressOp< TData >::ProductNames ( const std::vector< std::string > &  velocityNames)
inlinestatic

Names of the product components, e.g. uu, uv, uw, vv, vw, ww, formed from the names of the selected velocity components.

Definition at line 80 of file ReynoldsStressOp.hpp.

82 {
83 std::vector<std::string> names;
84 for (unsigned int a = 0; a < velocityNames.size(); ++a)
85 {
86 for (unsigned int b = a; b < velocityNames.size(); ++b)
87 {
88 names.push_back(velocityNames[a] + velocityNames[b]);
89 }
90 }
91 return names;
92 }

Referenced by Nektar::FilterReynoldsStresses::v_Initialise().

◆ SetScale()

template<typename TData >
void Nektar::ReynoldsStressOp< TData >::SetScale ( const TData  scale)
inline

Set the factor applied to the products before they are added.

Definition at line 102 of file ReynoldsStressOp.hpp.

103 {
104 m_scale = scale;
105 }
TData m_scale
Factor applied to the products before they are added.

References Nektar::ReynoldsStressOp< TData >::m_scale.

◆ v_Apply()

template<typename TData >
virtual void Nektar::ReynoldsStressOp< TData >::v_Apply ( LibUtilities::Field< TData, FieldState::Phys > &  velocity,
LibUtilities::Field< TData, FieldState::Phys > &  products 
)
protectedpure virtual

◆ v_Configure()

template<typename TData >
virtual void Nektar::ReynoldsStressOp< TData >::v_Configure ( const std::vector< unsigned int > &  velocityComponents)
protectedpure virtual

Member Data Documentation

◆ m_scale

template<typename TData >
TData Nektar::ReynoldsStressOp< TData >::m_scale = TData{1}
protected

Factor applied to the products before they are added.

Definition at line 124 of file ReynoldsStressOp.hpp.

124{1};

Referenced by Nektar::ReynoldsStressOp< TData >::SetScale().

◆ name

template<typename TData >
const std::string Nektar::ReynoldsStressOp< TData >::name = "ReynoldsStress"
inlinestatic

Definition at line 76 of file ReynoldsStressOp.hpp.