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::MatrixFreeOneInOneOut
 MatrixFreeOneInOneOut (const unsigned int nIn, const unsigned int nOut, const unsigned int nCollSize)
 Constructor. More...
 

Private Attributes

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

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 199 of file BwdTrans.cpp.

202 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper(),
203 MatrixFreeOneInOneOut(pCollExp[0]->GetStdExp()->GetNcoeffs(),
204 pCollExp[0]->GetStdExp()->GetTotPoints(),
205 pCollExp.size())
206 {
207 // Basis vector.
208 const auto dim = pCollExp[0]->GetStdExp()->GetShapeDimension();
209 std::vector<LibUtilities::BasisSharedPtr> basis(dim);
210 for (auto i = 0; i < dim; ++i)
211 {
212 basis[i] = pCollExp[0]->GetBasis(i);
213 }
214
215 // Get shape type
216 auto shapeType = pCollExp[0]->GetStdExp()->DetShapeType();
217
218 // Generate operator string and create operator.
219 std::string op_string = "BwdTrans";
220 op_string += MatrixFree::GetOpstring(shapeType, false);
222 op_string, basis, m_nElmtPad);
223
224 m_oper = std::dynamic_pointer_cast<MatrixFree::BwdTrans>(oper);
225 ASSERTL0(m_oper, "Failed to cast pointer.");
226 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
std::shared_ptr< MatrixFree::BwdTrans > m_oper
Definition: BwdTrans.cpp:197
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
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(), Nektar::Collections::MatrixFreeBase::m_nElmtPad, 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 if (m_isPadded)
173 {
174 // copy into padded vector
175 Vmath::Vcopy(m_nIn, input, 1, m_input, 1);
176 // call op
177 (*m_oper)(m_input, m_output);
178 // copy out of padded vector
179 Vmath::Vcopy(m_nOut, m_output, 1, output0, 1);
180 }
181 else
182 {
183 (*m_oper)(input, output0);
184 }
185 }
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::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 187 of file BwdTrans.cpp.

191 {
193 "BwdTrans_MatrixFree: Not valid for this operator.");
194 }
#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 197 of file BwdTrans.cpp.

Referenced by BwdTrans_MatrixFree().