35 #include <boost/core/ignore_unused.hpp>
49 StdSegExp::StdSegExp()
87 bool returnval =
false;
117 int nquad0 =
m_base[0]->GetNumPoints();
148 boost::ignore_unused(out_d1, out_d2);
156 boost::ignore_unused(dir);
157 ASSERTL1(dir == 0,
"input dir is out of range");
167 boost::ignore_unused(out_d1, out_d2);
176 boost::ignore_unused(dir);
177 ASSERTL1(dir == 0,
"input dir is out of range");
208 int nquad =
m_base[0]->GetNumPoints();
210 if (
m_base[0]->Collocation())
218 (
m_base[0]->GetBdata()).get(), nquad, &inarray[0], 1, 0.0,
227 int n_coeffs = inarray.size();
234 int nmodes0 =
m_base[0]->GetNumModes();
249 Vmath::Vcopy(numMin, tmp = coeff, 1, tmp2 = coeff_tmp, 1);
275 if (
m_base[0]->Collocation())
290 out = (*matsys) * in;
298 if (
m_base[0]->Collocation())
327 ASSERTL0(
false,
"This type of FwdTrans is not defined for this "
331 fill(outarray.get(), outarray.get() +
m_ncoeffs, 0.0);
355 Blas::Dgemv(
'N', nInteriorDofs, nInteriorDofs, 1.0,
356 &(matsys->GetPtr())[0], nInteriorDofs,
357 tmp1.get() + offset, 1, 0.0,
358 outarray.get() + offset, 1);
404 boost::ignore_unused(coll_check);
406 int nquad =
m_base[0]->GetNumPoints();
455 boost::ignore_unused(dir);
456 ASSERTL1(dir == 0,
"input dir is out of range");
464 int nquad =
m_base[0]->GetNumPoints();
469 if (multiplybyweights)
474 0.0, outarray.get(), 1);
479 1, 0.0, outarray.get(), 1);
500 int nquad =
m_base[0]->GetNumPoints();
504 "calling argument mode is larger than total expansion order");
512 return StdExpansion::BaryEvaluateBasis<0>(coords[0], mode);
519 boost::ignore_unused(mkey);
521 int nquad =
m_base[0]->GetNumPoints();
537 int nquad =
m_base[0]->GetNumPoints();
559 int nq =
m_base[0]->GetNumPoints();
560 int nmodes =
m_base[0]->GetNumModes();
574 OrthoExp.
FwdTrans(array, orthocoeffs);
577 for (
int j = 0; j < nmodes; ++j)
583 exp(-(j - nmodes) * (j - nmodes) /
584 ((
NekDouble)((j - cutoff + 1) * (j - cutoff + 1)))));
588 orthocoeffs[j] *= 0.0;
593 OrthoExp.
BwdTrans(orthocoeffs, array);
602 int nq =
m_base[0]->GetNumPoints();
603 int nmodes =
m_base[0]->GetNumModes();
612 int Pcut = cutoff *
P;
616 OrthoExp.
FwdTrans(array, orthocoeffs);
620 for (
int j = 0; j < nmodes; ++j)
626 fac = pow(fac, exponent);
627 orthocoeffs[j] *= exp(-alpha * fac);
632 OrthoExp.
BwdTrans(orthocoeffs, array);
640 int nquad0 =
m_base[0]->GetNumPoints();
644 Vmath::Vmul(nquad0, inarray.get(), 1, w0.get(), 1, outarray.get(), 1);
651 boost::ignore_unused(coords_1, coords_2);
671 boost::ignore_unused(i);
677 boost::ignore_unused(i);
692 const std::vector<unsigned int> &nummodes,
int &modes_offset)
694 int nmodes = nummodes[modes_offset];
713 int nq =
m_base[0]->GetNumPoints();
726 for (
int i = 0; i < neq; ++i)
728 coords[0] = -1.0 + 2 * i / (
NekDouble)(neq - 1);
729 I =
m_base[0]->GetI(coords);
730 Vmath::Vcopy(nq, I->GetRawPtr(), 1, Mat->GetRawPtr() + i, neq);
743 (*Mat) = Imass * Iprod;
750 if (mattype ==
eMass)
783 int nummodes =
m_base[0]->GetNumModes();
793 outarray[1] = nummodes - 1;
800 ASSERTL0(0,
"Mapping array is not defined for this expansion");
833 ASSERTL0(0,
"Mapping array is not defined for this expansion");
840 boost::ignore_unused(useCoeffPacking);
841 ASSERTL0((localVertexId == 0) || (localVertexId == 1),
843 "must be between 0 or 1");
845 int localDOF = localVertexId;
848 (localVertexId == 1))
850 localDOF =
m_base[0]->GetNumModes() - 1;
858 boost::ignore_unused(standard);
859 int np =
m_base[0]->GetNumPoints();
863 for (
int i = 0; i < np - 1; ++i)
877 int order0 =
m_base[0]->GetNumModes();
879 ASSERTL0(traceid < 2,
"eid must be between 0 and 1");
881 if (maparray.size() != 1)
890 maparray[0] = (traceid == 0) ? 0 : 1;
895 maparray[0] = (traceid == 0) ? 0 : order0 - 1;
908 boost::ignore_unused(orient,
P, Q);
912 if (signarray.size() != 1)
928 boost::ignore_unused(eid, orient,
P, Q);
929 if (maparray.size() != 1)
936 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.
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 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.
virtual int v_GetTraceNumPoints(const int i) const
virtual void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2)
virtual void v_ExponentialFilter(Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
virtual 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)
virtual void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray)
virtual void v_GetElmtTraceToTraceMap(const unsigned int eid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation edgeOrient, int P, int Q)
virtual int v_GetNverts() const
virtual void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray)
virtual void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
NekDouble v_PhysEvaluateBasis(const Array< OneD, const NekDouble > &coords, int mode) final
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey)
virtual void v_GetTraceToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation edgeOrient, int P, int Q)
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
virtual 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)
Evaluate the derivative at the physical quadrature points given by inarray and return in outarray.
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_NumDGBndryCoeffs() const
virtual int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false)
virtual LibUtilities::ShapeType v_DetShapeType() const
Return Shape of region, using ShapeType enum list. i.e. Segment.
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
StdSegExp()
Default constructor.
virtual void v_GetTraceCoeffMap(const unsigned int traceid, Array< OneD, unsigned int > &maparray)
Get the map of the coefficient location to teh local trace coefficients.
virtual void v_LocCollapsedToLocCoord(const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi)
virtual int v_GetNtraces() const
virtual int v_NumBndryCoeffs() const
virtual void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrate the physical point list inarray over region and return the value.
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Backward transform from coefficient space given in inarray and evaluate at the physical quadrature po...
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Forward transform from physical quadrature space stored in inarray and evaluate the expansion coeffic...
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
virtual DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey)
virtual void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual bool v_IsBoundaryInteriorExpansion()
virtual void v_GetInteriorMap(Array< OneD, unsigned int > &outarray)
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the expansion basis (this)->m_base[0] and return...
virtual int v_GetTraceNcoeffs(const int i) const
virtual void v_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true)
virtual int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset)
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 = A x 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 .
@ 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
The above copyright notice and this permission notice shall be included.
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.