39#include <MatrixFreeOps/Operator.hpp>
90 1.0,
m_mat->GetRawPtr(),
m_mat->GetRows(), input.get(),
91 m_stdExp->GetNcoeffs(), 0.0, output0.get(),
100 ASSERTL0(
false,
"Not valid for this operator.");
122 BwdTrans_StdMat::create,
"BwdTrans_StdMat_Seg"),
125 BwdTrans_StdMat::create,
"BwdTrans_StdMat_Tri"),
128 BwdTrans_StdMat::create,
"BwdTrans_StdMat_NodalTri"),
131 BwdTrans_StdMat::create,
"BwdTrans_StdMat_Quad"),
134 BwdTrans_StdMat::create,
"BwdTrans_StdMat_Tet"),
137 BwdTrans_StdMat::create,
"BwdTrans_StdMat_NodalTet"),
140 BwdTrans_StdMat::create,
"BwdTrans_StdMat_Pyr"),
143 "BwdTrans_StdMat_Prism"),
146 "BwdTrans_StdMat_NodalPrism"),
149 BwdTrans_StdMat::create,
"BwdTrans_StdMat_Hex"),
152 BwdTrans_StdMat::create,
"BwdTrans_SumFac_Pyr")};
172 (*m_oper)(input, output0);
181 "BwdTrans_MatrixFree: Not valid for this operator.");
185 std::shared_ptr<MatrixFree::BwdTrans>
m_oper;
192 pCollExp[0]->GetStdExp()->GetTotPoints(),
196 const auto dim = pCollExp[0]->GetStdExp()->GetShapeDimension();
197 std::vector<LibUtilities::BasisSharedPtr> basis(dim);
198 for (
auto i = 0; i < dim; ++i)
200 basis[i] = pCollExp[0]->GetBasis(i);
204 auto shapeType = pCollExp[0]->GetStdExp()->DetShapeType();
207 std::string op_string =
"BwdTrans";
208 op_string += MatrixFree::GetOpstring(shapeType,
false);
210 op_string, basis, pCollExp.size());
212 oper->SetUpBdata(basis);
214 m_oper = std::dynamic_pointer_cast<MatrixFree::BwdTrans>(oper);
223 BwdTrans_MatrixFree::create,
"BwdTrans_MatrixFree_Seg"),
226 BwdTrans_MatrixFree::create,
"BwdTrans_MatrixFree_Quad"),
229 BwdTrans_MatrixFree::create,
"BwdTrans_MatrixFree_Tri"),
232 BwdTrans_MatrixFree::create,
"BwdTrans_MatrixFree_Hex"),
235 BwdTrans_MatrixFree::create,
"BwdTrans_MatrixFree_Prism"),
238 BwdTrans_MatrixFree::create,
"BwdTrans_MatrixFree_Tet"),
241 BwdTrans_MatrixFree::create,
"BwdTrans_MatrixFree_Pyr")};
260 const int nCoeffs =
m_stdExp->GetNcoeffs();
261 const int nPhys =
m_stdExp->GetTotPoints();
266 m_stdExp->BwdTrans(input + i * nCoeffs, tmp = output0 + i * nPhys);
275 ASSERTL0(
false,
"Not valid for this operator.");
291 BwdTrans_IterPerExp::create,
"BwdTrans_IterPerExp_Seg"),
294 BwdTrans_IterPerExp::create,
"BwdTrans_IterPerExp_Tri"),
297 BwdTrans_IterPerExp::create,
"BwdTrans_IterPerExp_NodalTri"),
300 BwdTrans_IterPerExp::create,
"BwdTrans_IterPerExp_Quad"),
303 BwdTrans_IterPerExp::create,
"BwdTrans_IterPerExp_Tet"),
306 BwdTrans_IterPerExp::create,
"BwdTrans_IterPerExp_NodalTet"),
309 BwdTrans_IterPerExp::create,
"BwdTrans_IterPerExp_Pyr"),
312 BwdTrans_IterPerExp::create,
"BwdTrans_IterPerExp_Prism"),
315 BwdTrans_IterPerExp::create,
"BwdTrans_IterPerExp_NodalPrism"),
318 BwdTrans_IterPerExp::create,
"BwdTrans_IterPerExp_Hex"),
338 const int nCoeffs =
m_expList[0]->GetNcoeffs();
339 const int nPhys =
m_expList[0]->GetTotPoints();
344 m_expList[i]->BwdTrans(input + i * nCoeffs,
345 tmp = output0 + i * nPhys);
354 ASSERTL0(
false,
"Not valid for this operator.");
374 BwdTrans_NoCollection::create,
"BwdTrans_NoCollection_Seg"),
377 BwdTrans_NoCollection::create,
"BwdTrans_NoCollection_Tri"),
380 BwdTrans_NoCollection::create,
"BwdTrans_NoCollection_NodalTri"),
383 BwdTrans_NoCollection::create,
"BwdTrans_NoCollection_Quad"),
386 BwdTrans_NoCollection::create,
"BwdTrans_NoCollection_Tet"),
389 BwdTrans_NoCollection::create,
"BwdTrans_NoCollection_NodalTet"),
392 BwdTrans_NoCollection::create,
"BwdTrans_NoCollection_Pyr"),
395 BwdTrans_NoCollection::create,
"BwdTrans_NoCollection_Prism"),
398 BwdTrans_NoCollection::create,
"BwdTrans_NoCollection_NodalPrism"),
401 BwdTrans_NoCollection::create,
"BwdTrans_NoCollection_Hex"),
440 ASSERTL0(
false,
"Not valid for this operator.");
467 BwdTrans_SumFac_Seg::create,
"BwdTrans_SumFac_Seg");
533 ASSERTL0(
false,
"Not valid for this operator.");
568 BwdTrans_SumFac_Quad::create,
"BwdTrans_SumFac_Quad");
589 int ncoeffs =
m_stdExp->GetNcoeffs();
597 &input[0] + mode, ncoeffs, 0.0,
623 ASSERTL0(
false,
"Not valid for this operator.");
663 BwdTrans_SumFac_Tri::create,
"BwdTrans_SumFac_Tri");
683 input.get(), 1, output0.get(), 1);
723 ASSERTL0(
false,
"Not valid for this operator.");
745 m_nquad0(pCollExp[0]->GetNumPoints(0)),
746 m_nquad1(pCollExp[0]->GetNumPoints(1)),
747 m_nquad2(pCollExp[0]->GetNumPoints(2)),
748 m_nmodes0(pCollExp[0]->GetBasisNumModes(0)),
749 m_nmodes1(pCollExp[0]->GetBasisNumModes(1)),
750 m_nmodes2(pCollExp[0]->GetBasisNumModes(2)),
751 m_base0(pCollExp[0]->GetBasis(0)->GetBdata()),
752 m_base1(pCollExp[0]->GetBasis(1)->GetBdata()),
753 m_base2(pCollExp[0]->GetBasis(2)->GetBdata()),
754 m_colldir0(pCollExp[0]->GetBasis(0)->Collocation()),
755 m_colldir1(pCollExp[0]->GetBasis(1)->Collocation()),
756 m_colldir2(pCollExp[0]->GetBasis(2)->Collocation())
767 BwdTrans_SumFac_Hex::create,
"BwdTrans_SumFac_Hex");
796 int ncoeffs =
m_stdExp->GetNcoeffs();
801 for (
int j = 0; j <
m_nmodes1 - i; ++j, ++cnt)
805 input.get() + mode1, ncoeffs, 0.0,
885 ASSERTL0(
false,
"Not valid for this operator.");
934 BwdTrans_SumFac_Tet::create,
"BwdTrans_SumFac_Tet");
956 int totmodes =
m_stdExp->GetNcoeffs();
967 for (i = mode = mode1 = 0; i <
m_nmodes0; ++i)
974 input.get() + mode1, totmodes, 0.0,
1022 ASSERTL0(
false,
"Not valid for this operator.");
1070 BwdTrans_SumFac_Prism::create,
"BwdTrans_SumFac_Prism");
1092 int totmodes =
m_stdExp->GetNcoeffs();
1107 int ijmax = max(i, j);
1110 input.get() + mode1, totmodes, 0.0,
1119 int ijmax = max(i, j);
1178 ASSERTL0(
false,
"Not valid for this operator.");
1225 BwdTrans_SumFac_Pyr::create,
"BwdTrans_SumFac_Pyr");
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define OPERATOR_CREATE(cname)
Backward transform help class to calculate the size of the collection that is given as an input and a...
Backward transform operator using default StdRegions operator.
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
BwdTrans_IterPerExp(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
~BwdTrans_IterPerExp() final=default
Backward transform operator using matrix free operators.
std::shared_ptr< MatrixFree::BwdTrans > m_oper
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
~BwdTrans_MatrixFree() final=default
BwdTrans_MatrixFree(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Backward transform operator using LocalRegions implementation.
BwdTrans_NoCollection(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
~BwdTrans_NoCollection() final=default
vector< StdRegions::StdExpansionSharedPtr > m_expList
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Backward transform operator using standard matrix approach.
~BwdTrans_StdMat() final=default
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
BwdTrans_StdMat(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Backward transform operator using sum-factorisation (Hex)
Array< OneD, const NekDouble > m_base1
~BwdTrans_SumFac_Hex() final=default
Array< OneD, const NekDouble > m_base2
Array< OneD, const NekDouble > m_base0
BwdTrans_SumFac_Hex(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Backward transform operator using sum-factorisation (Prism)
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
BwdTrans_SumFac_Prism(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
~BwdTrans_SumFac_Prism() final=default
Array< OneD, const NekDouble > m_base0
Array< OneD, const NekDouble > m_base1
Array< OneD, const NekDouble > m_base2
Backward transform operator using sum-factorisation (Pyr)
Array< OneD, const NekDouble > m_base2
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
~BwdTrans_SumFac_Pyr() final=default
BwdTrans_SumFac_Pyr(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Array< OneD, const NekDouble > m_base1
Array< OneD, const NekDouble > m_base0
Backward transform operator using sum-factorisation (Quad)
Array< OneD, const NekDouble > m_base1
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Array< OneD, const NekDouble > m_base0
~BwdTrans_SumFac_Quad() final=default
BwdTrans_SumFac_Quad(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Backward transform operator using sum-factorisation (Segment)
~BwdTrans_SumFac_Seg() final=default
BwdTrans_SumFac_Seg(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Array< OneD, const NekDouble > m_base0
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Backward transform operator using sum-factorisation (Tet)
BwdTrans_SumFac_Tet(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Array< OneD, const NekDouble > m_base1
~BwdTrans_SumFac_Tet() final=default
Array< OneD, const NekDouble > m_base0
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Array< OneD, const NekDouble > m_base2
Backward transform operator using sum-factorisation (Tri)
~BwdTrans_SumFac_Tri() final=default
BwdTrans_SumFac_Tri(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Array< OneD, const NekDouble > m_base0
Array< OneD, const NekDouble > m_base1
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Base class for operators on a collection of elements.
StdRegions::StdExpansionSharedPtr m_stdExp
unsigned int m_numElmt
number of elements that the operator is applied on
unsigned int m_outputSize
number of modes or quadrature points that are taken as output from an operator
unsigned int m_inputSize
number of modes or quadrature points that are passed as input to an operator
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
static void Dgemm(const char &transa, const char &transb, const int &m, const int &n, const int &k, const double &alpha, const double *a, const int &lda, const double *b, const int &ldb, const double &beta, double *c, const int &ldc)
BLAS level 3: Matrix-matrix multiply C = A x B where op(A)[m x k], op(B)[k x n], C[m x n] DGEMM perfo...
static void Daxpy(const int &n, const double &alpha, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: y = alpha x plus y.
std::tuple< LibUtilities::ShapeType, OperatorType, ImplementationType, ExpansionIsNodal > OperatorKey
Key for describing an Operator.
std::shared_ptr< CoalescedGeomData > CoalescedGeomDataSharedPtr
OperatorFactory & GetOperatorFactory()
Returns the singleton Operator factory object.
@ eModified_A
Principle Modified Functions .
StdRegions::ConstFactorMap factors
std::shared_ptr< DNekMat > DNekMatSharedPtr
void Zero(int n, T *x, const int incx)
Zero vector.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)