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

Backward transform operator using matrix free operators. More...

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

Public Member Functions

 ~BwdTrans_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
 
- 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

 BwdTrans_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)
 

Private Attributes

std::shared_ptr< MatrixFree::BwdTrans > 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...
 

Additional Inherited Members

- Protected Member Functions inherited from Nektar::Collections::BwdTrans_Helper
 BwdTrans_Helper ()
 
- 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

Backward transform operator using matrix free operators.

Definition at line 157 of file BwdTrans.cpp.

Constructor & Destructor Documentation

◆ ~BwdTrans_MatrixFree()

Nektar::Collections::BwdTrans_MatrixFree::~BwdTrans_MatrixFree ( )
finaldefault

◆ BwdTrans_MatrixFree()

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

Definition at line 187 of file BwdTrans.cpp.

190 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper(),
191 MatrixFreeBase(pCollExp[0]->GetStdExp()->GetNcoeffs(),
192 pCollExp[0]->GetStdExp()->GetTotPoints(),
193 pCollExp.size())
194 {
195 // Basis vector.
196 const auto dim = pCollExp[0]->GetStdExp()->GetShapeDimension();
197 std::vector<LibUtilities::BasisSharedPtr> basis(dim);
198 for (auto i = 0; i < dim; ++i)
199 {
200 basis[i] = pCollExp[0]->GetBasis(i);
201 }
202
203 // Get shape type
204 auto shapeType = pCollExp[0]->GetStdExp()->DetShapeType();
205
206 // Generate operator string and create operator.
207 std::string op_string = "BwdTrans";
208 op_string += MatrixFree::GetOpstring(shapeType, false);
210 op_string, basis, pCollExp.size());
211
212 oper->SetUpBdata(basis);
213
214 m_oper = std::dynamic_pointer_cast<MatrixFree::BwdTrans>(oper);
215 ASSERTL0(m_oper, "Failed to cast pointer.");
216 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
std::shared_ptr< MatrixFree::BwdTrans > m_oper
Definition: BwdTrans.cpp:185
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
Constructor.
Definition: Operator.cpp:66
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

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

Member Function Documentation

◆ operator()() [1/2]

void Nektar::Collections::BwdTrans_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 166 of file BwdTrans.cpp.

171 {
172 (*m_oper)(input, output0);
173 }

◆ operator()() [2/2]

void Nektar::Collections::BwdTrans_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 175 of file BwdTrans.cpp.

179 {
181 "BwdTrans_MatrixFree: Not valid for this operator.");
182 }
#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::BwdTrans> Nektar::Collections::BwdTrans_MatrixFree::m_oper
private

Definition at line 185 of file BwdTrans.cpp.

Referenced by BwdTrans_MatrixFree().