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 "
66 <<
"(element ID = " <<
m_geom->GetGlobalID() <<
") "
67 <<
"(first vertex ID = " <<
m_geom->GetVid(0) <<
")";
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);
486 for (
int i = 0; i < ntraces; ++i)
498 for (
int i = 0; i < ndir; ++i)
515 for (
int j = 0; j < ntraces; ++j)
518 for (
int k = 0; k < nTracePts; ++k)
520 for (
int d = 0;
d < ndir; ++
d)
522 (*DerivMat[
d])(i, cnt + k) = Deriv[
d][traceids[j][k]];
539 const int expDim =
m_base.size();
546 for (
int i = 0; i < expDim; ++i)
548 CBasis[i] =
m_geom->GetXmap()->GetBasis(i);
549 nqGeom *= CBasis[i]->GetNumPoints();
551 m_base[i]->GetBasisKey().SamePoints(CBasis[i]->GetBasisKey());
560 for (
int i = 0; i <
m_geom->GetCoordim(); ++i)
562 m_geom->GetXmap()->BwdTrans(
m_geom->GetCoeffs(i), tmp[i]);
567 for (
int i = 0; i <
m_geom->GetCoordim(); ++i)
570 m_geom->GetXmap()->BwdTrans(
m_geom->GetCoeffs(i), tmpGeom);
577 CBasis[0]->GetPointsKey(), &tmpGeom[0],
578 m_base[0]->GetPointsKey(), &tmp[i][0]);
584 CBasis[0]->GetPointsKey(), CBasis[1]->GetPointsKey(),
585 &tmpGeom[0],
m_base[0]->GetPointsKey(),
586 m_base[1]->GetPointsKey(), &tmp[i][0]);
592 CBasis[0]->GetPointsKey(), CBasis[1]->GetPointsKey(),
593 CBasis[2]->GetPointsKey(), &tmpGeom[0],
595 m_base[2]->GetPointsKey(), &tmp[i][0]);
607 int shapedim = dfdir.size();
609 int nqtot = direction.size() / coordim;
611 for (
int j = 0; j < shapedim; j++)
614 for (
int k = 0; k < coordim; k++)
619 &direction[k * nqtot], 1, &dfdir[j][0], 1,
625 &direction[k * nqtot], 1, &dfdir[j][0], 1,
638 int nquad0, nquad1, nquad2;
644 nquad0 =
m_base[0]->GetNumPoints();
645 nquad1 =
m_base[1]->GetNumPoints();
646 nqtot = nquad0 * nquad1;
651 nquad0 =
m_base[0]->GetNumPoints();
652 nquad1 =
m_base[1]->GetNumPoints();
653 nquad2 =
m_base[2]->GetNumPoints();
654 nqtot = nquad0 * nquad1 * nquad2;
673 for (
int k = 0; k < coordim; k++)
675 StdRegions::VarCoeffMap::const_iterator MFdir =
676 varcoeffs.find(MMFCoeffs[5 * dir + k]);
677 tmp = MFdir->second.GetValue();
701 StdRegions::VarCoeffMap::const_iterator MFdir =
702 varcoeffs.find(MMFCoeffs[5 * dir + indxDiv]);
724 StdRegions::VarCoeffMap::const_iterator MFdir =
725 varcoeffs.find(MMFCoeffs[5 * dir + indxMag]);
748 [[maybe_unused]]
const std::vector<unsigned int> &nummodes,
749 [[maybe_unused]]
const int nmodes_offset,
751 [[maybe_unused]] std::vector<LibUtilities::BasisType> &fromType)
757 [[maybe_unused]]
const int edge,
758 [[maybe_unused]]
const std::shared_ptr<Expansion> &EdgeExp,
767 [[maybe_unused]]
const int edge,
768 [[maybe_unused]]
const std::shared_ptr<Expansion> &EdgeExp,
776 [[maybe_unused]]
const int face,
777 [[maybe_unused]]
const std::shared_ptr<Expansion> &FaceExp,
785 [[maybe_unused]]
const int dir,
798 "This function is only valid for "
799 "shape expansion in LocalRegions, not parant class");
809 "This function is only valid for "
810 "shape expansion in LocalRegions, not parant class");
827 [[maybe_unused]]
const int trace,
831 "Method does not exist for this shape or library");
835 [[maybe_unused]]
const int trace,
842 "Method does not exist for this shape or library");
849 "Method does not exist for this shape or library");
855 [[maybe_unused]]
const int nq1)
858 "Method does not exist for this shape or library");
865 "Method does not exist for this shape or library");
870 ASSERTL0(
false,
"Cannot compute trace normal for this expansion.");
891 [[maybe_unused]]
const int trace,
899 [[maybe_unused]]
const int traceid,
915 const int nbnd)
const
919 "m_elmtBndNormDirElmtLen normal not computed.");
924 [[maybe_unused]]
const int dir,
#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)
SpatialDomains::GeometrySharedPtr GetGeom() const
virtual void v_TraceNormLen(const int traceid, NekDouble &h, NekDouble &p)
IndexMapValuesSharedPtr CreateIndexMap(const IndexMapKey &ikey)
SpatialDomains::GeometrySharedPtr m_geom
void GetTracePhysMap(const int edge, Array< OneD, int > &outarray)
void DropLocMatrix(const LocalRegions::MatrixKey &mkey)
const SpatialDomains::GeomFactorsSharedPtr & GetMetricInfo() 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
virtual void v_AddRobinTraceContribution(const int traceid, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs)
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)
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)
Expansion(SpatialDomains::GeometrySharedPtr pGeom)
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.
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)
Array< OneD, LibUtilities::BasisSharedPtr > m_base
MatrixType GetMatrixType() const
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
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< IndexMapValues > IndexMapValuesSharedPtr
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< Geometry > GeometrySharedPtr
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::map< ConstFactorType, NekDouble > ConstFactorMap
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
std::vector< double > d(NPUPPER *NPUPPER)
StdRegions::ConstFactorMap factors
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)