40#include <MatrixFreeOps/Operator.hpp>
66 [[maybe_unused]]
int coll_phys_offset)
override
78 "Constant factor not defined: " +
100 int shape_dimension =
m_stdExp->GetShapeDimension();
102 for (
int i = 0; i < shape_dimension; ++i)
132 1.0,
m_mat->GetRawPtr(),
m_mat->GetRows(), input.get(),
133 m_stdExp->GetNcoeffs(), 0.0, output.get(),
142 ASSERTL0(
false,
"Not valid for this operator.");
146 [[maybe_unused]]
int coll_phys_offset)
override
159 "Constant factor not defined: " +
174 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
213 (*m_oper)(input, output0);
223 "BwdTrans_MatrixFree: Not valid for this operator.");
227 [[maybe_unused]]
int coll_phys_offset)
override
229 ASSERTL0(
false,
"Not valid for this operator.");
233 std::shared_ptr<MatrixFree::PhysInterp1DScaled>
m_oper;
236 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
240 pCollExp[0]->GetStdExp()->GetTotPoints(),
245 const auto dim = pCollExp[0]->GetStdExp()->GetShapeDimension();
246 std::vector<LibUtilities::BasisSharedPtr> basis(dim);
247 for (
auto i = 0; i < dim; ++i)
249 basis[i] = pCollExp[0]->GetBasis(i);
253 auto shapeType = pCollExp[0]->GetStdExp()->DetShapeType();
256 std::string op_string =
"PhysInterp1DScaled";
257 op_string += MatrixFree::GetOpstring(shapeType,
false);
262 std::dynamic_pointer_cast<MatrixFree::PhysInterp1DScaled>(oper);
287 const int nCoeffs =
m_stdExp->GetNcoeffs();
288 const int nPhys =
m_stdExp->GetTotPoints();
293 m_stdExp->BwdTrans(input + i * nCoeffs, tmp = output + i * nPhys);
302 ASSERTL0(
false,
"Not valid for this operator.");
306 [[maybe_unused]]
int coll_phys_offset)
override
320 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
349 int dim{
m_expList[0]->GetShapeDimension()};
358 int npt0 = (int)pt0 * scale;
371 Blas::Dgemv(
'N', npt0, pt0, 1.0, I0->GetPtr().get(), npt0,
372 &input[cnt], 1, 0.0, &output[cnt1], 1);
385 int npt0 = (int)pt0 * scale;
386 int npt1 = (int)pt1 * scale;
409 Blas::Dgemm(
'N',
'T', pt0, npt1, pt1, 1.0, &input[cnt], pt0,
410 I1->GetPtr().get(), npt1, 0.0, wsp.get(), pt0);
413 I0->GetPtr().get(), npt0, wsp.get(), pt0, 0.0,
414 &output[cnt1], npt0);
428 int npt0 = (int)pt0 * scale;
429 int npt1 = (int)pt1 * scale;
430 int npt2 = (int)pt2 * scale;
460 I0->GetPtr().get(), npt0, &input[cnt], pt0, 0.0,
463 for (
int j = 0; j < pt2; j++)
466 wsp2.get() + j * npt0 * pt1, npt0,
467 I1->GetPtr().get(), npt1, 0.0,
468 wsp1.get() + j * npt0 * npt1, npt0);
472 wsp1.get(), npt0 * npt1, I2->GetPtr().get(),
473 npt2, 0.0, &output[cnt1], npt0 * npt1);
475 cnt += pt0 * pt1 * pt2;
476 cnt1 += npt0 * npt1 * npt2;
483 "PhysInterp1DScaled operator.");
493 ASSERTL0(
false,
"Not valid for this operator.");
497 [[maybe_unused]]
int coll_phys_offset)
override
513 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
523OperatorKey PhysInterp1DScaled_NoCollection::m_typeArr[] = {
526 PhysInterp1DScaled_NoCollection::create,
527 "PhysInterp1DScaled_NoCollection_Seg"),
530 PhysInterp1DScaled_NoCollection::create,
531 "PhysInterp1DScaled_NoCollection_Tri"),
534 PhysInterp1DScaled_NoCollection::create,
535 "PhysInterp1DScaled_NoCollection_NodalTri"),
538 PhysInterp1DScaled_NoCollection::create,
539 "PhysInterp1DScaled_NoCollection_Quad"),
542 PhysInterp1DScaled_NoCollection::create,
543 "PhysInterp1DScaled_NoCollection_Tet"),
546 PhysInterp1DScaled_NoCollection::create,
547 "PhysInterp1DScaled_NoCollection_NodalTet"),
550 PhysInterp1DScaled_NoCollection::create,
551 "PhysInterp1DScaled_NoCollection_Pyr"),
554 PhysInterp1DScaled_NoCollection::create,
555 "PhysInterp1DScaled_NoCollection_Prism"),
558 PhysInterp1DScaled_NoCollection::create,
559 "PhysInterp1DScaled_NoCollection_NodalPrism"),
562 PhysInterp1DScaled_NoCollection::create,
563 "PhysInterp1DScaled_NoCollection_Hex"),
#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)
bool m_isPadded
flag for padding
unsigned int m_nElmtPad
size after padding
Array< OneD, NekDouble > m_output
Array< OneD, NekDouble > m_input
padded input/output vectors
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
PhysInterp1DScaled help class to calculate the size of the collection that is given as an input and a...
StdRegions::FactorMap m_factors
void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset) override
Check the validity of the supplied factor map.
PhysInterp1DScaled_Helper()
PhysInterp1DScaled operator using default StdRegions operator.
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp) override
Perform operation.
void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset) override
Check the validity of the supplied factor map.
StdRegions::FactorMap m_factors
~PhysInterp1DScaled_IterPerExp() final
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
PhysInterp1DScaled_IterPerExp(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
PhysInterp1DScaled operator using matrix free operators.
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.
PhysInterp1DScaled_MatrixFree(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset) override
Check the validity of the supplied factor map.
std::shared_ptr< MatrixFree::PhysInterp1DScaled > m_oper
~PhysInterp1DScaled_MatrixFree() final
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
PhysInterp1DScaled operator using LocalRegions implementation.
PhysInterp1DScaled_NoCollection(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset) override
Check the validity of the supplied factor map.
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp) override
Perform operation.
StdRegions::FactorMap m_factors
~PhysInterp1DScaled_NoCollection() final
vector< StdRegions::StdExpansionSharedPtr > m_expList
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
PhysInterp1DScaled operator using standard matrix approach. Currently, it is an identical copy of the...
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
StdRegions::FactorMap m_factors
void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset) override
Check the validity of the supplied factor map.
PhysInterp1DScaled_StdMat(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
~PhysInterp1DScaled_StdMat() final
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp) override
Perform operation.
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.
Defines a specification for a set of points.
static void Dgemv(const char &trans, const int &m, const int &n, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
BLAS level 2: Matrix vector multiply y = alpha A x plus beta y where A[m x n].
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...
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.
PointsManagerT & PointsManager(void)
const char *const ConstFactorTypeMap[]
StdRegions::ConstFactorMap factors
std::shared_ptr< DNekMat > DNekMatSharedPtr
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)