39#include <MatrixFreeOps/Operator.hpp>
101 tmp = wsp + e *
m_nqe, 1);
106 1.0,
m_mat->GetRawPtr(),
m_mat->GetRows(), wsp.get(),
107 m_stdExp->GetTotPoints(), 0.0, output.get(),
129 m_jac = pGeomData->GetJac(pCollExp);
142 IProductWRTBase_StdMat::create,
"IProductWRTBase_StdMat_Seg"),
145 IProductWRTBase_StdMat::create,
"IProductWRTBase_StdMat_Tri"),
148 IProductWRTBase_StdMat::create,
"IProductWRTBase_StdMat_NodalTri"),
151 IProductWRTBase_StdMat::create,
"IProductWRTBase_StdMat_Quad"),
154 IProductWRTBase_StdMat::create,
"IProductWRTBase_StdMat_Tet"),
157 IProductWRTBase_StdMat::create,
"IProductWRTBase_StdMat_NodalTet"),
160 IProductWRTBase_StdMat::create,
"IProductWRTBase_StdMat_Pyr"),
163 IProductWRTBase_StdMat::create,
"IProductWRTBase_StdMat_Prism"),
166 IProductWRTBase_StdMat::create,
"IProductWRTBase_StdMat_NodalPrism"),
169 IProductWRTBase_StdMat::create,
"IProductWRTBase_StdMat_Hex"),
172 IProductWRTBase_StdMat::create,
"IProductWRTBase_SumFac_Pyr")};
192 (*m_oper)(input, output);
204 std::shared_ptr<MatrixFree::IProduct>
m_oper;
207 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
211 pCollExp[0]->GetStdExp()->GetNcoeffs(),
215 const auto dim = pCollExp[0]->GetStdExp()->GetShapeDimension();
216 std::vector<LibUtilities::BasisSharedPtr> basis(dim);
217 for (
unsigned int i = 0; i < dim; ++i)
219 basis[i] = pCollExp[0]->GetBasis(i);
223 auto shapeType = pCollExp[0]->GetStdExp()->DetShapeType();
226 std::string op_string =
"IProduct";
227 op_string += MatrixFree::GetOpstring(shapeType,
m_isDeformed);
229 op_string, basis, pCollExp.size());
231 oper->SetUpBdata(basis);
232 oper->SetUpZW(basis);
235 oper->SetJac(pGeomData->GetJacInterLeave(pCollExp,
m_nElmtPad));
237 m_oper = std::dynamic_pointer_cast<MatrixFree::IProduct>(oper);
243OperatorKey IProductWRTBase_MatrixFree::m_typeArr[] = {
246 IProductWRTBase_MatrixFree::create,
"IProductWRTBase_MatrixFree_Seg"),
249 IProductWRTBase_MatrixFree::create,
"IProductWRTBase_MatrixFree_Quad"),
252 IProductWRTBase_MatrixFree::create,
"IProductWRTBase_MatrixFree_Tri"),
255 IProductWRTBase_MatrixFree::create,
"IProductWRTBase_MatrixFree_Hex"),
258 IProductWRTBase_MatrixFree::create,
"IProductWRTBase_MatrixFree_Prism"),
261 IProductWRTBase_MatrixFree::create,
"IProductWRTBase_MatrixFree_Pyr"),
264 IProductWRTBase_MatrixFree::create,
"IProductWRTBase_MatrixFree_Tet")};
285 const int nCoeffs =
m_stdExp->GetNcoeffs();
286 const int nPhys =
m_stdExp->GetTotPoints();
293 m_stdExp->IProductWRTBase_SumFac(wsp + i * nPhys,
294 tmp = output + i * nCoeffs,
false);
311 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
315 int nqtot = pCollExp[0]->GetTotPoints();
317 m_jacWStdW = pGeomData->GetJacWithStdWeights(pCollExp);
324OperatorKey IProductWRTBase_IterPerExp::m_typeArr[] = {
327 IProductWRTBase_IterPerExp::create,
"IProductWRTBase_IterPerExp_Seg"),
330 IProductWRTBase_IterPerExp::create,
"IProductWRTBase_IterPerExp_Tri"),
333 IProductWRTBase_IterPerExp::create,
334 "IProductWRTBase_IterPerExp_NodalTri"),
337 IProductWRTBase_IterPerExp::create,
"IProductWRTBase_IterPerExp_Quad"),
340 IProductWRTBase_IterPerExp::create,
"IProductWRTBase_IterPerExp_Tet"),
343 IProductWRTBase_IterPerExp::create,
344 "IProductWRTBase_IterPerExp_NodalTet"),
347 IProductWRTBase_IterPerExp::create,
"IProductWRTBase_IterPerExp_Pyr"),
350 IProductWRTBase_IterPerExp::create,
"IProductWRTBase_IterPerExp_Prism"),
353 IProductWRTBase_IterPerExp::create,
354 "IProductWRTBase_IterPerExp_NodalPrism"),
357 IProductWRTBase_IterPerExp::create,
"IProductWRTBase_IterPerExp_Hex"),
377 const int nCoeffs =
m_expList[0]->GetNcoeffs();
378 const int nPhys =
m_expList[0]->GetTotPoints();
383 m_expList[i]->IProductWRTBase(input + i * nPhys,
384 tmp = output + i * nCoeffs);
401 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
410OperatorKey IProductWRTBase_NoCollection::m_typeArr[] = {
413 IProductWRTBase_NoCollection::create,
414 "IProductWRTBase_NoCollection_Seg"),
417 IProductWRTBase_NoCollection::create,
418 "IProductWRTBase_NoCollection_Tri"),
421 IProductWRTBase_NoCollection::create,
422 "IProductWRTBase_NoCollection_NodalTri"),
425 IProductWRTBase_NoCollection::create,
426 "IProductWRTBase_NoCollection_Quad"),
429 IProductWRTBase_NoCollection::create,
430 "IProductWRTBase_NoCollection_Tet"),
433 IProductWRTBase_NoCollection::create,
434 "IProductWRTBase_NoCollection_NodalTet"),
437 IProductWRTBase_NoCollection::create,
438 "IProductWRTBase_NoCollection_Pyr"),
441 IProductWRTBase_NoCollection::create,
442 "IProductWRTBase_NoCollection_Prism"),
445 IProductWRTBase_NoCollection::create,
446 "IProductWRTBase_NoCollection_NodalPrism"),
449 IProductWRTBase_NoCollection::create,
450 "IProductWRTBase_NoCollection_Hex"),
503 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
512 m_jacWStdW = pGeomData->GetJacWithStdWeights(pCollExp);
520 IProductWRTBase_SumFac_Seg::create,
"IProductWRTBase_SumFac_Seg");
567 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
579 m_jacWStdW = pGeomData->GetJacWithStdWeights(pCollExp);
589 IProductWRTBase_SumFac_Quad::create,
"IProductWRTBase_SumFac_Quad");
635 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
645 m_jacWStdW = pGeomData->GetJacWithStdWeights(pCollExp);
663 IProductWRTBase_SumFac_Tri::create,
"IProductWRTBase_SumFac_Tri");
714 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
731 m_jacWStdW = pGeomData->GetJacWithStdWeights(pCollExp);
742 IProductWRTBase_SumFac_Hex::create,
"IProductWRTBase_SumFac_Hex");
791 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
804 m_jacWStdW = pGeomData->GetJacWithStdWeights(pCollExp);
826 IProductWRTBase_SumFac_Tet::create,
"IProductWRTBase_SumFac_Tet");
875 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
889 m_jacWStdW = pGeomData->GetJacWithStdWeights(pCollExp);
910 IProductWRTBase_SumFac_Prism::create,
"IProductWRTBase_SumFac_Prism");
959 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
973 m_jacWStdW = pGeomData->GetJacWithStdWeights(pCollExp);
994 IProductWRTBase_SumFac_Pyr::create,
"IProductWRTBase_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)
Inner product help class to calculate the size of the collection that is given as an input and as an ...
Inner product operator using element-wise operation.
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Array< OneD, NekDouble > m_jacWStdW
IProductWRTBase_IterPerExp(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
~IProductWRTBase_IterPerExp() final=default
Inner product operator using operator using matrix free operators.
IProductWRTBase_MatrixFree(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
~IProductWRTBase_MatrixFree() final=default
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
std::shared_ptr< MatrixFree::IProduct > m_oper
Inner product operator using original MultiRegions implementation.
~IProductWRTBase_NoCollection() final=default
vector< StdRegions::StdExpansionSharedPtr > m_expList
IProductWRTBase_NoCollection(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
Inner product operator using standard matrix approach.
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Array< OneD, const NekDouble > m_jac
~IProductWRTBase_StdMat() final=default
IProductWRTBase_StdMat(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Inner Product operator using sum-factorisation (Hex)
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
IProductWRTBase_SumFac_Hex(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Array< OneD, const NekDouble > m_base2
Array< OneD, const NekDouble > m_base1
Array< OneD, const NekDouble > m_jacWStdW
~IProductWRTBase_SumFac_Hex() final=default
Inner Product operator using sum-factorisation (Prism)
Array< OneD, const NekDouble > m_jacWStdW
~IProductWRTBase_SumFac_Prism() final=default
Array< OneD, const NekDouble > m_base1
Array< OneD, const NekDouble > m_base0
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
IProductWRTBase_SumFac_Prism(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Inner Product operator using sum-factorisation (Pyr)
Array< OneD, const NekDouble > m_jacWStdW
Array< OneD, const NekDouble > m_base2
~IProductWRTBase_SumFac_Pyr() final=default
Array< OneD, const NekDouble > m_base0
Array< OneD, const NekDouble > m_base1
IProductWRTBase_SumFac_Pyr(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
Inner product operator using sum-factorisation (Quad)
Array< OneD, const NekDouble > m_jacWStdW
Array< OneD, const NekDouble > m_base1
Array< OneD, const NekDouble > m_base0
IProductWRTBase_SumFac_Quad(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
~IProductWRTBase_SumFac_Quad() final=default
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Inner product operator using sum-factorisation (Segment)
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Array< OneD, const NekDouble > m_jacWStdW
IProductWRTBase_SumFac_Seg(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
~IProductWRTBase_SumFac_Seg() final=default
Array< OneD, const NekDouble > m_base0
Inner product operator using sum-factorisation (Tet)
Array< OneD, const NekDouble > m_jacWStdW
~IProductWRTBase_SumFac_Tet() final=default
Array< OneD, const NekDouble > m_base1
IProductWRTBase_SumFac_Tet(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
Array< OneD, const NekDouble > m_base0
Array< OneD, const NekDouble > m_base2
Inner product operator using sum-factorisation (Tri)
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
~IProductWRTBase_SumFac_Tri() final=default
Array< OneD, const NekDouble > m_base0
IProductWRTBase_SumFac_Tri(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Array< OneD, const NekDouble > m_jacWStdW
Array< OneD, const NekDouble > m_base1
unsigned int m_nElmtPad
size after padding
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...
void TetIProduct(bool sortTopEdge, int numElmt, int nquad0, int nquad1, int nquad2, int nmodes0, int nmodes1, int nmodes2, const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &jac, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
void PyrIProduct(bool sortTopVert, int numElmt, int nquad0, int nquad1, int nquad2, int nmodes0, int nmodes1, int nmodes2, const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &jac, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
void TriIProduct(bool sortTopVertex, int numElmt, int nquad0, int nquad1, int nmodes0, int nmodes1, const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &jac, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
std::tuple< LibUtilities::ShapeType, OperatorType, ImplementationType, ExpansionIsNodal > OperatorKey
Key for describing an Operator.
void QuadIProduct(bool colldir0, bool colldir1, int numElmt, int nquad0, int nquad1, int nmodes0, int nmodes1, const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &jac, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
std::shared_ptr< CoalescedGeomData > CoalescedGeomDataSharedPtr
OperatorFactory & GetOperatorFactory()
Returns the singleton Operator factory object.
void PrismIProduct(bool sortTopVert, int numElmt, int nquad0, int nquad1, int nquad2, int nmodes0, int nmodes1, int nmodes2, const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &jac, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
void HexIProduct(bool colldir0, bool colldir1, bool colldir2, int numElmt, int nquad0, int nquad1, int nquad2, int nmodes0, int nmodes1, int nmodes2, const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &jac, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
@ eModified_A
Principle Modified Functions .
StdRegions::ConstFactorMap factors
std::shared_ptr< DNekMat > DNekMatSharedPtr
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.