35 #include <boost/core/ignore_unused.hpp>
45 namespace LocalRegions
49 (std::bind(&
Expansion::CreateIndexMap,this, std::placeholders::_1),
50 std::string(
"ExpansionIndexMap")),
52 m_metricinfo(m_geom->GetGeomFactors()),
53 m_elementTraceLeft(-1),
54 m_elementTraceRight(-1)
64 string type =
"regular";
71 err << nDim <<
"D " << type <<
" Jacobian not positive "
72 <<
"(element ID = " <<
m_geom->GetGlobalID() <<
") "
73 <<
"(first vertex ID = " <<
m_geom->GetVid(0) <<
")";
80 m_indexMapManager(pSrc.m_indexMapManager),
82 m_metricinfo(pSrc.m_metricinfo)
112 const std::vector<unsigned int > &nummodes,
113 const int nmodes_offset,
115 std::vector<LibUtilities::BasisType> &fromType)
122 const std::shared_ptr<Expansion> &EdgeExp,
132 const std::shared_ptr<Expansion> &EdgeExp,
141 const std::shared_ptr<Expansion> &FaceExp,
155 v_DGDeriv(dir, inarray, EdgeExp, coeffs, outarray);
213 ASSERTL0(
false,
"Boundary Index Map not implemented yet.");
219 ASSERTL0(
false,
"Boundary Index Map not implemented yet.");
225 ASSERTL0(
false,
"Boundary Index Map not implemented yet.");
230 ASSERTL0(
false,
"Vertex Index Map not implemented yet.");
235 ASSERTL0(
false,
"The Index Map you are requiring "
236 "is not between the possible options.");
242 for(
int i = 0; i < map.size(); i++)
244 (*returnval)[i].index = map[i];
245 (*returnval)[i].sign =
sign[i];
259 boost::ignore_unused(mkey);
328 const int expDim =
m_base.size();
335 for (
int i = 0; i < expDim; ++i)
337 CBasis[i] =
m_geom->GetXmap()->GetBasis(i);
338 nqGeom *= CBasis[i]->GetNumPoints();
339 doCopy = doCopy &&
m_base[i]->GetBasisKey().SamePoints(
340 CBasis[i]->GetBasisKey());
349 for (
int i = 0; i <
m_geom->GetCoordim(); ++i)
351 m_geom->GetXmap()->BwdTrans(
m_geom->GetCoeffs(i), tmp[i]);
356 for (
int i = 0; i <
m_geom->GetCoordim(); ++i)
359 m_geom->GetXmap()->BwdTrans(
m_geom->GetCoeffs(i), tmpGeom);
366 CBasis[0]->GetPointsKey(), &tmpGeom[0],
367 m_base[0]->GetPointsKey(), &tmp[i][0]);
373 CBasis[0]->GetPointsKey(),
374 CBasis[1]->GetPointsKey(),
376 m_base[0]->GetPointsKey(),
377 m_base[1]->GetPointsKey(),
384 CBasis[0]->GetPointsKey(),
385 CBasis[1]->GetPointsKey(),
386 CBasis[2]->GetPointsKey(),
388 m_base[0]->GetPointsKey(),
389 m_base[1]->GetPointsKey(),
390 m_base[2]->GetPointsKey(),
404 int shapedim = dfdir.size();
406 int nqtot = direction.size()/coordim;
408 for(
int j = 0; j < shapedim; j++)
411 for (
int k = 0; k < coordim; k++)
416 &df[shapedim*k+j][0], 1,
417 &direction[k*nqtot], 1,
425 &direction[k*nqtot], 1,
441 int nquad0, nquad1, nquad2;
447 nquad0 =
m_base[0]->GetNumPoints();
448 nquad1 =
m_base[1]->GetNumPoints();
449 nqtot = nquad0*nquad1;
454 nquad0 =
m_base[0]->GetNumPoints();
455 nquad1 =
m_base[1]->GetNumPoints();
456 nquad2 =
m_base[2]->GetNumPoints();
457 nqtot = nquad0 * nquad1 * nquad2;
485 for (
int k = 0; k < coordim; k++)
487 StdRegions::VarCoeffMap::const_iterator MFdir =
488 varcoeffs.find(MMFCoeffs[5*dir+k]);
523 StdRegions::VarCoeffMap::const_iterator MFdir =
524 varcoeffs.find(MMFCoeffs[5*dir+indxDiv]);
556 StdRegions::VarCoeffMap::const_iterator MFdir = varcoeffs.find(MMFCoeffs[5*dir+indxMag]);
567 boost::ignore_unused(r_bnd, matrixType);
575 boost::ignore_unused(r_bnd);
582 const std::vector<unsigned int > &nummodes,
583 const int nmodes_offset,
585 std::vector<LibUtilities::BasisType> &fromType)
587 boost::ignore_unused(data, nummodes, nmodes_offset,
594 const std::shared_ptr<Expansion> &EdgeExp,
599 boost::ignore_unused(edge, EdgeExp, Fx, Fy, outarray);
605 const std::shared_ptr<Expansion> &EdgeExp,
609 boost::ignore_unused(edge, EdgeExp, Fn, outarray);
615 const std::shared_ptr<Expansion> &FaceExp,
619 boost::ignore_unused(face, FaceExp, Fn, outarray);
630 boost::ignore_unused(dir, inarray, EdgeExp, coeffs, outarray);
637 boost::ignore_unused(vec);
644 boost::ignore_unused(trace);
652 boost::ignore_unused(dir, inarray, outarray);
659 boost::ignore_unused(trace, outarray);
661 "Method does not exist for this shape or library");
671 boost::ignore_unused(trace,TraceExp,inarray,outarray,orient);
673 "Method does not exist for this shape or library" );
679 boost::ignore_unused(edge, outarray);
681 "Method does not exist for this shape or library" );
687 const int nq0,
const int nq1)
689 boost::ignore_unused(orient,idmap,nq0,nq1);
691 "Method does not exist for this shape or library" );
696 boost::ignore_unused(
id);
697 ASSERTL0(
false,
"Cannot get trace normals for this expansion.");
704 boost::ignore_unused(
id);
705 ASSERTL0(
false,
"Cannot compute trace normal for this expansion.");
717 boost::ignore_unused(normal);
723 boost::ignore_unused(edge);
732 boost::ignore_unused(trace,primCoeffs,inoutmat);
742 boost::ignore_unused(traceid,primCoeffs,incoeffs, coeffs);
751 "m_elmtBndNormDirElmtLen normal not computed.");
760 boost::ignore_unused(dir,inarray,outarray);
#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 sign(a, b)
return the sign(b)*a
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
IndexMapValuesSharedPtr CreateIndexMap(const IndexMapKey &ikey)
SpatialDomains::GeometrySharedPtr m_geom
Array< OneD, NekDouble > v_GetMF(const int dir, const int shapedim, const StdRegions::VarCoeffMap &varcoeffs)
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)
void ComputeLaplacianMetric()
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)
virtual DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
virtual void v_SetCoeffsToOrientation(StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
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)
Array< OneD, NekDouble > v_GetMFMag(const int dir, const StdRegions::VarCoeffMap &varcoeffs)
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)
Array< OneD, NekDouble > v_GetMFDiv(const int dir, const StdRegions::VarCoeffMap &varcoeffs)
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 NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &vec)
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals(void)
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 ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
virtual void v_ReOrientTracePhysMap(const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1=-1)
virtual void v_MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_ComputeLaplacianMetric()
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
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)
virtual const NormalVector & v_GetTraceNormal(const int id) const
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
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
const LibUtilities::PointsKeyVector GetPointsKeys() const
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.
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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< 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.
@ eMovingRegular
Currently unused.
@ eDeformed
Geometry is curved or has non-constant factors.
std::shared_ptr< Geometry > GeometrySharedPtr
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
std::map< ConstFactorType, NekDouble > ConstFactorMap
The above copyright notice and this permission notice shall be included.
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
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 Vcopy(int n, const T *x, const int incx, T *y, const int incy)