46 std::string(
"ExpansionIndexMap")),
47 m_geom(pGeom), m_metricinfo(m_geom->GetGeomFactors()),
48 m_elementTraceLeft(-1), m_elementTraceRight(-1)
58 string type =
"regular";
65 err << nDim <<
"D " << type <<
" Jacobian not positive "
75 : StdExpansion(pSrc), m_indexMapManager(pSrc.m_indexMapManager),
76 m_geom(pSrc.m_geom), m_metricinfo(pSrc.m_metricinfo)
107 const NekDouble *data,
const std::vector<unsigned int> &nummodes,
108 const int nmodes_offset,
NekDouble *coeffs,
109 std::vector<LibUtilities::BasisType> &fromType)
115 const int edge,
const std::shared_ptr<Expansion> &EdgeExp,
123 const int edge,
const std::shared_ptr<Expansion> &EdgeExp,
130 const int face,
const std::shared_ptr<Expansion> &FaceExp,
142 v_DGDeriv(dir, inarray, EdgeExp, coeffs, outarray);
208 ASSERTL0(
false,
"Boundary Index Map not implemented yet.");
214 ASSERTL0(
false,
"Boundary Index Map not implemented yet.");
220 ASSERTL0(
false,
"Boundary Index Map not implemented yet.");
225 ASSERTL0(
false,
"Vertex Index Map not implemented yet.");
230 ASSERTL0(
false,
"The Index Map you are requiring "
231 "is not between the possible options.");
237 for (
int i = 0; i < map.size(); i++)
239 (*returnval)[i].index = map[i];
240 (*returnval)[i].sign =
sign[i];
253 std::map<int, NormalVector>::const_iterator x;
277 "Geometric information is not set up");
281 unsigned int nint = (
unsigned int)(
m_ncoeffs - nbdry);
282 unsigned int exp_size[] = {nbdry, nint};
283 unsigned int nblks = 2;
285 nblks, nblks, exp_size, exp_size);
298 goto UseLocRegionsMatrix;
303 goto UseStdRegionsMatrix;
309 goto UseLocRegionsMatrix;
322 factor, Asubmat = mat->GetBlock(0, 0)));
326 one, Asubmat = mat->GetBlock(0, 1)));
330 factor, Asubmat = mat->GetBlock(1, 0)));
334 invfactor, Asubmat = mat->GetBlock(1, 1)));
357 for (i = 0; i < nbdry; ++i)
359 for (j = 0; j < nbdry; ++j)
361 (*A)(i, j) = mat(bmap[i], bmap[j]);
364 for (j = 0; j < nint; ++j)
366 (*B)(i, j) = mat(bmap[i], imap[j]);
370 for (i = 0; i < nint; ++i)
372 for (j = 0; j < nbdry; ++j)
374 (*C)(i, j) = mat(imap[i], bmap[j]);
377 for (j = 0; j < nint; ++j)
379 (*D)(i, j) = mat(imap[i], imap[j]);
388 (*A) = (*A) - (*B) * (*C);
452 for (
int i = 0; i < nqtot; ++i)
454 if (std::isnan(outarray[i]) || std::isinf(outarray[i]))
498 for (
int i = 0; i < ntraces; ++i)
510 for (
int i = 0; i < ndir; ++i)
527 for (
int j = 0; j < ntraces; ++j)
530 for (
int k = 0; k < nTracePts; ++k)
532 for (
int d = 0; d < ndir; ++d)
534 (*DerivMat[d])(i, cnt + k) = Deriv[d][traceids[j][k]];
560 for (
int d = 0; d < ndir; ++d)
574 PhysDeriv(phys, Deriv[0], Deriv[1], Deriv[2]);
576 for (
int k = 0; k < nTracePts; ++k)
578 for (
int d = 0; d < ndir; ++d)
580 (*DerivMat[d])(i, k) = Deriv[d][tracePhysIds[k]];
608 for (
int k = 0; k < nTracePts; ++k)
610 (*BdataMat)(i, k) = phys[tracePhysIds[k]];
624 const int expDim =
m_base.size();
631 for (
int i = 0; i < expDim; ++i)
634 nqGeom *= CBasis[i]->GetNumPoints();
636 m_base[i]->GetBasisKey().SamePoints(CBasis[i]->GetBasisKey());
662 CBasis[0]->GetPointsKey(), &tmpGeom[0],
663 m_base[0]->GetPointsKey(), &tmp[i][0]);
669 CBasis[0]->GetPointsKey(), CBasis[1]->GetPointsKey(),
670 &tmpGeom[0],
m_base[0]->GetPointsKey(),
671 m_base[1]->GetPointsKey(), &tmp[i][0]);
677 CBasis[0]->GetPointsKey(), CBasis[1]->GetPointsKey(),
678 CBasis[2]->GetPointsKey(), &tmpGeom[0],
680 m_base[2]->GetPointsKey(), &tmp[i][0]);
692 int shapedim = dfdir.size();
694 int nqtot = direction.size() / coordim;
696 for (
int j = 0; j < shapedim; j++)
699 for (
int k = 0; k < coordim; k++)
704 &direction[k * nqtot], 1, &dfdir[j][0], 1,
710 &direction[k * nqtot], 1, &dfdir[j][0], 1,
723 int nquad0, nquad1, nquad2;
729 nquad0 =
m_base[0]->GetNumPoints();
730 nquad1 =
m_base[1]->GetNumPoints();
731 nqtot = nquad0 * nquad1;
736 nquad0 =
m_base[0]->GetNumPoints();
737 nquad1 =
m_base[1]->GetNumPoints();
738 nquad2 =
m_base[2]->GetNumPoints();
739 nqtot = nquad0 * nquad1 * nquad2;
758 for (
int k = 0; k < coordim; k++)
760 StdRegions::VarCoeffMap::const_iterator MFdir =
761 varcoeffs.find(MMFCoeffs[5 * dir + k]);
762 tmp = MFdir->second.GetValue();
786 StdRegions::VarCoeffMap::const_iterator MFdir =
787 varcoeffs.find(MMFCoeffs[5 * dir + indxDiv]);
809 StdRegions::VarCoeffMap::const_iterator MFdir =
810 varcoeffs.find(MMFCoeffs[5 * dir + indxMag]);
833 [[maybe_unused]]
const std::vector<unsigned int> &nummodes,
834 [[maybe_unused]]
const int nmodes_offset,
836 [[maybe_unused]] std::vector<LibUtilities::BasisType> &fromType)
842 [[maybe_unused]]
const int edge,
843 [[maybe_unused]]
const std::shared_ptr<Expansion> &EdgeExp,
852 [[maybe_unused]]
const int edge,
853 [[maybe_unused]]
const std::shared_ptr<Expansion> &EdgeExp,
861 [[maybe_unused]]
const int face,
862 [[maybe_unused]]
const std::shared_ptr<Expansion> &FaceExp,
870 [[maybe_unused]]
const int dir,
883 "This function is only valid for "
884 "shape expansion in LocalRegions, not parant class");
894 "This function is only valid for "
895 "shape expansion in LocalRegions, not parant class");
912 [[maybe_unused]]
const int trace,
916 "Method does not exist for this shape or library");
920 [[maybe_unused]]
const int trace,
927 "Method does not exist for this shape or library");
934 "Method does not exist for this shape or library");
940 [[maybe_unused]]
const int nq1)
943 "Method does not exist for this shape or library");
950 "Method does not exist for this shape or library");
955 ASSERTL0(
false,
"Cannot compute trace normal for this expansion.");
976 [[maybe_unused]]
const int trace,
984 [[maybe_unused]]
const int traceid,
1000 const int nbnd)
const
1004 "m_elmtBndNormDirElmtLen normal not computed.");
1009 [[maybe_unused]]
const int dir,
1018 std::vector<int> &q_begin, std::vector<int> &q_end)
1067 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1068 q_end[0] = bkeys[0].GetNumPoints();
1097 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1098 q_end[0] = bkeys[0].GetNumPoints();
1103 q_begin[1] = bkeys[1].GetNumPoints() - 1;
1104 q_end[1] = bkeys[1].GetNumPoints();
1139 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1140 q_end[0] = bkeys[0].GetNumPoints();
1145 q_begin[1] = bkeys[1].GetNumPoints() - 1;
1146 q_end[1] = bkeys[1].GetNumPoints();
1157 q_begin[2] = bkeys[2].GetNumPoints() - 1;
1158 q_end[2] = bkeys[2].GetNumPoints();
1187 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1188 q_end[0] = bkeys[0].GetNumPoints();
1223 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1224 q_end[0] = bkeys[0].GetNumPoints();
1229 q_begin[1] = bkeys[1].GetNumPoints() - 1;
1230 q_end[1] = bkeys[1].GetNumPoints();
1265 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1266 q_end[0] = bkeys[0].GetNumPoints();
1271 q_begin[0] = bkeys[1].GetNumPoints() - 1;
1272 q_end[0] = bkeys[1].GetNumPoints();
#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 ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
#define sign(a, b)
return the sign(b)*a
std::map< int, NormalVector > m_traceNormals
std::map< int, Array< OneD, NekDouble > > m_elmtBndNormDirElmtLen
the element length in each element boundary(Vertex, edge or face) normal direction calculated based o...
virtual void v_SetPhysNormals(Array< OneD, const NekDouble > &normal)
virtual void v_TraceNormLen(const int traceid, NekDouble &h, NekDouble &p)
IndexMapValuesSharedPtr CreateIndexMap(const IndexMapKey &ikey)
Expansion(SpatialDomains::Geometry *pGeom)
void GetTracePhysMap(const int edge, Array< OneD, int > &outarray)
void DropLocMatrix(const LocalRegions::MatrixKey &mkey)
const SpatialDomains::GeomFactorsSharedPtr & GetMetricInfo() const
SpatialDomains::Geometry * GetGeom() const
DNekMatSharedPtr BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
virtual void v_DivideByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp)
void ComputeLaplacianMetric()
void v_SetCoeffsToOrientation(StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
SpatialDomains::Geometry * m_geom
virtual void v_AddRobinTraceContribution(const int traceid, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs)
void PhysDerivBaseOnTraceMat(const int traceid, Array< OneD, DNekMatSharedPtr > &DerivMat)
void ComputeGmatcdotMF(const Array< TwoD, const NekDouble > &df, const Array< OneD, const NekDouble > &direction, Array< OneD, Array< OneD, NekDouble > > &dfdir)
virtual void v_GetTraceQFactors(const int trace, Array< OneD, NekDouble > &outarray)
virtual void v_ComputeTraceNormal(const int id)
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
Array< OneD, NekDouble > GetMFMag(const int dir, const StdRegions::VarCoeffMap &varcoeffs)
virtual DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
virtual DNekScalMatSharedPtr v_GetLocMatrix(const LocalRegions::MatrixKey &mkey)
virtual void v_AddFaceNormBoundaryInt(const int face, const std::shared_ptr< Expansion > &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
virtual void v_DGDeriv(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &coeffs, Array< OneD, NekDouble > &outarray)
virtual DNekMatSharedPtr v_BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
const Array< OneD, const NekDouble > & GetElmtBndNormDirElmtLen(const int nbnd) const
virtual void v_AddRobinMassMatrix(const int face, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
std::map< int, ExpansionWeakPtr > m_traceExp
virtual void v_NormalTraceDerivFactors(Array< OneD, Array< OneD, NekDouble > > &factors, Array< OneD, Array< OneD, NekDouble > > &d0factors, Array< OneD, Array< OneD, NekDouble > > &d1factors)
void ComputeQuadratureMetric()
void AddEdgeNormBoundaryInt(const int edge, const std::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
void AddFaceNormBoundaryInt(const int face, const std::shared_ptr< Expansion > &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
virtual void v_DropLocMatrix(const LocalRegions::MatrixKey &mkey)
void PhysBaseOnTraceMat(const int traceid, DNekMatSharedPtr &BdataMat)
virtual NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &vec)
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
virtual StdRegions::Orientation v_GetTraceOrient(int trace)
void DGDeriv(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &coeffs, Array< OneD, NekDouble > &outarray)
void StdDerivBaseOnTraceMat(Array< OneD, DNekMatSharedPtr > &DerivMat)
void ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
void v_MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
virtual void v_ReOrientTracePhysMap(const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1=-1)
void NormalTraceDerivFactors(Array< OneD, Array< OneD, NekDouble > > &factors, Array< OneD, Array< OneD, NekDouble > > &d0factors, Array< OneD, Array< OneD, NekDouble > > &d1factors)
virtual void v_ComputeLaplacianMetric()
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals()
virtual void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
virtual void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
virtual void v_AddEdgeNormBoundaryInt(const int edge, const std::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
virtual void v_SetUpPhysNormals(const int id)
virtual void v_GetTracePhysMap(const int edge, Array< OneD, int > &outarray)
Array< OneD, NekDouble > GetMFDiv(const int dir, const StdRegions::VarCoeffMap &varcoeffs)
const NormalVector & GetTraceNormal(const int id)
Array< OneD, NekDouble > GetMF(const int dir, const int shapedim, const StdRegions::VarCoeffMap &varcoeffs)
virtual void v_GetTracePhysVals(const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
DNekMatSharedPtr BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
NekDouble VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &vec)
StdRegions::Orientation GetIndexOrientation() const
IndexMapType GetIndexMapType() const
int GetIndexEntity() const
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Base class for shape geometry information.
int GetVid(int i) const
Returns global id of vertex i of this object.
const Array< OneD, const NekDouble > & GetCoeffs(const int i) const
Return the coefficients of the transformation Geometry::m_xmap in coordinate direction i.
int GetGlobalID(void) const
Get the ID of this object.
int GetCoordim() const
Return the coordinate dimension of this object (i.e. the dimension of the space in which this object ...
void FillGeom()
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
GeomFactorsSharedPtr GetGeomFactors()
Get the geometric factors for this object, generating them if required.
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
int GetTraceNumPoints(const int i) const
This function returns the number of quadrature points belonging to the i-th trace.
int NumBndryCoeffs(void) const
const LibUtilities::PointsKeyVector GetPointsKeys() const
DNekBlkMatSharedPtr GetStdStaticCondMatrix(const StdMatrixKey &mkey)
int GetNtraces() const
Returns the number of trace elements connected to this element.
virtual void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void GetTraceToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
void GetInteriorMap(Array< OneD, unsigned int > &outarray)
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 StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
void PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
Array< OneD, LibUtilities::BasisSharedPtr > m_base
MatrixType GetMatrixType() const
std::vector< BasisKey > BasisKeyVector
Name for a vector of BasisKeys.
void GetEffectiveQuadRange(const LibUtilities::PointsKey &pkey, int &q_begin, int &q_end)
void Interp1D(const BasisKey &fbasis0, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, Array< OneD, NekDouble > &to)
this function interpolates a 1D function evaluated at the quadrature points of the basis fbasis0 to ...
void Interp3D(const BasisKey &fbasis0, const BasisKey &fbasis1, const BasisKey &fbasis2, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, const BasisKey &tbasis2, Array< OneD, NekDouble > &to)
this function interpolates a 3D function evaluated at the quadrature points of the 3D basis,...
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,...
std::vector< PointsKey > PointsKeyVector
constexpr unsigned int ShapeTypeDimMap[SIZE_ShapeType]
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< IndexMapValues > IndexMapValuesSharedPtr
void GetTraceQuadRange(const LibUtilities::ShapeType shapeType, const LibUtilities::BasisKeyVector &bkeys, int traceid, std::vector< int > &q_begin, std::vector< int > &q_end)
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
GeomType
Indicates the type of element geometry.
@ eRegular
Geometry is straight-sided with constant geometric factors.
@ eNoGeomType
No type defined.
@ eMovingRegular
Currently unused.
@ eDeformed
Geometry is curved or has non-constant factors.
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::map< ConstFactorType, NekDouble > ConstFactorMap
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekBlkMat > DNekBlkMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
static DNekMatSharedPtr NullDNekMatSharedPtr
static Array< OneD, NekDouble > NullNekDouble1DArray
static DNekScalMatSharedPtr NullDNekScalMatSharedPtr
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.
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.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
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)