65 bool returnval =
false;
95 int nquad0 =
m_base[0]->GetNumPoints();
133 ASSERTL1(dir == 0,
"input dir is out of range");
150 ASSERTL1(dir == 0,
"input dir is out of range");
180 int nquad =
m_base[0]->GetNumPoints();
182 if (
m_base[0]->Collocation())
189 (
m_base[0]->GetBdata()).data(), nquad, &inarray[0], 1, 0.0,
198 int n_coeffs = inarray.size();
205 int nmodes0 =
m_base[0]->GetNumModes();
220 Vmath::Vcopy(numMin, tmp = coeff, 1, tmp2 = coeff_tmp, 1);
246 if (
m_base[0]->Collocation())
261 out = (*matsys) * in;
269 if (
m_base[0]->Collocation())
298 ASSERTL0(
false,
"This type of FwdTrans is not defined for this "
302 fill(outarray.data(), outarray.data() +
m_ncoeffs, 0.0);
326 Blas::Dgemv(
'N', nInteriorDofs, nInteriorDofs, 1.0,
327 &(matsys->GetPtr())[0], nInteriorDofs,
328 tmp1.data() + offset, 1, 0.0,
329 outarray.data() + offset, 1);
373 [[maybe_unused]]
int coll_check)
375 int nquad =
m_base[0]->GetNumPoints();
424 ASSERTL1(dir == 0,
"input dir is out of range");
432 int nquad =
m_base[0]->GetNumPoints();
437 if (multiplybyweights)
442 0.0, outarray.data(), 1);
447 1, 0.0, outarray.data(), 1);
468 int nquad =
m_base[0]->GetNumPoints();
472 "calling argument mode is larger than total expansion order");
480 return StdExpansion::BaryEvaluateBasis<0>(coords[0], mode);
486 std::array<NekDouble, 3> &firstOrderDerivs)
494 std::array<NekDouble, 3> &firstOrderDerivs,
495 std::array<NekDouble, 6> &secondOrderDerivs)
504 int nquad =
m_base[0]->GetNumPoints();
528 int nquad =
m_base[0]->GetNumPoints();
550 int nq =
m_base[0]->GetNumPoints();
551 int nmodes =
m_base[0]->GetNumModes();
565 OrthoExp.
FwdTrans(array, orthocoeffs);
568 for (
int j = 0; j < nmodes; ++j)
574 exp(-(j - nmodes) * (j - nmodes) /
575 ((
NekDouble)((j - cutoff + 1) * (j - cutoff + 1)))));
579 orthocoeffs[j] *= 0.0;
584 OrthoExp.
BwdTrans(orthocoeffs, array);
593 int nq =
m_base[0]->GetNumPoints();
594 int nmodes =
m_base[0]->GetNumModes();
603 int Pcut = cutoff *
P;
607 OrthoExp.
FwdTrans(array, orthocoeffs);
611 for (
int j = 0; j < nmodes; ++j)
617 fac = pow(fac, exponent);
618 orthocoeffs[j] *= exp(-alpha * fac);
623 OrthoExp.
BwdTrans(orthocoeffs, array);
631 int nquad0 =
m_base[0]->GetNumPoints();
635 Vmath::Vmul(nquad0, inarray.data(), 1, w0.data(), 1, outarray.data(), 1);
686 const std::vector<unsigned int> &nummodes,
int &modes_offset)
688 int nmodes = nummodes[modes_offset];
707 int nq =
m_base[0]->GetNumPoints();
720 for (
int i = 0; i < neq; ++i)
722 coords[0] = -1.0 + 2 * i / (
NekDouble)(neq - 1);
723 I =
m_base[0]->GetI(coords);
724 Vmath::Vcopy(nq, I->GetRawPtr(), 1, Mat->GetRawPtr() + i, neq);
737 (*Mat) = Imass * Iprod;
744 if (mattype ==
eMass)
777 int nummodes =
m_base[0]->GetNumModes();
787 outarray[1] = nummodes - 1;
794 ASSERTL0(0,
"Mapping array is not defined for this expansion");
827 ASSERTL0(0,
"Mapping array is not defined for this expansion");
833 [[maybe_unused]]
bool useCoeffPacking)
835 ASSERTL0((localVertexId == 0) || (localVertexId == 1),
837 "must be between 0 or 1");
839 int localDOF = localVertexId;
842 (localVertexId == 1))
844 localDOF =
m_base[0]->GetNumModes() - 1;
852 int np =
m_base[0]->GetNumPoints();
856 for (
int i = 0; i < np - 1; ++i)
870 int order0 =
m_base[0]->GetNumModes();
872 ASSERTL0(traceid < 2,
"eid must be between 0 and 1");
874 if (maparray.size() != 1)
883 maparray[0] = (traceid == 0) ? 0 : 1;
888 maparray[0] = (traceid == 0) ? 0 : order0 - 1;
900 [[maybe_unused]]
int P,
901 [[maybe_unused]]
int Q)
905 if (signarray.size() != 1)
916 [[maybe_unused]]
const unsigned int eid,
918 [[maybe_unused]]
Orientation orient, [[maybe_unused]]
int P,
919 [[maybe_unused]]
int Q)
922 if (maparray.size() != 1)
929 if (signarray.size() != 1)
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
Describes the specification for a Basis.
Defines a specification for a set of points.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
void PhysTensorDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Evaluate the derivative at the physical quadrature points given by inarray and return in outarray.
NekDouble BaryTensorDeriv(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
The base class for all shapes.
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
int NumBndryCoeffs(void) const
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
void MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
int GetVertexMap(const int localVertexId, bool useCoeffPacking=false)
DNekMatSharedPtr CreateGeneralMatrix(const StdMatrixKey &mkey)
this function generates the mass matrix
void LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Backward transformation from coefficient space to physical space.
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Forward transformation from physical space to coefficient space.
LibUtilities::NekManager< StdMatrixKey, DNekBlkMat, StdMatrixKey::opLess > m_stdStaticCondMatrixManager
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Array< OneD, LibUtilities::BasisSharedPtr > m_base
MatrixType GetMatrixType() const
NekDouble GetConstFactor(const ConstFactorType &factor) const
bool ConstFactorExists(const ConstFactorType &factor) const
Class representing a segment element in reference space All interface of this class sits in StdExpans...
void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Inner product of inarray over region with respect to the expansion basis (this)->m_base[0] and return...
int v_NumDGBndryCoeffs() const override
NekDouble v_PhysEvalFirstDeriv(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey) override
void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
void v_GetInteriorMap(Array< OneD, unsigned int > &outarray) override
NekDouble v_PhysEvaluateBasis(const Array< OneD, const NekDouble > &coords, int mode) final
LibUtilities::ShapeType v_DetShapeType() const override
Return Shape of region, using ShapeType enum list. i.e. Segment.
StdSegExp(const LibUtilities::BasisKey &Ba)
Constructor using BasisKey class for quadrature points and order definition.
NekDouble v_PhysEvalFirstSecondDeriv(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs, std::array< NekDouble, 6 > &secondOrderDerivs) override
int v_NumBndryCoeffs() const override
void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
void v_LocCollapsedToLocCoord(const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi) override
void v_GetTraceCoeffMap(const unsigned int traceid, Array< OneD, unsigned int > &maparray) override
Get the map of the coefficient location to teh local trace coefficients.
int v_GetNverts() const final
void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Forward transform from physical quadrature space stored in inarray and evaluate the expansion coeffic...
int v_GetTraceNumPoints(const int i) const final
void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray) override
int v_GetTraceNcoeffs(const int i) const final
void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray) override
Evaluate the derivative at the physical quadrature points given by inarray and return in outarray.
void v_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true) override
void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2) override
int v_GetTraceIntNcoeffs(const int i) const final
NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray) override
Integrate the physical point list inarray over region and return the value.
int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false) override
void v_ExponentialFilter(Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff) override
DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey) override
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Backward transform from coefficient space given in inarray and evaluate at the physical quadrature po...
int v_GetNtraces() const final
void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray) override
void v_GetTraceToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation edgeOrient, int P, int Q) override
void v_GetElmtTraceToTraceMap(const unsigned int eid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation edgeOrient, int P, int Q) override
void v_StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray) override
void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta) override
bool v_IsBoundaryInteriorExpansion() const override
int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset) override
DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey) override
void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
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 Dcopy(const int &n, const double *x, const int &incx, double *y, const int &incy)
BLAS level 1: Copy x to y.
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.
int getNumberOfCoefficients(int Na)
void InterpCoeff1D(const BasisKey &fbasis0, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, Array< OneD, NekDouble > &to)
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
@ eModified_B
Principle Modified Functions .
@ P
Monomial polynomials .
@ eGauss_Lagrange
Lagrange Polynomials using the Gauss points.
@ eOrtho_A
Principle Orthogonal Functions .
@ eGLL_Lagrange
Lagrange for SEM basis .
@ eChebyshev
Chebyshev Polynomials.
@ eModified_A
Principle Modified Functions .
@ eFourier
Fourier Expansion .
@ ePhysInterpToEquiSpaced
std::vector< double > w(NPUPPER)
std::vector< double > z(NPUPPER)
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.
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x)
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)
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.