40#include <MatrixFreeOps/Operator.hpp>
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.");
158 "Constant factor not defined: " +
173 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
212 (*m_oper)(input, output0);
222 "BwdTrans_MatrixFree: Not valid for this operator.");
227 ASSERTL0(
false,
"Not valid for this operator.");
231 std::shared_ptr<MatrixFree::PhysInterp1DScaled>
m_oper;
234 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
238 pCollExp[0]->GetStdExp()->GetTotPoints(),
243 const auto dim = pCollExp[0]->GetStdExp()->GetShapeDimension();
244 std::vector<LibUtilities::BasisSharedPtr> basis(dim);
245 for (
auto i = 0; i < dim; ++i)
247 basis[i] = pCollExp[0]->GetBasis(i);
251 auto shapeType = pCollExp[0]->GetStdExp()->DetShapeType();
254 std::string op_string =
"PhysInterp1DScaled";
255 op_string += MatrixFree::GetOpstring(shapeType,
false);
260 std::dynamic_pointer_cast<MatrixFree::PhysInterp1DScaled>(oper);
285 const int nCoeffs =
m_stdExp->GetNcoeffs();
286 const int nPhys =
m_stdExp->GetTotPoints();
291 m_stdExp->BwdTrans(input + i * nCoeffs, tmp = output + i * nPhys);
300 ASSERTL0(
false,
"Not valid for this operator.");
317 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
346 int dim{
m_expList[0]->GetShapeDimension()};
355 int npt0 = (int)pt0 * scale;
368 Blas::Dgemv(
'N', npt0, pt0, 1.0, I0->GetPtr().get(), npt0,
369 &input[cnt], 1, 0.0, &output[cnt1], 1);
382 int npt0 = (int)pt0 * scale;
383 int npt1 = (int)pt1 * scale;
406 Blas::Dgemm(
'N',
'T', pt0, npt1, pt1, 1.0, &input[cnt], pt0,
407 I1->GetPtr().get(), npt1, 0.0, wsp.get(), pt0);
410 I0->GetPtr().get(), npt0, wsp.get(), pt0, 0.0,
411 &output[cnt1], npt0);
425 int npt0 = (int)pt0 * scale;
426 int npt1 = (int)pt1 * scale;
427 int npt2 = (int)pt2 * scale;
457 I0->GetPtr().get(), npt0, &input[cnt], pt0, 0.0,
460 for (
int j = 0; j < pt2; j++)
463 wsp2.get() + j * npt0 * pt1, npt0,
464 I1->GetPtr().get(), npt1, 0.0,
465 wsp1.get() + j * npt0 * npt1, npt0);
469 wsp1.get(), npt0 * npt1, I2->GetPtr().get(),
470 npt2, 0.0, &output[cnt1], npt0 * npt1);
472 cnt += pt0 * pt1 * pt2;
473 cnt1 += npt0 * npt1 * npt2;
480 "PhysInterp1DScaled operator.");
490 ASSERTL0(
false,
"Not valid for this operator.");
509 vector<StdRegions::StdExpansionSharedPtr> pCollExp,
519OperatorKey PhysInterp1DScaled_NoCollection::m_typeArr[] = {
522 PhysInterp1DScaled_NoCollection::create,
523 "PhysInterp1DScaled_NoCollection_Seg"),
526 PhysInterp1DScaled_NoCollection::create,
527 "PhysInterp1DScaled_NoCollection_Tri"),
530 PhysInterp1DScaled_NoCollection::create,
531 "PhysInterp1DScaled_NoCollection_NodalTri"),
534 PhysInterp1DScaled_NoCollection::create,
535 "PhysInterp1DScaled_NoCollection_Quad"),
538 PhysInterp1DScaled_NoCollection::create,
539 "PhysInterp1DScaled_NoCollection_Tet"),
542 PhysInterp1DScaled_NoCollection::create,
543 "PhysInterp1DScaled_NoCollection_NodalTet"),
546 PhysInterp1DScaled_NoCollection::create,
547 "PhysInterp1DScaled_NoCollection_Pyr"),
550 PhysInterp1DScaled_NoCollection::create,
551 "PhysInterp1DScaled_NoCollection_Prism"),
554 PhysInterp1DScaled_NoCollection::create,
555 "PhysInterp1DScaled_NoCollection_NodalPrism"),
558 PhysInterp1DScaled_NoCollection::create,
559 "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
PhysInterp1DScaled_Helper()
void UpdateFactors(StdRegions::FactorMap factors) override
Update the supplied factor map.
PhysInterp1DScaled operator using default StdRegions operator.
void UpdateFactors(StdRegions::FactorMap factors) override
Update 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_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)
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
void UpdateFactors(StdRegions::FactorMap factors) override
Update the supplied factor map.
PhysInterp1DScaled operator using LocalRegions implementation.
PhysInterp1DScaled_NoCollection(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
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 UpdateFactors(StdRegions::FactorMap factors) override
Update the supplied factor map.
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
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.
void UpdateFactors(StdRegions::FactorMap factors) override
Update the supplied factor map.
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)