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
 
void operator() (const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp) override final
 Perform operation. More...
 
void operator() (int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) override final
 
virtual 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 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 ~Operator ()
 
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 expansion pointer. More...
 
StdRegions::StdExpansionSharedPtr GetExpSharedPtr ()
 Get expansion pointer. More...
 

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 Attributes inherited from Nektar::Collections::Operator
bool m_isDeformed
 
StdRegions::StdExpansionSharedPtr m_stdExp
 
unsigned int m_numElmt
 
unsigned int m_nqe
 
unsigned int m_wspSize
 

Detailed Description

Backward transform operator using matrix free operators.

Definition at line 149 of file BwdTrans.cpp.

Constructor & Destructor Documentation

◆ ~BwdTrans_MatrixFree()

Nektar::Collections::BwdTrans_MatrixFree::~BwdTrans_MatrixFree ( )
inlinefinal

Definition at line 154 of file BwdTrans.cpp.

155 {
156 }

◆ BwdTrans_MatrixFree()

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

Definition at line 200 of file BwdTrans.cpp.

203 : Operator(pCollExp, pGeomData, factors),
204 MatrixFreeOneInOneOut(pCollExp[0]->GetStdExp()->GetNcoeffs(),
205 pCollExp[0]->GetStdExp()->GetTotPoints(),
206 pCollExp.size())
207 {
208 // Basis vector.
209 const auto dim = pCollExp[0]->GetStdExp()->GetShapeDimension();
210 std::vector<LibUtilities::BasisSharedPtr> basis(dim);
211 for (auto i = 0; i < dim; ++i)
212 {
213 basis[i] = pCollExp[0]->GetBasis(i);
214 }
215
216 // Get shape type
217 auto shapeType = pCollExp[0]->GetStdExp()->DetShapeType();
218
219 // Generate operator string and create operator.
220 std::string op_string = "BwdTrans";
221 op_string += MatrixFree::GetOpstring(shapeType, false);
223 op_string, basis, m_nElmtPad);
224
225 m_oper = std::dynamic_pointer_cast<MatrixFree::BwdTrans>(oper);
226 ASSERTL0(m_oper, "Failed to cast pointer.");
227 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215
std::shared_ptr< MatrixFree::BwdTrans > m_oper
Definition: BwdTrans.cpp:198
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:43
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:144
OperatorFactory & GetOperatorFactory()
Returns the singleton Operator factory object.
Definition: Operator.cpp:117
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()

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

192 {
193 boost::ignore_unused(factors, coll_phys_offset);
194 ASSERTL0(false, "Not valid for this operator.");
195 }

References ASSERTL0, and Nektar::VarcoeffHashingTest::factors.

◆ 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 
)
inlinefinaloverridevirtual

Perform operation.

Implements Nektar::Collections::Operator.

Definition at line 158 of file BwdTrans.cpp.

163 {
164 boost::ignore_unused(output1, output2, wsp);
165
166 if (m_isPadded)
167 {
168 // copy into padded vector
169 Vmath::Vcopy(m_nIn, input, 1, m_input, 1);
170 // call op
171 (*m_oper)(m_input, m_output);
172 // copy out of padded vector
173 Vmath::Vcopy(m_nOut, m_output, 1, output0, 1);
174 }
175 else
176 {
177 (*m_oper)(input, output0);
178 }
179 }
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.cpp:1191

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

Implements Nektar::Collections::Operator.

Definition at line 181 of file BwdTrans.cpp.

184 {
185 boost::ignore_unused(dir, input, output, wsp);
187 "BwdTrans_MatrixFree: Not valid for this operator.");
188 }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:209

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

Referenced by BwdTrans_MatrixFree().