Nektar++
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Nektar::Collections::PhysInterp1DScaled_Helper Class Reference

PhysInterp1DScaled help class to calculate the size of the collection that is given as an input and as an output to the PhysInterp1DScaled Operator. The size evaluation takes into account that both the input and the output array belong to the physical space and that the output array can have either a larger, or a smaller size than the input array. More...

Inheritance diagram for Nektar::Collections::PhysInterp1DScaled_Helper:
[legend]

Public Member Functions

void UpdateFactors (StdRegions::FactorMap factors) override
 Update the supplied factor map.
 
- Public Member Functions inherited from Nektar::Collections::Operator
 Operator (std::vector< LocalRegions::ExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
 Constructor.
 
virtual ~Operator ()=default
 
virtual COLLECTIONS_EXPORT void operator() (const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp=NullNekDouble1DArray)=0
 Perform operation.
 
virtual COLLECTIONS_EXPORT void operator() (int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp=NullNekDouble1DArray)=0
 
virtual COLLECTIONS_EXPORT void UpdateVarcoeffs (StdRegions::VarCoeffMap &varcoeffs)
 Update the supplied variable coefficients.
 
unsigned int GetWspSize ()
 Get the size of the required workspace.
 
unsigned int GetNumElmt ()
 Get number of elements.
 
StdRegions::StdExpansionSharedPtr GetExpSharedPtr ()
 Get expansion pointer.
 
unsigned int GetInputSize (void)
 
unsigned int GetOutputSize (void)
 
unsigned int GetPhysSize (void)
 
unsigned int GetCoeffSize (void)
 

Protected Member Functions

 PhysInterp1DScaled_Helper ()
 

Protected Attributes

StdRegions::FactorMap m_factors
 
- Protected Attributes inherited from Nektar::Collections::Operator
bool m_isDeformed
 
StdRegions::StdExpansionSharedPtr m_stdExp
 
unsigned int m_numElmt
 number of elements that the operator is applied on
 
unsigned int m_nqe
 
unsigned int m_wspSize
 
unsigned int m_inputSize
 number of modes or quadrature points that are passed as input to an operator
 
unsigned int m_outputSize
 number of modes or quadrature points that are taken as output from an operator
 

Detailed Description

PhysInterp1DScaled help class to calculate the size of the collection that is given as an input and as an output to the PhysInterp1DScaled Operator. The size evaluation takes into account that both the input and the output array belong to the physical space and that the output array can have either a larger, or a smaller size than the input array.

Definition at line 65 of file PhysInterp1DScaled.cpp.

Constructor & Destructor Documentation

◆ PhysInterp1DScaled_Helper()

Nektar::Collections::PhysInterp1DScaled_Helper::PhysInterp1DScaled_Helper ( )
inlineprotected

Definition at line 98 of file PhysInterp1DScaled.cpp.

99 {
100 NekDouble scale; // declaration of the scaling factor to be used for the
101 // output size
103 {
105 }
106 else
107 {
108 scale = 1.5;
109 }
110 // expect input to be number of elements by the number of quad points
111 m_inputSize = m_numElmt * m_stdExp->GetTotPoints();
112 // expect input to be number of elements by the number of quad points
113 int shape_dimension = m_stdExp->GetShapeDimension();
114 m_outputSize = m_numElmt; // initializing m_outputSize
115 int npt0 = m_stdExp->GetNumPoints(0);
116 for (int i = 0; i < shape_dimension; ++i)
117 {
118 int npt = m_stdExp->GetNumPoints(i);
119 m_outputSize *= (npt0 - npt == 1) ? (int)(npt0 * scale - 1)
120 : (int)(npt * scale);
121 }
122 }
StdRegions::StdExpansionSharedPtr m_stdExp
Definition Operator.h:230
unsigned int m_numElmt
number of elements that the operator is applied on
Definition Operator.h:232
unsigned int m_outputSize
number of modes or quadrature points that are taken as output from an operator
Definition Operator.h:240
unsigned int m_inputSize
number of modes or quadrature points that are passed as input to an operator
Definition Operator.h:237

References Nektar::StdRegions::eFactorConst, m_factors, Nektar::Collections::Operator::m_inputSize, Nektar::Collections::Operator::m_numElmt, Nektar::Collections::Operator::m_outputSize, and Nektar::Collections::Operator::m_stdExp.

Member Function Documentation

◆ UpdateFactors()

void Nektar::Collections::PhysInterp1DScaled_Helper::UpdateFactors ( StdRegions::FactorMap  factors)
inlineoverridevirtual

Update the supplied factor map.

Reimplemented from Nektar::Collections::Operator.

Reimplemented in Nektar::Collections::PhysInterp1DScaled_MatrixFree, and Nektar::Collections::PhysInterp1DScaled_NoCollection.

Definition at line 68 of file PhysInterp1DScaled.cpp.

69 {
70 if (factors == m_factors)
71 {
72 return;
73 }
75 // Set scaling factor for the PhysInterp1DScaled function
76 [[maybe_unused]] auto x = factors.find(StdRegions::eFactorConst);
78 x != factors.end(),
79 "Constant factor not defined: " +
80 std::string(
82
84
85 int shape_dimension = m_stdExp->GetShapeDimension();
86 m_outputSize = m_numElmt; // initializing m_outputSize
87 int npt0 = m_stdExp->GetNumPoints(0);
88
89 for (int i = 0; i < shape_dimension; ++i)
90 {
91 int npt = m_stdExp->GetNumPoints(i);
92 m_outputSize *= (npt0 - npt == 1) ? (int)(npt0 * scale - 1)
93 : (int)(npt * scale);
94 }
95 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
const char *const ConstFactorTypeMap[]
StdRegions::ConstFactorMap factors

References ASSERTL1, Nektar::StdRegions::ConstFactorTypeMap, Nektar::StdRegions::eFactorConst, m_factors, Nektar::Collections::Operator::m_numElmt, Nektar::Collections::Operator::m_outputSize, and Nektar::Collections::Operator::m_stdExp.

Referenced by Nektar::Collections::PhysInterp1DScaled_NoCollection::UpdateFactors().

Member Data Documentation

◆ m_factors

StdRegions::FactorMap Nektar::Collections::PhysInterp1DScaled_Helper::m_factors
protected