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

PhysInterp1DScaled operator using matrix free operators. More...

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

Public Member Functions

 ~PhysInterp1DScaled_MatrixFree () final
 
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 CheckFactors (StdRegions::FactorMap factors, int coll_phys_offset) override
 Check the validity of 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 CheckFactors (StdRegions::FactorMap factors, int coll_phys_offset)=0
 Check the validity of the supplied factor map. 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 ()
 
unsigned int GetOutputSize ()
 

Private Member Functions

 PhysInterp1DScaled_MatrixFree (vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
 
- Private Member Functions inherited from Nektar::Collections::MatrixFreeOneInOneOut
 MatrixFreeOneInOneOut (const unsigned int nIn, const unsigned int nOut, const unsigned int nCollSize)
 Constructor. More...
 
void CheckFactors (StdRegions::FactorMap factors, int coll_phys_offset) override
 Check the validity of the supplied factor map. More...
 
 PhysInterp1DScaled_Helper ()
 

Private Attributes

std::shared_ptr< MatrixFree::PhysInterp1DScaled > m_oper
 
- Private Attributes inherited from Nektar::Collections::MatrixFreeOneInOneOut
Array< OneD, NekDoublem_input
 padded input/output vectors More...
 
Array< OneD, NekDoublem_output
 
- Private Attributes inherited from Nektar::Collections::PhysInterp1DScaled_Helper
StdRegions::FactorMap m_factors
 

Additional Inherited Members

- Protected Member Functions inherited from Nektar::Collections::Operator
virtual int v_GetInputSize ()
 This purely virtual function needs to be set-up for every operator inside Collections. It is responsible for returning the size of input collection, that the operator is applied on either in physical or coefficient space. More...
 
virtual int v_GetOutputSize ()
 This purely virtual function needs to be set-up for every operator inside Collections. It is responsible for returning the output size either in physical or coefficient space of an operator inside Collections. More...
 
- 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...
 

Detailed Description

PhysInterp1DScaled operator using matrix free operators.

Definition at line 185 of file PhysInterp1DScaled.cpp.

Constructor & Destructor Documentation

◆ ~PhysInterp1DScaled_MatrixFree()

Nektar::Collections::PhysInterp1DScaled_MatrixFree::~PhysInterp1DScaled_MatrixFree ( )
inlinefinal

Definition at line 192 of file PhysInterp1DScaled.cpp.

193 {
194 }

◆ PhysInterp1DScaled_MatrixFree()

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

Definition at line 235 of file PhysInterp1DScaled.cpp.

238 : Operator(pCollExp, pGeomData, factors),
239 MatrixFreeOneInOneOut(pCollExp[0]->GetStdExp()->GetNcoeffs(),
240 pCollExp[0]->GetStdExp()->GetTotPoints(),
241 pCollExp.size()),
243 {
244 // Basis vector.
245 const auto dim = pCollExp[0]->GetStdExp()->GetShapeDimension();
246 std::vector<LibUtilities::BasisSharedPtr> basis(dim);
247 for (auto i = 0; i < dim; ++i)
248 {
249 basis[i] = pCollExp[0]->GetBasis(i);
250 }
251
252 // Get shape type
253 auto shapeType = pCollExp[0]->GetStdExp()->DetShapeType();
254
255 // Generate operator string and create operator.
256 std::string op_string = "PhysInterp1DScaled";
257 op_string += MatrixFree::GetOpstring(shapeType, false);
259 op_string, basis, m_nElmtPad);
260
261 m_oper =
262 std::dynamic_pointer_cast<MatrixFree::PhysInterp1DScaled>(oper);
263 ASSERTL0(m_oper, "Failed to cast pointer.");
264 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
unsigned int m_nElmtPad
size after padding
MatrixFreeOneInOneOut(const unsigned int nIn, const unsigned int nOut, const unsigned int nCollSize)
Constructor.
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.
Definition: NekFactory.hpp:143
OperatorFactory & GetOperatorFactory()
Returns the singleton Operator factory object.
Definition: Operator.cpp:44
StdRegions::ConstFactorMap factors

References ASSERTL0, Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::Collections::GetOperatorFactory(), Nektar::Collections::MatrixFreeBase::m_nElmtPad, and m_oper.

Member Function Documentation

◆ CheckFactors()

void Nektar::Collections::PhysInterp1DScaled_MatrixFree::CheckFactors ( StdRegions::FactorMap  factors,
int  coll_phys_offset 
)
inlineoverridevirtual

Check the validity of the supplied factor map.

Implements Nektar::Collections::Operator.

Definition at line 226 of file PhysInterp1DScaled.cpp.

228 {
229 ASSERTL0(false, "Not valid for this operator.");
230 }

References ASSERTL0.

◆ 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 196 of file PhysInterp1DScaled.cpp.

201 {
202 if (m_isPadded)
203 {
204 // copy into padded vector
205 Vmath::Vcopy(m_nIn, input, 1, m_input, 1);
206 // call op
207 (*m_oper)(m_input, m_output);
208 // copy out of padded vector
209 Vmath::Vcopy(m_nOut, m_output, 1, output0, 1);
210 }
211 else
212 {
213 (*m_oper)(input, output0);
214 }
215 }
Array< OneD, NekDouble > m_input
padded input/output vectors
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825

References Nektar::Collections::MatrixFreeOneInOneOut::m_input, Nektar::Collections::MatrixFreeBase::m_isPadded, Nektar::Collections::MatrixFreeBase::m_nIn, Nektar::Collections::MatrixFreeBase::m_nOut, Nektar::Collections::MatrixFreeOneInOneOut::m_output, and Vmath::Vcopy().

◆ 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 217 of file PhysInterp1DScaled.cpp.

221 {
223 "BwdTrans_MatrixFree: Not valid for this operator.");
224 }
#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.

Member Data Documentation

◆ m_oper

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

Definition at line 233 of file PhysInterp1DScaled.cpp.

Referenced by PhysInterp1DScaled_MatrixFree().