55 [[maybe_unused]]
int numcoeffs,
73 int nquad0 =
m_base[0]->GetNumPoints();
74 int nquad1 =
m_base[1]->GetNumPoints();
75 bool Deriv0 = (outarray_d0.size() > 0);
76 bool Deriv1 = (outarray_d1.size() > 0);
82 if ((inarray.data() == outarray_d0.data()) ||
83 (inarray.data() == outarray_d1.data()))
99#define PHYSDERIV_DEF \
100 PhysDerivTensor2DKernel(nquad0, nquad1, (const vec_t *)intmp.data(), \
101 (const vec_t *)D0, (const vec_t *)D1, \
102 (vec_t *)outarray_d0.data(), \
103 (vec_t *)outarray_d1.data(), Deriv0, Deriv1)
107#define PHYSDERIV_Q(r, i) \
109 PhysDerivTensor2DKernel(NQ1(i), NQ1(i), (const vec_t *)intmp.data(), \
110 (const vec_t *)D0, (const vec_t *)D1, \
111 (vec_t *)outarray_d0.data(), \
112 (vec_t *)outarray_d1.data(), Deriv0, Deriv1); \
117 if (nquad0 == nquad1)
153 ASSERTL1(
false,
"input dir is out of range");
171 const int nq0 =
m_base[0]->GetNumPoints();
172 const int nq1 =
m_base[1]->GetNumPoints();
175 for (
int i = 0; i < nq1; ++i)
177 wsp[i] = StdExpansion::BaryEvaluate<0>(coll[0], &physvals[0] + i * nq0);
180 return StdExpansion::BaryEvaluate<1>(coll[1], &wsp[0]);
189 int nq0 =
m_base[0]->GetNumPoints();
190 int nq1 =
m_base[1]->GetNumPoints();
194 for (i = 0; i < nq1; ++i)
197 Vmath::Dot(nq0, &(I[0]->GetPtr())[0], 1, &physvals[i * nq0], 1);
201 val =
Vmath::Dot(nq1, I[1]->GetPtr(), 1, wsp1, 1);
237 const bool CollDir0 =
m_base[0]->Collocation();
238 const bool CollDir1 =
m_base[1]->Collocation();
240 if (CollDir0 && CollDir1)
248 inarray, outarray, one,
false, CollDir0,
258 const bool Deformed,
const bool CollDir0,
const bool CollDir1)
266 ASSERTL1((dir == 0) || (dir == 1),
"Invalid direction.");
268 const int nq0 =
m_base[0]->GetNumPoints();
269 const int nq1 =
m_base[1]->GetNumPoints();
270 const int nq = nq0 * nq1;
276 for (
int i = 0; i < nq; i++)
288 m_base[1]->GetBdata(), in, out, one,
false,
289 false,
m_base[1]->Collocation());
294 m_base[1]->GetDbdata(), in, out, one,
false,
295 m_base[0]->Collocation(),
false);
301 (*mat)(j, i) = out[j];
310 int nquad0 =
m_base[0]->GetNumPoints();
311 int nquad1 =
m_base[1]->GetNumPoints();
314 for (
int i = 0; i < nquad1; ++i)
316 for (
int j = 0; j < nquad0; ++j, ++cnt)
335 int nquad0 =
m_base[0]->GetNumPoints();
336 int nquad1 =
m_base[1]->GetNumPoints();
337 int nqtot = nquad0 * nquad1;
338 int nmodes0 =
m_base[0]->GetNumModes();
339 int nmodes1 =
m_base[1]->GetNumModes();
347 if (!(
m_base[0]->Collocation() &&
m_base[1]->Collocation()))
378 int nquad0 =
m_base[0]->GetNumPoints();
379 int nquad1 =
m_base[1]->GetNumPoints();
380 int nqtot = nquad0 * nquad1;
381 int nmodes0 =
m_base[0]->GetNumModes();
382 int nmodes1 =
m_base[1]->GetNumModes();
392 if (!(
m_base[0]->Collocation() &&
m_base[1]->Collocation()))
422 [[maybe_unused]]
const unsigned int traceid,
426 "This method must be defined at the individual shape level");
437 [[maybe_unused]]
int Q)
445 dir = (eid == 0) ? 0 : 1;
452 int numModes =
m_base[dir]->GetNumModes();
455 P = (
P == -1) ? numModes :
P;
458 if (maparray.size() !=
P)
464 for (i = 0; i <
P; ++i)
469 if (signarray.size() !=
P)
475 std::fill(signarray.data(), signarray.data() +
P, 1);
480 for (i = numModes; i <
P; ++i)
483 maparray[i] = maparray[0];
493 std::swap(maparray[0], maparray[1]);
495 for (i = 3; i < std::min(
P, numModes); i += 2)
503 ASSERTL1(
P == numModes,
"Different trace space edge dimension "
504 "and element edge dimension not currently "
505 "possible for GLL-Lagrange bases");
507 std::reverse(maparray.data(), maparray.data() +
P);
511 ASSERTL0(
false,
"Mapping not defined for this type of basis");
526 if (maparray.size() != map2.size())
531 for (
int i = 0; i < map2.size(); ++i)
533 maparray[i] = map1[map2[i]];
545 fromExp->GetBasis(1)->GetPointsKey(), fromData,
546 m_base[1]->GetPointsKey(),
547 m_base[0]->GetPointsKey(), toData);
552 fromExp->GetBasis(1)->GetPointsKey(), fromData,
553 m_base[0]->GetPointsKey(),
554 m_base[1]->GetPointsKey(), toData);
560 const int nq0, [[maybe_unused]]
const int nq1,
561 [[maybe_unused]]
bool Forwards)
563 if (idmap.size() != nq0)
571 for (
int i = 0; i < nq0; ++i)
579 for (
int i = 0; i < nq0; ++i)
581 idmap[i] = nq0 - 1 - i;
586 ASSERTL0(
false,
"Unknown orientation");
#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...
#define PHYSDERIV_Q(r, i)
#define STDLEV1UPDATE(r, state)
#define STDLEV1TEST(r, state)
Describes the specification for a Basis.
virtual void v_IProductWRTBaseKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const Array< OneD, NekDouble > &jac, const bool Deformed, bool CollDir0=false, bool CollDir1=false)=0
void v_GenStdMatBwdDeriv(const int dir, DNekMatSharedPtr &mat) override
NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals) override
This function evaluates the expansion at a single (arbitrary) point of the domain.
void PhysTensorDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray_d0, Array< OneD, NekDouble > &outarray_d1)
Calculate the 2D derivative in the local tensor/collapsed coordinate at the physical points.
void v_HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
void v_GetTraceToElementMap(const int eid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation edgeOrient=eForwards, int P=-1, int Q=-1) override
void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculate the inner product of inarray with respect to the basis B=base0*base1 and put into outarray.
NekDouble v_PhysEvaluateInterp(const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals) override
void IProductWRTBaseKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const Array< OneD, NekDouble > &jac, const bool Deformed, bool CollDir0=false, bool CollDir1=false)
void v_GetTraceCoeffMap(const unsigned int traceid, Array< OneD, unsigned int > &maparray) override
void v_ReOrientTracePhysMap(const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1, bool Forwards) override
void v_LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
void v_PhysDeriv(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculate the derivative of the physical points in a given direction.
void v_GetElmtTraceToTraceMap(const unsigned int eid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation edgeOrient, int P, int Q) override
Determine the mapping to re-orientate the coefficients along the element trace (assumed to align with...
void v_PhysInterp(std::shared_ptr< StdExpansion > fromExp, const Array< OneD, const NekDouble > &fromData, Array< OneD, NekDouble > &toData, bool Transpose) override
void LaplacianMatrixOp_MatFree_GenericImpl(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
void LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
Convert local cartesian coordinate xi into local collapsed coordinates eta.
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
this function calculates the inner product of a given function f with the different modes of the expa...
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Backward transformation from coefficient space to physical space.
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void HelmholtzMatrixOp_MatFree_GenericImpl(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Array< OneD, LibUtilities::BasisSharedPtr > m_base
std::vector< Array< OneD, const NekDouble > > m_weights
void LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
NekDouble GetConstFactor(const ConstFactorType &factor) const
bool ConstFactorExists(const ConstFactorType &factor) const
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis,...
@ eModified_B
Principle Modified Functions .
@ eGauss_Lagrange
Lagrange Polynomials using the Gauss points.
@ eGLL_Lagrange
Lagrange for SEM basis .
@ eModified_A
Principle Modified Functions .
static const NekDouble kNekZeroTol
tinysimd::scalarT< double > vec_t
static Array< OneD, NekDouble > NullNekDouble1DArray
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)
std::shared_ptr< DNekMat > DNekMatSharedPtr
void CopyArray(const Array< OneD, ConstDataType > &source, Array< OneD, DataType > &dest)
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Svtvp (scalar times vector plus vector): z = alpha*x + y.
T Dot(int n, const T *w, const T *x)
dot product
scalarT< T > max(scalarT< T > lhs, scalarT< T > rhs)