Nektar++
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Nektar::Collections::PhysInterp1DScaled_MatrixFree Class Referencefinal

PhysInterp1DScaled operator using matrix free implementation. More...

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

Public Member Functions

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

Private Member Functions

 PhysInterp1DScaled_MatrixFree (vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
 
- Private Member Functions inherited from Nektar::Collections::MatrixFreeBase
 MatrixFreeBase ()=default
 
 MatrixFreeBase (const unsigned int nIn, const unsigned int nOut, const unsigned int nCollSize)
 
void UpdateFactors (StdRegions::FactorMap factors) override
 Update the supplied factor map. More...
 
 PhysInterp1DScaled_Helper ()
 

Private Attributes

std::shared_ptr< MatrixFree::PhysInterp1DScaled > m_oper
 
- Private Attributes inherited from Nektar::Collections::MatrixFreeBase
bool m_isPadded {false}
 flag for padding More...
 
unsigned int m_nElmtPad
 size after padding More...
 
unsigned int m_nIn
 actural size of input array More...
 
unsigned int m_nOut
 actural size of output array More...
 
- Private Attributes inherited from Nektar::Collections::PhysInterp1DScaled_Helper
StdRegions::FactorMap m_factors
 

Additional Inherited Members

- 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 More...
 
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 More...
 
unsigned int m_outputSize
 number of modes or quadrature points that are taken as output from an operator More...
 
unsigned int m_inputSizeOther
 Number of modes or quadrature points, opposite to m_inputSize. More...
 
unsigned int m_outputSizeOther
 Number of modes or quadrature points, opposite to m_outputSize. More...
 

Detailed Description

PhysInterp1DScaled operator using matrix free implementation.

Definition at line 121 of file PhysInterp1DScaled.cpp.

Constructor & Destructor Documentation

◆ ~PhysInterp1DScaled_MatrixFree()

Nektar::Collections::PhysInterp1DScaled_MatrixFree::~PhysInterp1DScaled_MatrixFree ( )
finaldefault

◆ PhysInterp1DScaled_MatrixFree()

Nektar::Collections::PhysInterp1DScaled_MatrixFree::PhysInterp1DScaled_MatrixFree ( vector< StdRegions::StdExpansionSharedPtr pCollExp,
CoalescedGeomDataSharedPtr  pGeomData,
StdRegions::FactorMap  factors 
)
inlineprivate

Definition at line 181 of file PhysInterp1DScaled.cpp.

184 : Operator(pCollExp, pGeomData, factors),
185 MatrixFreeBase(pCollExp[0]->GetStdExp()->GetTotPoints(),
186 pCollExp[0]->GetStdExp()->GetTotPoints(),
187 pCollExp.size()),
189 {
190 const auto dim = pCollExp[0]->GetStdExp()->GetShapeDimension();
191
192 // Definition of basis vector
193 std::vector<LibUtilities::BasisSharedPtr> basis(dim);
194 for (unsigned int i = 0; i < dim; ++i)
195 {
196 basis[i] = pCollExp[0]->GetBasis(i);
197 }
198
199 // Get shape type
200 auto shapeType = pCollExp[0]->GetStdExp()->DetShapeType();
201
202 // Generate operator string and create operator.
203 std::string op_string = "PhysInterp1DScaled";
204 op_string += MatrixFree::GetOpstring(shapeType, false);
206 op_string, basis, pCollExp.size());
207
208 m_oper =
209 std::dynamic_pointer_cast<MatrixFree::PhysInterp1DScaled>(oper);
210 ASSERTL0(m_oper, "Failed to cast pointer.");
211
212 NekDouble scale; // declaration of the scaling factor to be used for the
213 // output size
215 {
218 }
219 else
220 {
221 scale = 1.5;
223 }
224 // Update the scaling factor inside MatrixFreeOps using the SetLamda
225 // routine
226 m_oper->SetScalingFactor(scale);
227 m_oper->SetUpInterp1D(basis, scale);
229 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
unsigned int m_nElmtPad
size after padding
unsigned int m_nOut
actural size of output array
unsigned int m_numElmt
number of elements that the operator is applied on
Definition: Operator.h:219
unsigned int m_outputSize
number of modes or quadrature points that are taken as output from an operator
Definition: Operator.h:227
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
Constructor.
Definition: Operator.cpp:66
std::shared_ptr< MatrixFree::PhysInterp1DScaled > m_oper
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
OperatorFactory & GetOperatorFactory()
Returns the singleton Operator factory object.
Definition: Operator.cpp:44
StdRegions::ConstFactorMap factors
double NekDouble

References ASSERTL0, Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::StdRegions::eFactorConst, Nektar::VarcoeffHashingTest::factors, Nektar::Collections::GetOperatorFactory(), Nektar::Collections::PhysInterp1DScaled_Helper::m_factors, Nektar::Collections::MatrixFreeBase::m_nElmtPad, Nektar::Collections::MatrixFreeBase::m_nOut, Nektar::Collections::Operator::m_numElmt, m_oper, and Nektar::Collections::Operator::m_outputSize.

Member Function Documentation

◆ operator()() [1/2]

void Nektar::Collections::PhysInterp1DScaled_MatrixFree::operator() ( const Array< OneD, const NekDouble > &  input,
Array< OneD, NekDouble > &  output0,
Array< OneD, NekDouble > &  output1,
Array< OneD, NekDouble > &  output2,
Array< OneD, NekDouble > &  wsp 
)
inlinefinalvirtual

Perform operation.

Implements Nektar::Collections::Operator.

Definition at line 130 of file PhysInterp1DScaled.cpp.

135 {
136 (*m_oper)(input, output0);
137 }

◆ operator()() [2/2]

void Nektar::Collections::PhysInterp1DScaled_MatrixFree::operator() ( int  dir,
const Array< OneD, const NekDouble > &  input,
Array< OneD, NekDouble > &  output,
Array< OneD, NekDouble > &  wsp 
)
inlinefinalvirtual

Implements Nektar::Collections::Operator.

Definition at line 139 of file PhysInterp1DScaled.cpp.

143 {
145 "PhysInterp1DScaled_MatrixFree: Not valid for this operator.");
146 }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:202

References Nektar::ErrorUtil::efatal, and NEKERROR.

◆ UpdateFactors()

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

Update the supplied factor map.

Reimplemented from Nektar::Collections::Operator.

Definition at line 148 of file PhysInterp1DScaled.cpp.

149 {
150
151 // Set lambda for this call
152 auto x = factors.find(StdRegions::eFactorConst);
153 ASSERTL1(
154 x != factors.end(),
155 "Constant factor not defined: " +
156 std::string(
158 // Update the factors member inside PhysInterp1DScaled_MatrixFree
159 // class
161
162 const auto dim = m_stdExp->GetShapeDimension();
163
164 // Definition of basis vector
165 std::vector<LibUtilities::BasisSharedPtr> basis(dim);
166 for (unsigned int i = 0; i < dim; ++i)
167 {
168 basis[i] = m_stdExp->GetBasis(i);
169 }
170
171 // Update the scaling factor inside MatrixFreeOps using the SetLamda
172 // routine
173 m_oper->SetScalingFactor(x->second);
174 m_oper->SetUpInterp1D(basis, m_factors[StdRegions::eFactorConst]);
176 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:217
const char *const ConstFactorTypeMap[]
Definition: StdRegions.hpp:413

References ASSERTL1, Nektar::StdRegions::ConstFactorTypeMap, Nektar::StdRegions::eFactorConst, Nektar::VarcoeffHashingTest::factors, Nektar::Collections::PhysInterp1DScaled_Helper::m_factors, Nektar::Collections::MatrixFreeBase::m_nElmtPad, Nektar::Collections::MatrixFreeBase::m_nOut, Nektar::Collections::Operator::m_numElmt, m_oper, Nektar::Collections::Operator::m_outputSize, and Nektar::Collections::Operator::m_stdExp.

Member Data Documentation

◆ m_oper

std::shared_ptr<MatrixFree::PhysInterp1DScaled> Nektar::Collections::PhysInterp1DScaled_MatrixFree::m_oper
private

Definition at line 179 of file PhysInterp1DScaled.cpp.

Referenced by PhysInterp1DScaled_MatrixFree(), and UpdateFactors().