Nektar++
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Nektar::LocalRegions::HexExp Class Reference

#include <HexExp.h>

Inheritance diagram for Nektar::LocalRegions::HexExp:
[legend]

Public Member Functions

 HexExp (const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, const SpatialDomains::HexGeomSharedPtr &geom)
 Constructor using BasisKey class for quadrature points and order definition. More...
 
 HexExp (const HexExp &T)
 Copy Constructor. More...
 
 ~HexExp ()
 Destructor. More...
 
- Public Member Functions inherited from Nektar::StdRegions::StdHexExp
 StdHexExp ()
 
 StdHexExp (const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc)
 
 StdHexExp (const StdHexExp &T)
 
 ~StdHexExp ()
 
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion3D
 StdExpansion3D ()
 
 StdExpansion3D (int numcoeffs, const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc)
 
 StdExpansion3D (const StdExpansion3D &T)
 
virtual ~StdExpansion3D ()
 
void PhysTensorDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray_d1, Array< OneD, NekDouble > &outarray_d2, Array< OneD, NekDouble > &outarray_d3)
 Calculate the 3D derivative in the local tensor/collapsed coordinate at the physical points. More...
 
void BwdTrans_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
 
void IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
 
int GetNedges () const
 return the number of edges in 3D expansion More...
 
int GetEdgeNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge. More...
 
void GetEdgeInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards)
 
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion
 StdExpansion ()
 Default Constructor. More...
 
 StdExpansion (const int numcoeffs, const int numbases, const LibUtilities::BasisKey &Ba=LibUtilities::NullBasisKey, const LibUtilities::BasisKey &Bb=LibUtilities::NullBasisKey, const LibUtilities::BasisKey &Bc=LibUtilities::NullBasisKey)
 Constructor. More...
 
 StdExpansion (const StdExpansion &T)
 Copy Constructor. More...
 
virtual ~StdExpansion ()
 Destructor. More...
 
int GetNumBases () const
 This function returns the number of 1D bases used in the expansion. More...
 
const Array< OneD, const LibUtilities::BasisSharedPtr > & GetBase () const
 This function gets the shared point to basis. More...
 
const LibUtilities::BasisSharedPtrGetBasis (int dir) const
 This function gets the shared point to basis in the dir direction. More...
 
int GetNcoeffs (void) const
 This function returns the total number of coefficients used in the expansion. More...
 
int GetTotPoints () const
 This function returns the total number of quadrature points used in the element. More...
 
LibUtilities::BasisType GetBasisType (const int dir) const
 This function returns the type of basis used in the dir direction. More...
 
int GetBasisNumModes (const int dir) const
 This function returns the number of expansion modes in the dir direction. More...
 
int EvalBasisNumModesMax (void) const
 This function returns the maximum number of expansion modes over all local directions. More...
 
LibUtilities::PointsType GetPointsType (const int dir) const
 This function returns the type of quadrature points used in the dir direction. More...
 
int GetNumPoints (const int dir) const
 This function returns the number of quadrature points in the dir direction. More...
 
const Array< OneD, const NekDouble > & GetPoints (const int dir) const
 This function returns a pointer to the array containing the quadrature points in dir direction. More...
 
int GetNverts () const
 This function returns the number of vertices of the expansion domain. More...
 
int GetTraceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th trace. More...
 
int GetTraceIntNcoeffs (const int i) const
 
int GetTraceNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th trace. More...
 
const LibUtilities::BasisKey GetTraceBasisKey (const int i, int k=-1) const
 This function returns the basis key belonging to the i-th trace. More...
 
LibUtilities::PointsKey GetTracePointsKey (const int i, int k=-1) const
 This function returns the basis key belonging to the i-th trace. More...
 
int NumBndryCoeffs (void) const
 
int NumDGBndryCoeffs (void) const
 
const LibUtilities::PointsKey GetNodalPointsKey () const
 This function returns the type of expansion Nodal point type if defined. More...
 
int GetNtraces () const
 Returns the number of trace elements connected to this element. More...
 
LibUtilities::ShapeType DetShapeType () const
 This function returns the shape of the expansion domain. More...
 
std::shared_ptr< StdExpansionGetStdExp (void) const
 
std::shared_ptr< StdExpansionGetLinStdExp (void) const
 
int GetShapeDimension () const
 
bool IsBoundaryInteriorExpansion ()
 
bool IsNodalNonTensorialExp ()
 
void BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Backward transformation from coefficient space to physical space. More...
 
void FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Forward transformation from physical space to coefficient space. More...
 
void FwdTransBndConstrained (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
NekDouble Integral (const Array< OneD, const NekDouble > &inarray)
 This function integrates the specified function over the domain. More...
 
void FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 This function fills the array outarray with the mode-th mode of the expansion. More...
 
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 expansion More...
 
void IProductWRTBase (const Array< OneD, const NekDouble > &base, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int coll_check)
 
void IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDirectionalDerivBase (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
int GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
void SetElmtId (const int id)
 Set the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
void GetCoords (Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2=NullNekDouble1DArray, Array< OneD, NekDouble > &coords_3=NullNekDouble1DArray)
 this function returns the physical coordinates of the quadrature points of the expansion More...
 
void GetCoord (const Array< OneD, const NekDouble > &Lcoord, Array< OneD, NekDouble > &coord)
 given the coordinates of a point of the element in the local collapsed coordinate system, this function calculates the physical coordinates of the point More...
 
DNekMatSharedPtr GetStdMatrix (const StdMatrixKey &mkey)
 
DNekBlkMatSharedPtr GetStdStaticCondMatrix (const StdMatrixKey &mkey)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble >> &Fvec, Array< OneD, NekDouble > &outarray)
 
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
void DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
int CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
NekDouble StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
 
int GetCoordim ()
 
void GetBoundaryMap (Array< OneD, unsigned int > &outarray)
 
void GetInteriorMap (Array< OneD, unsigned int > &outarray)
 
int GetVertexMap (const int localVertexId, bool useCoeffPacking=false)
 
void GetTraceToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
 
void GetTraceCoeffMap (const unsigned int traceid, Array< OneD, unsigned int > &maparray)
 
void GetElmtTraceToTraceMap (const unsigned int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
 
void GetTraceInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eForwards)
 
void GetTraceNumModes (const int tid, int &numModes0, int &numModes1, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
 
void MultiplyByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
DNekMatSharedPtr CreateGeneralMatrix (const StdMatrixKey &mkey)
 this function generates the mass matrix \(\mathbf{M}[i][j] = \int \phi_i(\mathbf{x}) \phi_j(\mathbf{x}) d\mathbf{x}\) More...
 
void GeneralMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
 
void ExponentialFilter (Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
 
void LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionDiffusionReactionMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
void HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
DNekMatSharedPtr GenMatrix (const StdMatrixKey &mkey)
 
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)
 
void PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void PhysDeriv_s (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
 
void PhysDeriv_n (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
 
void PhysDirectionalDeriv (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &outarray)
 
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 StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
NekDouble PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble PhysEvaluateBasis (const Array< OneD, const NekDouble > &coords, int mode)
 This function evaluates the basis function mode mode at a point coords of the domain. More...
 
void LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 Convert local cartesian coordinate xi into local collapsed coordinates eta. More...
 
void LocCollapsedToLocCoord (const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi)
 Convert local collapsed coordinates eta into local cartesian coordinate xi. More...
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
NekDouble Linf (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( L_\infty\) error \( |\epsilon|_\infty = \max |u - u_{exact}|\) where \( u_{exact}\) is given by the array sol. More...
 
NekDouble L2 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( L_2\) error, \( | \epsilon |_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 dx \right]^{1/2} d\xi_1 \) where \( u_{exact}\) is given by the array sol. More...
 
NekDouble H1 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( H^1\) error, \( | \epsilon |^1_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 + \nabla(u - u_{exact})\cdot\nabla(u - u_{exact})\cdot dx \right]^{1/2} d\xi_1 \) where \( u_{exact}\) is given by the array sol. More...
 
const LibUtilities::PointsKeyVector GetPointsKeys () const
 
DNekMatSharedPtr BuildInverseTransformationMatrix (const DNekScalMatSharedPtr &m_transformationmatrix)
 
void PhysInterpToSimplexEquiSpaced (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int npset=-1)
 This function performs an interpolation from the physical space points provided at input into an array of equispaced points which are not the collapsed coordinate. So for a tetrahedron you will only get a tetrahedral number of values. More...
 
void GetSimplexEquiSpacedConnectivity (Array< OneD, int > &conn, bool standard=true)
 This function provides the connectivity of local simplices (triangles or tets) to connect the equispaced data points provided by PhysInterpToSimplexEquiSpaced. More...
 
void EquiSpacedToCoeffs (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs a projection/interpolation from the equispaced points sometimes used in post-processing onto the coefficient space. More...
 
template<class T >
std::shared_ptr< T > as ()
 
void IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
 
void GenStdMatBwdDeriv (const int dir, DNekMatSharedPtr &mat)
 
- Public Member Functions inherited from Nektar::LocalRegions::Expansion3D
 Expansion3D (SpatialDomains::Geometry3DSharedPtr pGeom)
 
virtual ~Expansion3D ()
 
void SetTraceToGeomOrientation (Array< OneD, NekDouble > &inout)
 Align trace orientation with the geometry orientation. More...
 
void SetFaceToGeomOrientation (const int face, Array< OneD, NekDouble > &inout)
 Align face orientation with the geometry orientation. More...
 
void AddHDGHelmholtzFaceTerms (const NekDouble tau, const int edge, Array< OneD, NekDouble > &facePhys, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
 
void AddNormTraceInt (const int dir, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, Array< OneD, NekDouble >> &faceCoeffs, Array< OneD, NekDouble > &outarray)
 
void AddNormTraceInt (const int dir, Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs)
 
void AddFaceBoundaryInt (const int face, ExpansionSharedPtr &FaceExp, Array< OneD, NekDouble > &facePhys, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
 
SpatialDomains::Geometry3DSharedPtr GetGeom3D () const
 
void v_ReOrientTracePhysMap (const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1)
 
void v_NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble >> &Fvec, Array< OneD, NekDouble > &outarray)
 
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap (int eid)
 
Array< OneD, unsigned int > GetTraceInverseBoundaryMap (int fid, StdRegions::Orientation faceOrient=StdRegions::eNoOrientation, int P1=-1, int P2=-1)
 
void GetInverseBoundaryMaps (Array< OneD, unsigned int > &vmap, Array< OneD, Array< OneD, unsigned int >> &emap, Array< OneD, Array< OneD, unsigned int >> &fmap)
 
DNekScalMatSharedPtr CreateMatrix (const MatrixKey &mkey)
 
- Public Member Functions inherited from Nektar::LocalRegions::Expansion
 Expansion (SpatialDomains::GeometrySharedPtr pGeom)
 
 Expansion (const Expansion &pSrc)
 
virtual ~Expansion ()
 
void SetTraceExp (const int traceid, ExpansionSharedPtr &f)
 
ExpansionSharedPtr GetTraceExp (const int traceid)
 
DNekScalMatSharedPtr GetLocMatrix (const LocalRegions::MatrixKey &mkey)
 
DNekScalMatSharedPtr GetLocMatrix (const StdRegions::MatrixType mtype, const StdRegions::ConstFactorMap &factors=StdRegions::NullConstFactorMap, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
 
SpatialDomains::GeometrySharedPtr GetGeom () const
 
void Reset ()
 
IndexMapValuesSharedPtr CreateIndexMap (const IndexMapKey &ikey)
 
DNekScalBlkMatSharedPtr CreateStaticCondMatrix (const MatrixKey &mkey)
 
const SpatialDomains::GeomFactorsSharedPtrGetMetricInfo () const
 
DNekMatSharedPtr BuildTransformationMatrix (const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
 
DNekMatSharedPtr BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd)
 
void ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
 
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 AddEdgeNormBoundaryInt (const int edge, const std::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fn, 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)
 
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)
 
NekDouble VectorFlux (const Array< OneD, Array< OneD, NekDouble >> &vec)
 
void NormalTraceDerivFactors (Array< OneD, Array< OneD, NekDouble >> &factors, Array< OneD, Array< OneD, NekDouble >> &d0factors, Array< OneD, Array< OneD, NekDouble >> &d1factors)
 
IndexMapValuesSharedPtr GetIndexMap (const IndexMapKey &ikey)
 
void AlignVectorToCollapsedDir (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
 
ExpansionSharedPtr GetLeftAdjacentElementExp () const
 
ExpansionSharedPtr GetRightAdjacentElementExp () const
 
int GetLeftAdjacentElementTrace () const
 
int GetRightAdjacentElementTrace () const
 
void SetAdjacentElementExp (int traceid, ExpansionSharedPtr &e)
 
StdRegions::Orientation GetTraceOrient (int trace)
 
void SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void DivideByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Divided by the metric jacobi and quadrature weights. More...
 
void GetTraceQFactors (const int trace, Array< OneD, NekDouble > &outarray)
 Extract the metric factors to compute the contravariant fluxes along edge edge and stores them into outarray following the local edge orientation (i.e. anticlockwise convention). More...
 
void GetTracePhysVals (const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=StdRegions::eNoOrientation)
 
void GetTracePhysMap (const int edge, Array< OneD, int > &outarray)
 
void ReOrientTracePhysMap (const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1)
 
const NormalVectorGetTraceNormal (const int id)
 
void ComputeTraceNormal (const int id)
 
const Array< OneD, const NekDouble > & GetPhysNormals (void)
 
void SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
void SetUpPhysNormals (const int trace)
 
void AddRobinMassMatrix (const int traceid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
 
void TraceNormLen (const int traceid, NekDouble &h, NekDouble &p)
 
virtual void AddRobinTraceContribution (const int traceid, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs)
 
const Array< OneD, const NekDouble > & GetElmtBndNormDirElmtLen (const int nbnd) const
 
void StdDerivBaseOnTraceMat (Array< OneD, DNekMatSharedPtr > &DerivMat)
 

Protected Member Functions

virtual NekDouble v_Integral (const Array< OneD, const NekDouble > &inarray)
 Integrate the physical point list inarray over region. More...
 
virtual void v_PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
 Calculate the derivative of the physical points. More...
 
virtual void v_PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Calculate the derivative of the physical points in a single direction. More...
 
void v_PhysDirectionalDeriv (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &out)
 Physical derivative along a direction vector. More...
 
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 coefficients and store in (this)->_coeffs. More...
 
virtual void v_IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Calculate the inner product of inarray with respect to the elements basis. More...
 
virtual void v_IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
 Calculate the inner product of inarray with respect to the given basis B = base0 * base1 * base2. More...
 
virtual void v_IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Calculates the inner product \( I_{pqr} = (u, \partial_{x_i} \phi_{pqr}) \). More...
 
virtual void v_AlignVectorToCollapsedDir (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
 
void IProductWRTDerivBase_MatOp (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void v_IProductWRTDirectionalDerivBase (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDirectionalDerivBase_SumFac (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual NekDouble v_StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
 
virtual NekDouble v_PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
virtual void v_GetCoord (const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
 Retrieves the physical coordinates of a given set of reference coordinates. More...
 
virtual void v_GetCoords (Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
 
virtual LibUtilities::ShapeType v_DetShapeType () const
 Return the region shape using the enum-list of ShapeType. More...
 
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp (void) const
 
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp (void) const
 
virtual void v_ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
 
virtual bool v_GetFaceDGForwards (const int i) const
 
virtual void v_GetTracePhysMap (const int face, Array< OneD, int > &outarray)
 
void v_ComputeTraceNormal (const int face)
 
virtual void v_MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual void v_LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual void v_LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual void v_WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual void v_WeakDirectionalDerivMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual void v_MassLevelCurvatureMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual void v_HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
void v_GeneralMatrixOp_MatOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual void v_ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
 
virtual DNekMatSharedPtr v_GenMatrix (const StdRegions::StdMatrixKey &mkey)
 
virtual DNekMatSharedPtr v_CreateStdMatrix (const StdRegions::StdMatrixKey &mkey)
 
virtual DNekScalMatSharedPtr v_GetLocMatrix (const MatrixKey &mkey)
 
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const MatrixKey &mkey)
 
void v_DropLocStaticCondMatrix (const MatrixKey &mkey)
 
virtual void v_ComputeLaplacianMetric ()
 
- Protected Member Functions inherited from Nektar::StdRegions::StdHexExp
virtual void v_StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
 
virtual void v_StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_BwdTrans_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
 
virtual void v_IProductWRTBase_MatOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
 
virtual void v_IProductWRTDerivBase_MatOp (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 
virtual void v_LocCollapsedToLocCoord (const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi)
 
virtual void v_FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 
NekDouble v_PhysEvaluateBasis (const Array< OneD, const NekDouble > &coords, int mode) final
 
virtual int v_GetNverts () const
 
virtual int v_GetNedges () const
 
virtual int v_GetNtraces () const
 
virtual int v_NumBndryCoeffs () const
 
virtual int v_NumDGBndryCoeffs () const
 
virtual int v_GetTraceNcoeffs (const int i) const
 
virtual int v_GetTotalTraceIntNcoeffs () const
 
virtual int v_GetTraceIntNcoeffs (const int i) const
 
virtual int v_GetTraceNumPoints (const int i) const
 
virtual LibUtilities::PointsKey v_GetTracePointsKey (const int i, const int j) const
 
virtual int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
virtual const LibUtilities::BasisKey v_GetTraceBasisKey (const int i, const int k) const
 
virtual bool v_IsBoundaryInteriorExpansion ()
 
virtual void v_GetTraceNumModes (const int fid, int &numModes0, int &numModes1, Orientation faceOrient=eDir1FwdDir1_Dir2FwdDir2)
 
virtual int v_GetEdgeNcoeffs (const int i) const
 
virtual int v_GetVertexMap (int localVertexId, bool useCoeffPacking=false)
 
virtual void v_GetInteriorMap (Array< OneD, unsigned int > &outarray)
 
virtual void v_GetBoundaryMap (Array< OneD, unsigned int > &outarray)
 
virtual void v_GetTraceCoeffMap (const unsigned int fid, Array< OneD, unsigned int > &maparray)
 
virtual void v_GetElmtTraceToTraceMap (const unsigned int fid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation faceOrient, int P, int Q)
 
virtual void v_GetEdgeInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
 
virtual void v_GetTraceInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
 
virtual void v_GetSimplexEquiSpacedConnectivity (Array< OneD, int > &conn, bool standard=true)
 
virtual void v_MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_ExponentialFilter (Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion3D
virtual NekDouble v_PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
 
virtual void v_LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual void v_HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual void v_GetTraceToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient, int P, int Q)
 
virtual void v_GenStdMatBwdDeriv (const int dir, DNekMatSharedPtr &mat)
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion
DNekMatSharedPtr CreateStdMatrix (const StdMatrixKey &mkey)
 
DNekBlkMatSharedPtr CreateStdStaticCondMatrix (const StdMatrixKey &mkey)
 Create the static condensation of a matrix when using a boundary interior decomposition. More...
 
void BwdTrans_MatOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDirectionalDerivBase_SumFac (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GeneralMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
 
void LaplacianMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp_MatFree (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionDiffusionReactionMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
void HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void HelmholtzMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
 
template<int DIR>
NekDouble BaryEvaluate (const NekDouble &coord, const NekDouble *physvals)
 This function performs the barycentric interpolation of the polynomial stored in coord at a point physvals using barycentric interpolation weights in direction. More...
 
template<int DIR>
NekDouble BaryEvaluateBasis (const NekDouble &coord, const int &mode)
 
- Protected Member Functions inherited from Nektar::LocalRegions::Expansion3D
virtual void v_DGDeriv (const int dir, const Array< OneD, const NekDouble > &incoeffs, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, Array< OneD, NekDouble >> &faceCoeffs, Array< OneD, NekDouble > &out_d)
 Evaluate coefficients of weak deriviative in the direction dir given the input coefficicents incoeffs and the imposed boundary values in EdgeExp (which will have its phys space updated). More...
 
virtual void v_AddFaceNormBoundaryInt (const int face, const ExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
 
virtual void v_AddRobinMassMatrix (const int face, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
 
virtual StdRegions::Orientation v_GetTraceOrient (int face)
 
virtual void v_GetTracePhysVals (const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
 Extract the physical values along face face from inarray into outarray following the local face orientation and point distribution defined by defined in FaceExp. More...
 
virtual void v_GenTraceExp (const int traceid, ExpansionSharedPtr &exp)
 
void GetPhysFaceVarCoeffsFromElement (const int face, ExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &varcoeff, Array< OneD, NekDouble > &outarray)
 
virtual Array< OneD, NekDoublev_GetnFacecdotMF (const int dir, const int face, ExpansionSharedPtr &FaceExp_f, const Array< OneD, const Array< OneD, NekDouble >> &normals, const StdRegions::VarCoeffMap &varcoeffs)
 
virtual DNekMatSharedPtr v_BuildTransformationMatrix (const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
 
virtual DNekMatSharedPtr v_BuildInverseTransformationMatrix (const DNekScalMatSharedPtr &transformationmatrix)
 Build inverse and inverse transposed transformation matrix: \(\mathbf{R^{-1}}\) and \(\mathbf{R^{-T}}\). More...
 
virtual DNekMatSharedPtr v_BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd)
 
virtual void v_TraceNormLen (const int traceid, NekDouble &h, NekDouble &p)
 
- Protected Member Functions inherited from Nektar::LocalRegions::Expansion
void ComputeLaplacianMetric ()
 
void ComputeQuadratureMetric ()
 
void ComputeGmatcdotMF (const Array< TwoD, const NekDouble > &df, const Array< OneD, const NekDouble > &direction, Array< OneD, Array< OneD, NekDouble >> &dfdir)
 
virtual void v_MultiplyByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_DivideByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
Array< OneD, NekDoublev_GetMF (const int dir, const int shapedim, const StdRegions::VarCoeffMap &varcoeffs)
 
Array< OneD, NekDoublev_GetMFDiv (const int dir, const StdRegions::VarCoeffMap &varcoeffs)
 
Array< OneD, NekDoublev_GetMFMag (const int dir, const StdRegions::VarCoeffMap &varcoeffs)
 
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)
 
virtual void v_AddEdgeNormBoundaryInt (const int edge, const std::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
 
virtual void v_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 void v_SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_GetTraceQFactors (const int trace, Array< OneD, NekDouble > &outarray)
 
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals (void)
 
virtual void v_SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
virtual void v_SetUpPhysNormals (const int id)
 
virtual void v_AddRobinTraceContribution (const int traceid, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs)
 

Private Member Functions

 HexExp ()
 
virtual void v_LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
 
virtual void v_NormalTraceDerivFactors (Array< OneD, Array< OneD, NekDouble >> &factors, Array< OneD, Array< OneD, NekDouble >> &d0factors, Array< OneD, Array< OneD, NekDouble >> &d1factors)
 : This method gets all of the factors which are required as part of the Gradient Jump Penalty stabilisation and involves the product of the normal and geometric factors along the element trace. More...
 

Private Attributes

LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLessm_matrixManager
 
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLessm_staticCondMatrixManager
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::StdRegions::StdExpansion
Array< OneD, LibUtilities::BasisSharedPtrm_base
 
int m_elmt_id
 
int m_ncoeffs
 
LibUtilities::NekManager< StdMatrixKey, DNekMat, StdMatrixKey::opLessm_stdMatrixManager
 
LibUtilities::NekManager< StdMatrixKey, DNekBlkMat, StdMatrixKey::opLessm_stdStaticCondMatrixManager
 
- Protected Attributes inherited from Nektar::LocalRegions::Expansion3D
std::map< int, NormalVectorm_faceNormals
 
- Protected Attributes inherited from Nektar::LocalRegions::Expansion
LibUtilities::NekManager< IndexMapKey, IndexMapValues, IndexMapKey::opLessm_indexMapManager
 
std::map< int, ExpansionWeakPtrm_traceExp
 
SpatialDomains::GeometrySharedPtr m_geom
 
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
 
MetricMap m_metrics
 
std::map< int, NormalVectorm_traceNormals
 
ExpansionWeakPtr m_elementLeft
 
ExpansionWeakPtr m_elementRight
 
int m_elementTraceLeft = -1
 
int m_elementTraceRight = -1
 
std::map< int, Array< OneD, NekDouble > > m_elmtBndNormDirElmtLen
 the element length in each element boundary(Vertex, edge or face) normal direction calculated based on the local m_metricinfo times the standard element length (which is 2.0) More...
 

Detailed Description

Defines a hexahedral local expansion.

Definition at line 61 of file HexExp.h.

Constructor & Destructor Documentation

◆ HexExp() [1/3]

Nektar::LocalRegions::HexExp::HexExp ( const LibUtilities::BasisKey Ba,
const LibUtilities::BasisKey Bb,
const LibUtilities::BasisKey Bc,
const SpatialDomains::HexGeomSharedPtr geom 
)

Constructor using BasisKey class for quadrature points and order definition.

Parameters
BaBasis key for first coordinate.
BbBasis key for second coordinate.
BcBasis key for third coordinate.

Definition at line 59 of file HexExp.cpp.

63  : StdExpansion(Ba.GetNumModes() * Bb.GetNumModes() * Bc.GetNumModes(), 3,
64  Ba, Bb, Bc),
65  StdExpansion3D(Ba.GetNumModes() * Bb.GetNumModes() * Bc.GetNumModes(), Ba,
66  Bb, Bc),
67  StdHexExp(Ba, Bb, Bc), Expansion(geom), Expansion3D(geom),
69  std::bind(&Expansion3D::CreateMatrix, this, std::placeholders::_1),
70  std::string("HexExpMatrix")),
72  this, std::placeholders::_1),
73  std::string("HexExpStaticCondMatrix"))
74 {
75 }
Expansion3D(SpatialDomains::Geometry3DSharedPtr pGeom)
Definition: Expansion3D.h:61
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: Expansion.cpp:272
Expansion(SpatialDomains::GeometrySharedPtr pGeom)
Definition: Expansion.cpp:47
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: HexExp.h:249
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: HexExp.h:251
StdExpansion()
Default Constructor.

◆ HexExp() [2/3]

Nektar::LocalRegions::HexExp::HexExp ( const HexExp T)

Copy Constructor.

Parameters
THexExp to copy.

Definition at line 82 of file HexExp.cpp.

84  Expansion3D(T), m_matrixManager(T.m_matrixManager),
85  m_staticCondMatrixManager(T.m_staticCondMatrixManager)
86 {
87 }

◆ ~HexExp()

Nektar::LocalRegions::HexExp::~HexExp ( )

Destructor.

Definition at line 92 of file HexExp.cpp.

93 {
94 }

◆ HexExp() [3/3]

Nektar::LocalRegions::HexExp::HexExp ( )
private

Member Function Documentation

◆ IProductWRTDerivBase_MatOp()

void Nektar::LocalRegions::HexExp::IProductWRTDerivBase_MatOp ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protected

Definition at line 517 of file HexExp.cpp.

520 {
521  int nq = GetTotPoints();
523 
524  switch (dir)
525  {
526  case 0:
527  {
529  }
530  break;
531  case 1:
532  {
534  }
535  break;
536  case 2:
537  {
539  }
540  break;
541  default:
542  {
543  ASSERTL1(false, "input dir is out of range");
544  }
545  break;
546  }
547 
548  MatrixKey iprodmatkey(mtype, DetShapeType(), *this);
549  DNekScalMatSharedPtr iprodmat = m_matrixManager[iprodmatkey];
550 
551  Blas::Dgemv('N', m_ncoeffs, nq, iprodmat->Scale(),
552  (iprodmat->GetOwnedMatrix())->GetPtr().get(), m_ncoeffs,
553  inarray.get(), 1, 0.0, outarray.get(), 1);
554 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:249
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:140
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:375
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].
Definition: Blas.hpp:246
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr

References ASSERTL1, Nektar::StdRegions::StdExpansion::DetShapeType(), Blas::Dgemv(), Nektar::StdRegions::eIProductWRTDerivBase0, Nektar::StdRegions::eIProductWRTDerivBase1, Nektar::StdRegions::eIProductWRTDerivBase2, Nektar::StdRegions::StdExpansion::GetTotPoints(), m_matrixManager, and Nektar::StdRegions::StdExpansion::m_ncoeffs.

◆ IProductWRTDerivBase_SumFac()

void Nektar::LocalRegions::HexExp::IProductWRTDerivBase_SumFac ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protected

Calculates the inner product \( I_{pqr} = (u, \partial_{x_i} \phi_{pqr}) \).

The derivative of the basis functions is performed using the chain rule in order to incorporate the geometric factors. Assuming that the basis functions are a tensor product \(\phi_{pqr}(\xi_1,\xi_2,\xi_3) = \phi_1(\xi_1)\phi_2(\xi_2)\phi_3(\xi_3)\), in the hexahedral element, this is straightforward and yields the result

\[ I_{pqr} = \sum_{k=1}^3 \left(u, \frac{\partial u}{\partial \xi_k} \frac{\partial \xi_k}{\partial x_i}\right) \]

Parameters
dirDirection in which to take the derivative.
inarrayThe function \( u \).
outarrayValue of the inner product.

Definition at line 436 of file HexExp.cpp.

439 {
440  ASSERTL1((dir == 0) || (dir == 1) || (dir == 2), "Invalid direction.");
441 
442  const int nq0 = m_base[0]->GetNumPoints();
443  const int nq1 = m_base[1]->GetNumPoints();
444  const int nq2 = m_base[2]->GetNumPoints();
445  const int nq = nq0 * nq1 * nq2;
446  const int nm0 = m_base[0]->GetNumModes();
447  const int nm1 = m_base[1]->GetNumModes();
448 
449  Array<OneD, NekDouble> alloc(4 * nq + m_ncoeffs + nm0 * nq2 * (nq1 + nm1));
450  Array<OneD, NekDouble> tmp1(alloc); // Quad metric
451  Array<OneD, NekDouble> tmp2(alloc + nq); // Dir1 metric
452  Array<OneD, NekDouble> tmp3(alloc + 2 * nq); // Dir2 metric
453  Array<OneD, NekDouble> tmp4(alloc + 3 * nq); // Dir3 metric
454  Array<OneD, NekDouble> tmp5(alloc + 4 * nq); // iprod tmp
455  Array<OneD, NekDouble> wsp(tmp5 + m_ncoeffs); // Wsp
456 
457  MultiplyByQuadratureMetric(inarray, tmp1);
458 
459  Array<OneD, Array<OneD, NekDouble>> tmp2D{3};
460  tmp2D[0] = tmp2;
461  tmp2D[1] = tmp3;
462  tmp2D[2] = tmp4;
463 
464  HexExp::v_AlignVectorToCollapsedDir(dir, tmp1, tmp2D);
465 
466  IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(), m_base[1]->GetBdata(),
467  m_base[2]->GetBdata(), tmp2, outarray, wsp,
468  false, true, true);
469 
470  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(), m_base[1]->GetDbdata(),
471  m_base[2]->GetBdata(), tmp3, tmp5, wsp, true,
472  false, true);
473  Vmath::Vadd(m_ncoeffs, tmp5, 1, outarray, 1, outarray, 1);
474 
475  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(), m_base[1]->GetBdata(),
476  m_base[2]->GetDbdata(), tmp4, tmp5, wsp, true,
477  true, false);
478  Vmath::Vadd(m_ncoeffs, tmp5, 1, outarray, 1, outarray, 1);
479 }
virtual void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: HexExp.cpp:481
void IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:731
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:359

References ASSERTL1, Nektar::StdRegions::StdExpansion3D::IProductWRTBase_SumFacKernel(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, Nektar::StdRegions::StdExpansion::MultiplyByQuadratureMetric(), v_AlignVectorToCollapsedDir(), and Vmath::Vadd().

Referenced by v_IProductWRTDerivBase().

◆ IProductWRTDirectionalDerivBase_SumFac()

void Nektar::LocalRegions::HexExp::IProductWRTDirectionalDerivBase_SumFac ( const Array< OneD, const NekDouble > &  direction,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protected
Parameters
dirVector direction in which to take the derivative.
inarrayThe function \( u \).
outarrayValue of the inner product.

Definition at line 562 of file HexExp.cpp.

566 {
567  int shapedim = 3;
568  const int nq0 = m_base[0]->GetNumPoints();
569  const int nq1 = m_base[1]->GetNumPoints();
570  const int nq2 = m_base[2]->GetNumPoints();
571  const int nq = nq0 * nq1 * nq2;
572  const int nm0 = m_base[0]->GetNumModes();
573  const int nm1 = m_base[1]->GetNumModes();
574 
575  const Array<TwoD, const NekDouble> &df =
576  m_metricinfo->GetDerivFactors(GetPointsKeys());
577 
578  Array<OneD, NekDouble> alloc(4 * nq + m_ncoeffs + nm0 * nq2 * (nq1 + nm1));
579  Array<OneD, NekDouble> tmp1(alloc); // Quad metric
580  Array<OneD, NekDouble> tmp2(alloc + nq); // Dir1 metric
581  Array<OneD, NekDouble> tmp3(alloc + 2 * nq); // Dir2 metric
582  Array<OneD, NekDouble> tmp4(alloc + 3 * nq); // Dir3 metric
583  Array<OneD, NekDouble> tmp5(alloc + 4 * nq); // iprod tmp
584  Array<OneD, NekDouble> wsp(tmp5 + m_ncoeffs); // Wsp
585 
586  MultiplyByQuadratureMetric(inarray, tmp1);
587 
588  Array<OneD, Array<OneD, NekDouble>> dfdir(shapedim);
589  Expansion::ComputeGmatcdotMF(df, direction, dfdir);
590 
591  Vmath::Vmul(nq, &dfdir[0][0], 1, tmp1.get(), 1, tmp2.get(), 1);
592  Vmath::Vmul(nq, &dfdir[1][0], 1, tmp1.get(), 1, tmp3.get(), 1);
593  Vmath::Vmul(nq, &dfdir[2][0], 1, tmp1.get(), 1, tmp4.get(), 1);
594 
595  IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(), m_base[1]->GetBdata(),
596  m_base[2]->GetBdata(), tmp2, outarray, wsp,
597  false, true, true);
598 
599  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(), m_base[1]->GetDbdata(),
600  m_base[2]->GetBdata(), tmp3, tmp5, wsp, true,
601  false, true);
602 
603  Vmath::Vadd(m_ncoeffs, tmp5, 1, outarray, 1, outarray, 1);
604 
605  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(), m_base[1]->GetBdata(),
606  m_base[2]->GetDbdata(), tmp4, tmp5, wsp, true,
607  true, false);
608 
609  Vmath::Vadd(m_ncoeffs, tmp5, 1, outarray, 1, outarray, 1);
610 }
void ComputeGmatcdotMF(const Array< TwoD, const NekDouble > &df, const Array< OneD, const NekDouble > &direction, Array< OneD, Array< OneD, NekDouble >> &dfdir)
Definition: Expansion.cpp:597
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:273
const LibUtilities::PointsKeyVector GetPointsKeys() const
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.
Definition: Vmath.cpp:209

References Nektar::LocalRegions::Expansion::ComputeGmatcdotMF(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion3D::IProductWRTBase_SumFacKernel(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_metricinfo, Nektar::StdRegions::StdExpansion::m_ncoeffs, Nektar::StdRegions::StdExpansion::MultiplyByQuadratureMetric(), Vmath::Vadd(), and Vmath::Vmul().

Referenced by v_IProductWRTDirectionalDerivBase().

◆ v_AlignVectorToCollapsedDir()

void Nektar::LocalRegions::HexExp::v_AlignVectorToCollapsedDir ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, Array< OneD, NekDouble >> &  outarray 
)
protectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 481 of file HexExp.cpp.

484 {
485  ASSERTL1((dir == 0) || (dir == 1) || (dir == 2), "Invalid direction.");
486 
487  const int nq0 = m_base[0]->GetNumPoints();
488  const int nq1 = m_base[1]->GetNumPoints();
489  const int nq2 = m_base[2]->GetNumPoints();
490  const int nq = nq0 * nq1 * nq2;
491 
492  const Array<TwoD, const NekDouble> &df =
493  m_metricinfo->GetDerivFactors(GetPointsKeys());
494 
495  Array<OneD, NekDouble> tmp1(nq); // Quad metric
496 
497  Array<OneD, NekDouble> tmp2 = outarray[0]; // Dir1 metric
498  Array<OneD, NekDouble> tmp3 = outarray[1]; // Dir2 metric
499  Array<OneD, NekDouble> tmp4 = outarray[2];
500 
501  Vmath::Vcopy(nq, inarray, 1, tmp1, 1); // Dir3 metric
502 
503  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
504  {
505  Vmath::Vmul(nq, &df[3 * dir][0], 1, tmp1.get(), 1, tmp2.get(), 1);
506  Vmath::Vmul(nq, &df[3 * dir + 1][0], 1, tmp1.get(), 1, tmp3.get(), 1);
507  Vmath::Vmul(nq, &df[3 * dir + 2][0], 1, tmp1.get(), 1, tmp4.get(), 1);
508  }
509  else
510  {
511  Vmath::Smul(nq, df[3 * dir][0], tmp1.get(), 1, tmp2.get(), 1);
512  Vmath::Smul(nq, df[3 * dir + 1][0], tmp1.get(), 1, tmp3.get(), 1);
513  Vmath::Smul(nq, df[3 * dir + 2][0], tmp1.get(), 1, tmp4.get(), 1);
514  }
515 }
@ eDeformed
Geometry is curved or has non-constant factors.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.cpp:248
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1255

References ASSERTL1, Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_metricinfo, Vmath::Smul(), Vmath::Vcopy(), and Vmath::Vmul().

Referenced by IProductWRTDerivBase_SumFac().

◆ v_ComputeLaplacianMetric()

void Nektar::LocalRegions::HexExp::v_ComputeLaplacianMetric ( )
protectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1521 of file HexExp.cpp.

1522 {
1523  if (m_metrics.count(eMetricQuadrature) == 0)
1524  {
1526  }
1527 
1528  const SpatialDomains::GeomType type = m_metricinfo->GetGtype();
1529  const unsigned int nqtot = GetTotPoints();
1530  const unsigned int dim = 3;
1531  const MetricType m[3][3] = {
1535 
1536  for (unsigned int i = 0; i < dim; ++i)
1537  {
1538  for (unsigned int j = i; j < dim; ++j)
1539  {
1540  m_metrics[m[i][j]] = Array<OneD, NekDouble>(nqtot);
1541  const Array<TwoD, const NekDouble> &gmat =
1542  m_metricinfo->GetGmat(GetPointsKeys());
1543  if (type == SpatialDomains::eDeformed)
1544  {
1545  Vmath::Vcopy(nqtot, &gmat[i * dim + j][0], 1,
1546  &m_metrics[m[i][j]][0], 1);
1547  }
1548  else
1549  {
1550  Vmath::Fill(nqtot, gmat[i * dim + j][0], &m_metrics[m[i][j]][0],
1551  1);
1552  }
1553  MultiplyByQuadratureMetric(m_metrics[m[i][j]], m_metrics[m[i][j]]);
1554  }
1555  }
1556 }
GeomType
Indicates the type of element geometry.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:45

References Nektar::LocalRegions::Expansion::ComputeQuadratureMetric(), Nektar::SpatialDomains::eDeformed, Nektar::LocalRegions::eMetricLaplacian00, Nektar::LocalRegions::eMetricLaplacian01, Nektar::LocalRegions::eMetricLaplacian02, Nektar::LocalRegions::eMetricLaplacian11, Nektar::LocalRegions::eMetricLaplacian12, Nektar::LocalRegions::eMetricLaplacian22, Nektar::LocalRegions::eMetricQuadrature, Vmath::Fill(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::LocalRegions::Expansion::m_metricinfo, Nektar::LocalRegions::Expansion::m_metrics, Nektar::StdRegions::StdExpansion::MultiplyByQuadratureMetric(), and Vmath::Vcopy().

◆ v_ComputeTraceNormal()

void Nektar::LocalRegions::HexExp::v_ComputeTraceNormal ( const int  face)
protectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 928 of file HexExp.cpp.

929 {
930  int i;
931  const SpatialDomains::GeomFactorsSharedPtr &geomFactors =
932  GetGeom()->GetMetricInfo();
933  SpatialDomains::GeomType type = geomFactors->GetGtype();
934 
936  for (i = 0; i < ptsKeys.size(); ++i)
937  {
938  // Need at least 2 points for computing normals
939  if (ptsKeys[i].GetNumPoints() == 1)
940  {
941  LibUtilities::PointsKey pKey(2, ptsKeys[i].GetPointsType());
942  ptsKeys[i] = pKey;
943  }
944  }
945 
946  const Array<TwoD, const NekDouble> &df =
947  geomFactors->GetDerivFactors(ptsKeys);
948  const Array<OneD, const NekDouble> &jac = geomFactors->GetJac(ptsKeys);
949 
950  LibUtilities::BasisKey tobasis0 = GetTraceBasisKey(face, 0);
951  LibUtilities::BasisKey tobasis1 = GetTraceBasisKey(face, 1);
952 
953  // Number of quadrature points in face expansion.
954  int nq_face = tobasis0.GetNumPoints() * tobasis1.GetNumPoints();
955 
956  int vCoordDim = GetCoordim();
957 
958  m_traceNormals[face] = Array<OneD, Array<OneD, NekDouble>>(vCoordDim);
959  Array<OneD, Array<OneD, NekDouble>> &normal = m_traceNormals[face];
960  for (i = 0; i < vCoordDim; ++i)
961  {
962  normal[i] = Array<OneD, NekDouble>(nq_face);
963  }
964 
965  size_t nqb = nq_face;
966  size_t nbnd = face;
967  m_elmtBndNormDirElmtLen[nbnd] = Array<OneD, NekDouble>{nqb, 0.0};
968  Array<OneD, NekDouble> &length = m_elmtBndNormDirElmtLen[nbnd];
969 
970  // Regular geometry case
971  if ((type == SpatialDomains::eRegular) ||
973  {
974  NekDouble fac;
975  // Set up normals
976  switch (face)
977  {
978  case 0:
979  for (i = 0; i < vCoordDim; ++i)
980  {
981  normal[i][0] = -df[3 * i + 2][0];
982  }
983  break;
984  case 1:
985  for (i = 0; i < vCoordDim; ++i)
986  {
987  normal[i][0] = -df[3 * i + 1][0];
988  }
989  break;
990  case 2:
991  for (i = 0; i < vCoordDim; ++i)
992  {
993  normal[i][0] = df[3 * i][0];
994  }
995  break;
996  case 3:
997  for (i = 0; i < vCoordDim; ++i)
998  {
999  normal[i][0] = df[3 * i + 1][0];
1000  }
1001  break;
1002  case 4:
1003  for (i = 0; i < vCoordDim; ++i)
1004  {
1005  normal[i][0] = -df[3 * i][0];
1006  }
1007  break;
1008  case 5:
1009  for (i = 0; i < vCoordDim; ++i)
1010  {
1011  normal[i][0] = df[3 * i + 2][0];
1012  }
1013  break;
1014  default:
1015  ASSERTL0(false, "face is out of range (edge < 5)");
1016  }
1017 
1018  // normalise
1019  fac = 0.0;
1020  for (i = 0; i < vCoordDim; ++i)
1021  {
1022  fac += normal[i][0] * normal[i][0];
1023  }
1024  fac = 1.0 / sqrt(fac);
1025 
1026  Vmath::Fill(nqb, fac, length, 1);
1027  for (i = 0; i < vCoordDim; ++i)
1028  {
1029  Vmath::Fill(nq_face, fac * normal[i][0], normal[i], 1);
1030  }
1031  }
1032  else // Set up deformed normals
1033  {
1034  int j, k;
1035 
1036  int nqe0 = ptsKeys[0].GetNumPoints();
1037  int nqe1 = ptsKeys[0].GetNumPoints();
1038  int nqe2 = ptsKeys[0].GetNumPoints();
1039  int nqe01 = nqe0 * nqe1;
1040  int nqe02 = nqe0 * nqe2;
1041  int nqe12 = nqe1 * nqe2;
1042 
1043  int nqe;
1044  if (face == 0 || face == 5)
1045  {
1046  nqe = nqe01;
1047  }
1048  else if (face == 1 || face == 3)
1049  {
1050  nqe = nqe02;
1051  }
1052  else
1053  {
1054  nqe = nqe12;
1055  }
1056 
1057  LibUtilities::PointsKey points0;
1058  LibUtilities::PointsKey points1;
1059 
1060  Array<OneD, NekDouble> faceJac(nqe);
1061  Array<OneD, NekDouble> normals(vCoordDim * nqe, 0.0);
1062 
1063  // Extract Jacobian along face and recover local
1064  // derivates (dx/dr) for polynomial interpolation by
1065  // multiplying m_gmat by jacobian
1066  switch (face)
1067  {
1068  case 0:
1069  for (j = 0; j < nqe; ++j)
1070  {
1071  normals[j] = -df[2][j] * jac[j];
1072  normals[nqe + j] = -df[5][j] * jac[j];
1073  normals[2 * nqe + j] = -df[8][j] * jac[j];
1074  faceJac[j] = jac[j];
1075  }
1076 
1077  points0 = ptsKeys[0];
1078  points1 = ptsKeys[1];
1079  break;
1080  case 1:
1081  for (j = 0; j < nqe0; ++j)
1082  {
1083  for (k = 0; k < nqe2; ++k)
1084  {
1085  int idx = j + nqe01 * k;
1086  normals[j + k * nqe0] = -df[1][idx] * jac[idx];
1087  normals[nqe + j + k * nqe0] = -df[4][idx] * jac[idx];
1088  normals[2 * nqe + j + k * nqe0] =
1089  -df[7][idx] * jac[idx];
1090  faceJac[j + k * nqe0] = jac[idx];
1091  }
1092  }
1093  points0 = ptsKeys[0];
1094  points1 = ptsKeys[2];
1095  break;
1096  case 2:
1097  for (j = 0; j < nqe1; ++j)
1098  {
1099  for (k = 0; k < nqe2; ++k)
1100  {
1101  int idx = nqe0 - 1 + nqe0 * j + nqe01 * k;
1102  normals[j + k * nqe1] = df[0][idx] * jac[idx];
1103  normals[nqe + j + k * nqe1] = df[3][idx] * jac[idx];
1104  normals[2 * nqe + j + k * nqe1] = df[6][idx] * jac[idx];
1105  faceJac[j + k * nqe1] = jac[idx];
1106  }
1107  }
1108  points0 = ptsKeys[1];
1109  points1 = ptsKeys[2];
1110  break;
1111  case 3:
1112  for (j = 0; j < nqe0; ++j)
1113  {
1114  for (k = 0; k < nqe2; ++k)
1115  {
1116  int idx = nqe0 * (nqe1 - 1) + j + nqe01 * k;
1117  normals[j + k * nqe0] = df[1][idx] * jac[idx];
1118  normals[nqe + j + k * nqe0] = df[4][idx] * jac[idx];
1119  normals[2 * nqe + j + k * nqe0] = df[7][idx] * jac[idx];
1120  faceJac[j + k * nqe0] = jac[idx];
1121  }
1122  }
1123  points0 = ptsKeys[0];
1124  points1 = ptsKeys[2];
1125  break;
1126  case 4:
1127  for (j = 0; j < nqe1; ++j)
1128  {
1129  for (k = 0; k < nqe2; ++k)
1130  {
1131  int idx = j * nqe0 + nqe01 * k;
1132  normals[j + k * nqe1] = -df[0][idx] * jac[idx];
1133  normals[nqe + j + k * nqe1] = -df[3][idx] * jac[idx];
1134  normals[2 * nqe + j + k * nqe1] =
1135  -df[6][idx] * jac[idx];
1136  faceJac[j + k * nqe1] = jac[idx];
1137  }
1138  }
1139  points0 = ptsKeys[1];
1140  points1 = ptsKeys[2];
1141  break;
1142  case 5:
1143  for (j = 0; j < nqe01; ++j)
1144  {
1145  int idx = j + nqe01 * (nqe2 - 1);
1146  normals[j] = df[2][idx] * jac[idx];
1147  normals[nqe + j] = df[5][idx] * jac[idx];
1148  normals[2 * nqe + j] = df[8][idx] * jac[idx];
1149  faceJac[j] = jac[idx];
1150  }
1151  points0 = ptsKeys[0];
1152  points1 = ptsKeys[1];
1153  break;
1154  default:
1155  ASSERTL0(false, "face is out of range (face < 5)");
1156  }
1157 
1158  Array<OneD, NekDouble> work(nq_face, 0.0);
1159  // Interpolate Jacobian and invert
1160  LibUtilities::Interp2D(points0, points1, faceJac,
1161  tobasis0.GetPointsKey(), tobasis1.GetPointsKey(),
1162  work);
1163 
1164  Vmath::Sdiv(nq_face, 1.0, &work[0], 1, &work[0], 1);
1165 
1166  // interpolate
1167  for (i = 0; i < GetCoordim(); ++i)
1168  {
1169  LibUtilities::Interp2D(points0, points1, &normals[i * nqe],
1170  tobasis0.GetPointsKey(),
1171  tobasis1.GetPointsKey(), &normal[i][0]);
1172  Vmath::Vmul(nq_face, work, 1, normal[i], 1, normal[i], 1);
1173  }
1174 
1175  // normalise normal vectors
1176  Vmath::Zero(nq_face, work, 1);
1177  for (i = 0; i < GetCoordim(); ++i)
1178  {
1179  Vmath::Vvtvp(nq_face, normal[i], 1, normal[i], 1, work, 1, work, 1);
1180  }
1181 
1182  Vmath::Vsqrt(nq_face, work, 1, work, 1);
1183  Vmath::Sdiv(nq_face, 1.0, work, 1, work, 1);
1184 
1185  Vmath::Vcopy(nqb, work, 1, length, 1);
1186 
1187  for (i = 0; i < GetCoordim(); ++i)
1188  {
1189  Vmath::Vmul(nq_face, normal[i], 1, work, 1, normal[i], 1);
1190  }
1191  }
1192 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215
std::map< int, NormalVector > m_traceNormals
Definition: Expansion.h:275
std::map< int, Array< OneD, NekDouble > > m_elmtBndNormDirElmtLen
the element length in each element boundary(Vertex, edge or face) normal direction calculated based o...
Definition: Expansion.h:285
SpatialDomains::GeometrySharedPtr GetGeom() const
Definition: Expansion.cpp:166
const LibUtilities::BasisKey GetTraceBasisKey(const int i, int k=-1) const
This function returns the basis key belonging to the i-th trace.
Definition: StdExpansion.h:307
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
Definition: StdExpansion.h:213
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:226
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,...
Definition: Interp.cpp:106
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:250
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition: GeomFactors.h:62
@ eRegular
Geometry is straight-sided with constant geometric factors.
@ eMovingRegular
Currently unused.
double NekDouble
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
Definition: Vmath.cpp:534
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
Definition: Vmath.cpp:574
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/y.
Definition: Vmath.cpp:324
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:492
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:291

References ASSERTL0, Nektar::SpatialDomains::eMovingRegular, Nektar::SpatialDomains::eRegular, Vmath::Fill(), Nektar::StdRegions::StdExpansion::GetCoordim(), Nektar::LocalRegions::Expansion::GetGeom(), Nektar::LibUtilities::BasisKey::GetNumPoints(), Nektar::StdRegions::StdExpansion::GetNumPoints(), Nektar::LibUtilities::BasisKey::GetPointsKey(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::StdRegions::StdExpansion::GetTraceBasisKey(), Nektar::LibUtilities::Interp2D(), Nektar::LocalRegions::Expansion::m_elmtBndNormDirElmtLen, Nektar::LocalRegions::Expansion::m_traceNormals, Vmath::Sdiv(), tinysimd::sqrt(), Vmath::Vcopy(), Vmath::Vmul(), Vmath::Vsqrt(), Vmath::Vvtvp(), and Vmath::Zero().

◆ v_CreateStdMatrix()

DNekMatSharedPtr Nektar::LocalRegions::HexExp::v_CreateStdMatrix ( const StdRegions::StdMatrixKey mkey)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 1421 of file HexExp.cpp.

1422 {
1423  LibUtilities::BasisKey bkey0 = m_base[0]->GetBasisKey();
1424  LibUtilities::BasisKey bkey1 = m_base[1]->GetBasisKey();
1425  LibUtilities::BasisKey bkey2 = m_base[2]->GetBasisKey();
1426 
1428  MemoryManager<StdHexExp>::AllocateSharedPtr(bkey0, bkey1, bkey2);
1429 
1430  return tmp->GetStdMatrix(mkey);
1431 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< StdHexExp > StdHexExpSharedPtr
Definition: StdHexExp.h:254

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and Nektar::StdRegions::StdExpansion::m_base.

◆ v_DetShapeType()

LibUtilities::ShapeType Nektar::LocalRegions::HexExp::v_DetShapeType ( ) const
protectedvirtual

Return the region shape using the enum-list of ShapeType.

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 695 of file HexExp.cpp.

696 {
698 }

References Nektar::LibUtilities::eHexahedron.

◆ v_DropLocStaticCondMatrix()

void Nektar::LocalRegions::HexExp::v_DropLocStaticCondMatrix ( const MatrixKey mkey)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1443 of file HexExp.cpp.

1444 {
1445  m_staticCondMatrixManager.DeleteObject(mkey);
1446 }

References m_staticCondMatrixManager.

◆ v_ExtractDataToCoeffs()

void Nektar::LocalRegions::HexExp::v_ExtractDataToCoeffs ( const NekDouble data,
const std::vector< unsigned int > &  nummodes,
const int  mode_offset,
NekDouble coeffs,
std::vector< LibUtilities::BasisType > &  fromType 
)
protectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 700 of file HexExp.cpp.

704 {
705  int data_order0 = nummodes[mode_offset];
706  int fillorder0 = min(m_base[0]->GetNumModes(), data_order0);
707  int data_order1 = nummodes[mode_offset + 1];
708  int order1 = m_base[1]->GetNumModes();
709  int fillorder1 = min(order1, data_order1);
710  int data_order2 = nummodes[mode_offset + 2];
711  int order2 = m_base[2]->GetNumModes();
712  int fillorder2 = min(order2, data_order2);
713 
714  // Check if same basis
715  if (fromType[0] != m_base[0]->GetBasisType() ||
716  fromType[1] != m_base[1]->GetBasisType() ||
717  fromType[2] != m_base[2]->GetBasisType())
718  {
719  // Construct a hex with the appropriate basis type at our
720  // quadrature points, and one more to do a forwards
721  // transform. We can then copy the output to coeffs.
722  StdRegions::StdHexExp tmpHex(
723  LibUtilities::BasisKey(fromType[0], data_order0,
724  m_base[0]->GetPointsKey()),
725  LibUtilities::BasisKey(fromType[1], data_order1,
726  m_base[1]->GetPointsKey()),
727  LibUtilities::BasisKey(fromType[2], data_order2,
728  m_base[2]->GetPointsKey()));
729  StdRegions::StdHexExp tmpHex2(m_base[0]->GetBasisKey(),
730  m_base[1]->GetBasisKey(),
731  m_base[2]->GetBasisKey());
732 
733  Array<OneD, const NekDouble> tmpData(tmpHex.GetNcoeffs(), data);
734  Array<OneD, NekDouble> tmpBwd(tmpHex2.GetTotPoints());
735  Array<OneD, NekDouble> tmpOut(tmpHex2.GetNcoeffs());
736 
737  tmpHex.BwdTrans(tmpData, tmpBwd);
738  tmpHex2.FwdTrans(tmpBwd, tmpOut);
739  Vmath::Vcopy(tmpOut.size(), &tmpOut[0], 1, coeffs, 1);
740 
741  return;
742  }
743 
744  switch (m_base[0]->GetBasisType())
745  {
747  {
748  int i, j;
749  int cnt = 0;
750  int cnt1 = 0;
751 
753  "Extraction routine not set up for this basis");
755  "Extraction routine not set up for this basis");
756 
757  Vmath::Zero(m_ncoeffs, coeffs, 1);
758  for (j = 0; j < fillorder0; ++j)
759  {
760  for (i = 0; i < fillorder1; ++i)
761  {
762  Vmath::Vcopy(fillorder2, &data[cnt], 1, &coeffs[cnt1], 1);
763  cnt += data_order2;
764  cnt1 += order2;
765  }
766 
767  // count out data for j iteration
768  for (i = fillorder1; i < data_order1; ++i)
769  {
770  cnt += data_order2;
771  }
772 
773  for (i = fillorder1; i < order1; ++i)
774  {
775  cnt1 += order2;
776  }
777  }
778  break;
779  }
781  {
782  LibUtilities::PointsKey p0(nummodes[0],
784  LibUtilities::PointsKey p1(nummodes[1],
786  LibUtilities::PointsKey p2(nummodes[2],
788  LibUtilities::PointsKey t0(m_base[0]->GetNumModes(),
790  LibUtilities::PointsKey t1(m_base[1]->GetNumModes(),
792  LibUtilities::PointsKey t2(m_base[2]->GetNumModes(),
794  LibUtilities::Interp3D(p0, p1, p2, data, t0, t1, t2, coeffs);
795  }
796  break;
797  default:
798  ASSERTL0(false, "basis is either not set up or not "
799  "hierarchicial");
800  }
801 }
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:163
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,...
Definition: Interp.cpp:167
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:53
@ eGLL_Lagrange
Lagrange for SEM basis .
Definition: BasisType.h:58
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:50

References ASSERTL0, ASSERTL1, Nektar::StdRegions::StdExpansion::BwdTrans(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::FwdTrans(), Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::LibUtilities::Interp3D(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, Vmath::Vcopy(), and Vmath::Zero().

◆ v_FwdTrans()

void Nektar::LocalRegions::HexExp::v_FwdTrans ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Forward transform from physical quadrature space stored in inarray and evaluate the expansion coefficients and store in (this)->_coeffs.

Parameters
inarrayInput array
outarrayOutput array

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 306 of file HexExp.cpp.

308 {
309  if (m_base[0]->Collocation() && m_base[1]->Collocation() &&
310  m_base[2]->Collocation())
311  {
312  Vmath::Vcopy(GetNcoeffs(), &inarray[0], 1, &outarray[0], 1);
313  }
314  else
315  {
316  IProductWRTBase(inarray, outarray);
317 
318  // get Mass matrix inverse
319  MatrixKey masskey(StdRegions::eInvMass, DetShapeType(), *this);
320  DNekScalMatSharedPtr matsys = m_matrixManager[masskey];
321 
322  // copy inarray in case inarray == outarray
323  DNekVec in(m_ncoeffs, outarray);
324  DNekVec out(m_ncoeffs, outarray, eWrapper);
325 
326  out = (*matsys) * in;
327  }
328 }
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:130
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...
Definition: StdExpansion.h:536
NekVector< NekDouble > DNekVec
Definition: NekTypeDefs.hpp:48

References Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::eInvMass, Nektar::eWrapper, Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::IProductWRTBase(), Nektar::StdRegions::StdExpansion::m_base, m_matrixManager, Nektar::StdRegions::StdExpansion::m_ncoeffs, and Vmath::Vcopy().

◆ v_GeneralMatrixOp_MatOp()

void Nektar::LocalRegions::HexExp::v_GeneralMatrixOp_MatOp ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 1248 of file HexExp.cpp.

1251 {
1252  // int nConsts = mkey.GetNconstants();
1253  DNekScalMatSharedPtr mat = GetLocMatrix(mkey);
1254 
1255  // switch(nConsts)
1256  // {
1257  // case 0:
1258  // {
1259  // mat = GetLocMatrix(mkey.GetMatrixType());
1260  // }
1261  // break;
1262  // case 1:
1263  // {
1264  // mat =
1265  // GetLocMatrix(mkey.GetMatrixType(),mkey.GetConstant(0));
1266  // }
1267  // break;
1268  // case 2:
1269  // {
1270  // mat =
1271  // GetLocMatrix(mkey.GetMatrixType(),mkey.GetConstant(0),mkey.GetConstant(1));
1272  // }
1273  // break;
1274  //
1275  // default:
1276  // {
1277  // NEKERROR(ErrorUtil::efatal, "Unknown number of
1278  // constants");
1279  // }
1280  // break;
1281  // }
1282 
1283  if (inarray.get() == outarray.get())
1284  {
1285  Array<OneD, NekDouble> tmp(m_ncoeffs);
1286  Vmath::Vcopy(m_ncoeffs, inarray.get(), 1, tmp.get(), 1);
1287 
1288  Blas::Dgemv('N', m_ncoeffs, m_ncoeffs, mat->Scale(),
1289  (mat->GetOwnedMatrix())->GetPtr().get(), m_ncoeffs,
1290  tmp.get(), 1, 0.0, outarray.get(), 1);
1291  }
1292  else
1293  {
1294  Blas::Dgemv('N', m_ncoeffs, m_ncoeffs, mat->Scale(),
1295  (mat->GetOwnedMatrix())->GetPtr().get(), m_ncoeffs,
1296  inarray.get(), 1, 0.0, outarray.get(), 1);
1297  }
1298 }
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition: Expansion.cpp:88

References Blas::Dgemv(), Nektar::LocalRegions::Expansion::GetLocMatrix(), Nektar::StdRegions::StdExpansion::m_ncoeffs, and Vmath::Vcopy().

◆ v_GenMatrix()

DNekMatSharedPtr Nektar::LocalRegions::HexExp::v_GenMatrix ( const StdRegions::StdMatrixKey mkey)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 1399 of file HexExp.cpp.

1400 {
1401  DNekMatSharedPtr returnval;
1402 
1403  switch (mkey.GetMatrixType())
1404  {
1412  returnval = Expansion3D::v_GenMatrix(mkey);
1413  break;
1414  default:
1415  returnval = StdHexExp::v_GenMatrix(mkey);
1416  }
1417 
1418  return returnval;
1419 }
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75

References Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::StdRegions::eHybridDGHelmholtz, Nektar::StdRegions::eHybridDGLamToQ0, Nektar::StdRegions::eHybridDGLamToQ1, Nektar::StdRegions::eHybridDGLamToQ2, Nektar::StdRegions::eHybridDGLamToU, Nektar::StdRegions::eInvLaplacianWithUnityMean, Nektar::StdRegions::StdMatrixKey::GetMatrixType(), and Nektar::LocalRegions::Expansion3D::v_GenMatrix().

◆ v_GetCoord()

void Nektar::LocalRegions::HexExp::v_GetCoord ( const Array< OneD, const NekDouble > &  Lcoords,
Array< OneD, NekDouble > &  coords 
)
protectedvirtual

Retrieves the physical coordinates of a given set of reference coordinates.

Parameters
LcoordsLocal coordinates in reference space.
coordsCorresponding coordinates in physical space.

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 666 of file HexExp.cpp.

668 {
669  int i;
670 
671  ASSERTL1(Lcoords[0] >= -1.0 && Lcoords[0] <= 1.0 && Lcoords[1] >= -1.0 &&
672  Lcoords[1] <= 1.0 && Lcoords[2] >= -1.0 && Lcoords[2] <= 1.0,
673  "Local coordinates are not in region [-1,1]");
674 
675  m_geom->FillGeom();
676 
677  for (i = 0; i < m_geom->GetCoordim(); ++i)
678  {
679  coords[i] = m_geom->GetCoord(i, Lcoords);
680  }
681 }
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:272

References ASSERTL1, and Nektar::LocalRegions::Expansion::m_geom.

◆ v_GetCoords()

void Nektar::LocalRegions::HexExp::v_GetCoords ( Array< OneD, NekDouble > &  coords_1,
Array< OneD, NekDouble > &  coords_2,
Array< OneD, NekDouble > &  coords_3 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 683 of file HexExp.cpp.

686 {
687  Expansion::v_GetCoords(coords_0, coords_1, coords_2);
688 }
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: Expansion.cpp:524

References Nektar::LocalRegions::Expansion::v_GetCoords().

◆ v_GetFaceDGForwards()

bool Nektar::LocalRegions::HexExp::v_GetFaceDGForwards ( const int  i) const
protectedvirtual

◆ v_GetLinStdExp()

StdRegions::StdExpansionSharedPtr Nektar::LocalRegions::HexExp::v_GetLinStdExp ( void  ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 646 of file HexExp.cpp.

647 {
648  LibUtilities::BasisKey bkey0(m_base[0]->GetBasisType(), 2,
649  m_base[0]->GetPointsKey());
650  LibUtilities::BasisKey bkey1(m_base[1]->GetBasisType(), 2,
651  m_base[1]->GetPointsKey());
652  LibUtilities::BasisKey bkey2(m_base[2]->GetBasisType(), 2,
653  m_base[2]->GetPointsKey());
654 
656  bkey2);
657 }

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::StdRegions::StdExpansion::GetBasisType(), and Nektar::StdRegions::StdExpansion::m_base.

◆ v_GetLocMatrix()

DNekScalMatSharedPtr Nektar::LocalRegions::HexExp::v_GetLocMatrix ( const MatrixKey mkey)
protectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1433 of file HexExp.cpp.

1434 {
1435  return m_matrixManager[mkey];
1436 }

References m_matrixManager.

◆ v_GetLocStaticCondMatrix()

DNekScalBlkMatSharedPtr Nektar::LocalRegions::HexExp::v_GetLocStaticCondMatrix ( const MatrixKey mkey)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1438 of file HexExp.cpp.

1439 {
1440  return m_staticCondMatrixManager[mkey];
1441 }

References m_staticCondMatrixManager.

◆ v_GetStdExp()

StdRegions::StdExpansionSharedPtr Nektar::LocalRegions::HexExp::v_GetStdExp ( void  ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 639 of file HexExp.cpp.

640 {
642  m_base[0]->GetBasisKey(), m_base[1]->GetBasisKey(),
643  m_base[2]->GetBasisKey());
644 }

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and Nektar::StdRegions::StdExpansion::m_base.

◆ v_GetTracePhysMap()

void Nektar::LocalRegions::HexExp::v_GetTracePhysMap ( const int  face,
Array< OneD, int > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 813 of file HexExp.cpp.

814 {
815  int nquad0 = m_base[0]->GetNumPoints();
816  int nquad1 = m_base[1]->GetNumPoints();
817  int nquad2 = m_base[2]->GetNumPoints();
818 
819  int nq0 = 0;
820  int nq1 = 0;
821 
822  switch (face)
823  {
824  case 0:
825  nq0 = nquad0;
826  nq1 = nquad1;
827 
828  // Directions A and B positive
829  if (outarray.size() != nq0 * nq1)
830  {
831  outarray = Array<OneD, int>(nq0 * nq1);
832  }
833 
834  for (int i = 0; i < nquad0 * nquad1; ++i)
835  {
836  outarray[i] = i;
837  }
838 
839  break;
840  case 1:
841  nq0 = nquad0;
842  nq1 = nquad2;
843  // Direction A and B positive
844  if (outarray.size() != nq0 * nq1)
845  {
846  outarray = Array<OneD, int>(nq0 * nq1);
847  }
848 
849  // Direction A and B positive
850  for (int k = 0; k < nquad2; k++)
851  {
852  for (int i = 0; i < nquad0; ++i)
853  {
854  outarray[k * nquad0 + i] = nquad0 * nquad1 * k + i;
855  }
856  }
857  break;
858  case 2:
859  nq0 = nquad1;
860  nq1 = nquad2;
861 
862  // Direction A and B positive
863  if (outarray.size() != nq0 * nq1)
864  {
865  outarray = Array<OneD, int>(nq0 * nq1);
866  }
867 
868  for (int i = 0; i < nquad1 * nquad2; i++)
869  {
870  outarray[i] = nquad0 - 1 + i * nquad0;
871  }
872  break;
873  case 3:
874  nq0 = nquad0;
875  nq1 = nquad2;
876 
877  // Direction A and B positive
878  if (outarray.size() != nq0 * nq1)
879  {
880  outarray = Array<OneD, int>(nq0 * nq1);
881  }
882 
883  for (int k = 0; k < nquad2; k++)
884  {
885  for (int i = 0; i < nquad0; i++)
886  {
887  outarray[k * nquad0 + i] =
888  (nquad0 * (nquad1 - 1)) + (k * nquad0 * nquad1) + i;
889  }
890  }
891  break;
892  case 4:
893  nq0 = nquad1;
894  nq1 = nquad2;
895 
896  // Direction A and B positive
897  if (outarray.size() != nq0 * nq1)
898  {
899  outarray = Array<OneD, int>(nq0 * nq1);
900  }
901 
902  for (int i = 0; i < nquad1 * nquad2; i++)
903  {
904  outarray[i] = i * nquad0;
905  }
906  break;
907  case 5:
908  nq0 = nquad0;
909  nq1 = nquad1;
910  // Directions A and B positive
911  if (outarray.size() != nq0 * nq1)
912  {
913  outarray = Array<OneD, int>(nq0 * nq1);
914  }
915 
916  for (int i = 0; i < nquad0 * nquad1; i++)
917  {
918  outarray[i] = nquad0 * nquad1 * (nquad2 - 1) + i;
919  }
920 
921  break;
922  default:
923  ASSERTL0(false, "face value (> 5) is out of range");
924  break;
925  }
926 }

References ASSERTL0, and Nektar::StdRegions::StdExpansion::m_base.

◆ v_HelmholtzMatrixOp()

void Nektar::LocalRegions::HexExp::v_HelmholtzMatrixOp ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 1241 of file HexExp.cpp.

1244 {
1245  HexExp::v_HelmholtzMatrixOp_MatFree(inarray, outarray, mkey);
1246 }
virtual void v_HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)

References Nektar::StdRegions::StdExpansion3D::v_HelmholtzMatrixOp_MatFree().

◆ v_Integral()

NekDouble Nektar::LocalRegions::HexExp::v_Integral ( const Array< OneD, const NekDouble > &  inarray)
protectedvirtual

Integrate the physical point list inarray over region.

Parameters
inarraydefinition of function to be returned at quadrature points of expansion.
Returns
\(\int^1_{-1}\int^1_{-1} \int^1_{-1} u(\eta_1, \eta_2, \eta_3) J[i,j,k] d \eta_1 d \eta_2 d \eta_3 \) where \(inarray[i,j,k] = u(\eta_{1i},\eta_{2j},\eta_{3k}) \) and \( J[i,j,k] \) is the Jacobian evaluated at the quadrature point.

Reimplemented from Nektar::StdRegions::StdExpansion3D.

Definition at line 110 of file HexExp.cpp.

111 {
112  int nquad0 = m_base[0]->GetNumPoints();
113  int nquad1 = m_base[1]->GetNumPoints();
114  int nquad2 = m_base[2]->GetNumPoints();
115  Array<OneD, const NekDouble> jac = m_metricinfo->GetJac(GetPointsKeys());
116  NekDouble returnVal;
117  Array<OneD, NekDouble> tmp(nquad0 * nquad1 * nquad2);
118 
119  // multiply inarray with Jacobian
120 
121  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
122  {
123  Vmath::Vmul(nquad0 * nquad1 * nquad2, &jac[0], 1,
124  (NekDouble *)&inarray[0], 1, &tmp[0], 1);
125  }
126  else
127  {
128  Vmath::Smul(nquad0 * nquad1 * nquad2, (NekDouble)jac[0],
129  (NekDouble *)&inarray[0], 1, &tmp[0], 1);
130  }
131 
132  // call StdHexExp version;
133  returnVal = StdHexExp::v_Integral(tmp);
134 
135  return returnVal;
136 }

References Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_metricinfo, Vmath::Smul(), and Vmath::Vmul().

◆ v_IProductWRTBase()

void Nektar::LocalRegions::HexExp::v_IProductWRTBase ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Calculate the inner product of inarray with respect to the elements basis.

Parameters
inarrayInput array of physical space data.
outarrayOutput array of data.

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 341 of file HexExp.cpp.

343 {
344  HexExp::v_IProductWRTBase_SumFac(inarray, outarray);
345 }
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Calculate the inner product of inarray with respect to the given basis B = base0 * base1 * base2.
Definition: HexExp.cpp:379

References v_IProductWRTBase_SumFac().

◆ v_IProductWRTBase_SumFac()

void Nektar::LocalRegions::HexExp::v_IProductWRTBase_SumFac ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
bool  multiplybyweights = true 
)
protectedvirtual

Calculate the inner product of inarray with respect to the given basis B = base0 * base1 * base2.

\( \begin{array}{rcl} I_{pqr} = (\phi_{pqr}, u)_{\delta} & = & \sum_{i=0}^{nq_0} \sum_{j=0}^{nq_1} \sum_{k=0}^{nq_2} \psi_{p}^{a} (\xi_{1i}) \psi_{q}^{a} (\xi_{2j}) \psi_{r}^{a} (\xi_{3k}) w_i w_j w_k u(\xi_{1,i} \xi_{2,j} \xi_{3,k}) J_{i,j,k}\\ & = & \sum_{i=0}^{nq_0} \psi_p^a(\xi_{1,i}) \sum_{j=0}^{nq_1} \psi_{q}^a(\xi_{2,j}) \sum_{k=0}^{nq_2} \psi_{r}^a u(\xi_{1i},\xi_{2j},\xi_{3k}) J_{i,j,k} \end{array} \)
where \( \phi_{pqr} (\xi_1 , \xi_2 , \xi_3) = \psi_p^a ( \xi_1) \psi_{q}^a (\xi_2) \psi_{r}^a (\xi_3) \)
which can be implemented as
\(f_{r} (\xi_{3k}) = \sum_{k=0}^{nq_3} \psi_{r}^a u(\xi_{1i},\xi_{2j},\xi_{3k}) J_{i,j,k} = {\bf B_3 U} \)
\( g_{q} (\xi_{3k}) = \sum_{j=0}^{nq_1} \psi_{q}^a (\xi_{2j}) f_{r} (\xi_{3k}) = {\bf B_2 F} \)
\( (\phi_{pqr}, u)_{\delta} = \sum_{k=0}^{nq_0} \psi_{p}^a (\xi_{3k}) g_{q} (\xi_{3k}) = {\bf B_1 G} \)

Parameters
base0Basis to integrate wrt in first dimension.
base1Basis to integrate wrt in second dimension.
base2Basis to integrate wrt in third dimension.
inarrayInput array.
outarrayOutput array.
coll_check(not used)

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 379 of file HexExp.cpp.

382 {
383  int nquad0 = m_base[0]->GetNumPoints();
384  int nquad1 = m_base[1]->GetNumPoints();
385  int nquad2 = m_base[2]->GetNumPoints();
386  int order0 = m_base[0]->GetNumModes();
387  int order1 = m_base[1]->GetNumModes();
388 
389  Array<OneD, NekDouble> wsp(nquad0 * nquad1 * (nquad2 + order0) +
390  order0 * order1 * nquad2);
391 
392  if (multiplybyweights)
393  {
394  Array<OneD, NekDouble> tmp(inarray.size());
395 
396  MultiplyByQuadratureMetric(inarray, tmp);
398  m_base[0]->GetBdata(), m_base[1]->GetBdata(), m_base[2]->GetBdata(),
399  tmp, outarray, wsp, true, true, true);
400  }
401  else
402  {
404  m_base[0]->GetBdata(), m_base[1]->GetBdata(), m_base[2]->GetBdata(),
405  inarray, outarray, wsp, true, true, true);
406  }
407 }

References Nektar::StdRegions::StdExpansion3D::IProductWRTBase_SumFacKernel(), Nektar::StdRegions::StdExpansion::m_base, and Nektar::StdRegions::StdExpansion::MultiplyByQuadratureMetric().

Referenced by v_IProductWRTBase().

◆ v_IProductWRTDerivBase()

void Nektar::LocalRegions::HexExp::v_IProductWRTDerivBase ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 409 of file HexExp.cpp.

412 {
413  HexExp::IProductWRTDerivBase_SumFac(dir, inarray, outarray);
414 }
void IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the inner product .
Definition: HexExp.cpp:436

References IProductWRTDerivBase_SumFac().

◆ v_IProductWRTDirectionalDerivBase()

void Nektar::LocalRegions::HexExp::v_IProductWRTDirectionalDerivBase ( const Array< OneD, const NekDouble > &  direction,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
inlineprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 131 of file HexExp.h.

135  {
136  IProductWRTDirectionalDerivBase_SumFac(direction, inarray, outarray);
137  }
void IProductWRTDirectionalDerivBase_SumFac(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: HexExp.cpp:562

References IProductWRTDirectionalDerivBase_SumFac().

◆ v_LaplacianMatrixOp() [1/2]

void Nektar::LocalRegions::HexExp::v_LaplacianMatrixOp ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 1204 of file HexExp.cpp.

1207 {
1208  HexExp::v_LaplacianMatrixOp_MatFree(inarray, outarray, mkey);
1209 }
virtual void v_LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)

References Nektar::StdRegions::StdExpansion3D::v_LaplacianMatrixOp_MatFree().

◆ v_LaplacianMatrixOp() [2/2]

void Nektar::LocalRegions::HexExp::v_LaplacianMatrixOp ( const int  k1,
const int  k2,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 1211 of file HexExp.cpp.

1215 {
1216  StdExpansion::LaplacianMatrixOp_MatFree(k1, k2, inarray, outarray, mkey);
1217 }

◆ v_LaplacianMatrixOp_MatFree_Kernel()

void Nektar::LocalRegions::HexExp::v_LaplacianMatrixOp_MatFree_Kernel ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
Array< OneD, NekDouble > &  wsp 
)
privatevirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1448 of file HexExp.cpp.

1451 {
1452  // This implementation is only valid when there are no
1453  // coefficients associated to the Laplacian operator
1454  if (m_metrics.count(eMetricLaplacian00) == 0)
1455  {
1457  }
1458 
1459  int nquad0 = m_base[0]->GetNumPoints();
1460  int nquad1 = m_base[1]->GetNumPoints();
1461  int nquad2 = m_base[2]->GetNumPoints();
1462  int nqtot = nquad0 * nquad1 * nquad2;
1463 
1464  ASSERTL1(wsp.size() >= 6 * nqtot, "Insufficient workspace size.");
1465 
1466  const Array<OneD, const NekDouble> &base0 = m_base[0]->GetBdata();
1467  const Array<OneD, const NekDouble> &base1 = m_base[1]->GetBdata();
1468  const Array<OneD, const NekDouble> &base2 = m_base[2]->GetBdata();
1469  const Array<OneD, const NekDouble> &dbase0 = m_base[0]->GetDbdata();
1470  const Array<OneD, const NekDouble> &dbase1 = m_base[1]->GetDbdata();
1471  const Array<OneD, const NekDouble> &dbase2 = m_base[2]->GetDbdata();
1472  const Array<OneD, const NekDouble> &metric00 =
1474  const Array<OneD, const NekDouble> &metric01 =
1476  const Array<OneD, const NekDouble> &metric02 =
1478  const Array<OneD, const NekDouble> &metric11 =
1480  const Array<OneD, const NekDouble> &metric12 =
1482  const Array<OneD, const NekDouble> &metric22 =
1484 
1485  // Allocate temporary storage
1486  Array<OneD, NekDouble> wsp0(wsp);
1487  Array<OneD, NekDouble> wsp1(wsp + 1 * nqtot);
1488  Array<OneD, NekDouble> wsp2(wsp + 2 * nqtot);
1489  Array<OneD, NekDouble> wsp3(wsp + 3 * nqtot);
1490  Array<OneD, NekDouble> wsp4(wsp + 4 * nqtot);
1491  Array<OneD, NekDouble> wsp5(wsp + 5 * nqtot);
1492 
1493  StdExpansion3D::PhysTensorDeriv(inarray, wsp0, wsp1, wsp2);
1494 
1495  // wsp0 = k = g0 * wsp1 + g1 * wsp2 = g0 * du_dxi1 + g1 * du_dxi2
1496  // wsp2 = l = g1 * wsp1 + g2 * wsp2 = g0 * du_dxi1 + g1 * du_dxi2
1497  // where g0, g1 and g2 are the metric terms set up in the GeomFactors class
1498  // especially for this purpose
1499  Vmath::Vvtvvtp(nqtot, &metric00[0], 1, &wsp0[0], 1, &metric01[0], 1,
1500  &wsp1[0], 1, &wsp3[0], 1);
1501  Vmath::Vvtvp(nqtot, &metric02[0], 1, &wsp2[0], 1, &wsp3[0], 1, &wsp3[0], 1);
1502  Vmath::Vvtvvtp(nqtot, &metric01[0], 1, &wsp0[0], 1, &metric11[0], 1,
1503  &wsp1[0], 1, &wsp4[0], 1);
1504  Vmath::Vvtvp(nqtot, &metric12[0], 1, &wsp2[0], 1, &wsp4[0], 1, &wsp4[0], 1);
1505  Vmath::Vvtvvtp(nqtot, &metric02[0], 1, &wsp0[0], 1, &metric12[0], 1,
1506  &wsp1[0], 1, &wsp5[0], 1);
1507  Vmath::Vvtvp(nqtot, &metric22[0], 1, &wsp2[0], 1, &wsp5[0], 1, &wsp5[0], 1);
1508 
1509  // outarray = m = (D_xi1 * B)^T * k
1510  // wsp1 = n = (D_xi2 * B)^T * l
1511  IProductWRTBase_SumFacKernel(dbase0, base1, base2, wsp3, outarray, wsp0,
1512  false, true, true);
1513  IProductWRTBase_SumFacKernel(base0, dbase1, base2, wsp4, wsp2, wsp0, true,
1514  false, true);
1515  Vmath::Vadd(m_ncoeffs, wsp2.get(), 1, outarray.get(), 1, outarray.get(), 1);
1516  IProductWRTBase_SumFacKernel(base0, base1, dbase2, wsp5, wsp2, wsp0, true,
1517  true, false);
1518  Vmath::Vadd(m_ncoeffs, wsp2.get(), 1, outarray.get(), 1, outarray.get(), 1);
1519 }
void Vvtvvtp(int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtp (vector times vector plus vector times vector):
Definition: Vmath.cpp:692

References ASSERTL1, Nektar::LocalRegions::Expansion::ComputeLaplacianMetric(), Nektar::LocalRegions::eMetricLaplacian00, Nektar::LocalRegions::eMetricLaplacian01, Nektar::LocalRegions::eMetricLaplacian02, Nektar::LocalRegions::eMetricLaplacian11, Nektar::LocalRegions::eMetricLaplacian12, Nektar::LocalRegions::eMetricLaplacian22, Nektar::StdRegions::StdExpansion3D::IProductWRTBase_SumFacKernel(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_metrics, Nektar::StdRegions::StdExpansion::m_ncoeffs, Vmath::Vadd(), Vmath::Vvtvp(), and Vmath::Vvtvvtp().

◆ v_MassLevelCurvatureMatrixOp()

void Nektar::LocalRegions::HexExp::v_MassLevelCurvatureMatrixOp ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1234 of file HexExp.cpp.

1237 {
1238  StdExpansion::MassLevelCurvatureMatrixOp_MatFree(inarray, outarray, mkey);
1239 }

◆ v_MassMatrixOp()

void Nektar::LocalRegions::HexExp::v_MassMatrixOp ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 1197 of file HexExp.cpp.

1200 {
1201  StdExpansion::MassMatrixOp_MatFree(inarray, outarray, mkey);
1202 }

◆ v_NormalTraceDerivFactors()

void Nektar::LocalRegions::HexExp::v_NormalTraceDerivFactors ( Array< OneD, Array< OneD, NekDouble >> &  factors,
Array< OneD, Array< OneD, NekDouble >> &  d0factors,
Array< OneD, Array< OneD, NekDouble >> &  d1factors 
)
privatevirtual

: This method gets all of the factors which are required as part of the Gradient Jump Penalty stabilisation and involves the product of the normal and geometric factors along the element trace.

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1563 of file HexExp.cpp.

1567 {
1568  int nquad0 = GetNumPoints(0);
1569  int nquad1 = GetNumPoints(1);
1570  int nquad2 = GetNumPoints(2);
1571 
1572  const Array<TwoD, const NekDouble> &df =
1573  m_metricinfo->GetDerivFactors(GetPointsKeys());
1574 
1575  if (d0factors.size() != 6)
1576  {
1577  d0factors = Array<OneD, Array<OneD, NekDouble>>(6);
1578  d1factors = Array<OneD, Array<OneD, NekDouble>>(6);
1579  d2factors = Array<OneD, Array<OneD, NekDouble>>(6);
1580  }
1581 
1582  if (d0factors[0].size() != nquad0 * nquad1)
1583  {
1584  d0factors[0] = Array<OneD, NekDouble>(nquad0 * nquad1);
1585  d0factors[5] = Array<OneD, NekDouble>(nquad0 * nquad1);
1586  d1factors[0] = Array<OneD, NekDouble>(nquad0 * nquad1);
1587  d1factors[5] = Array<OneD, NekDouble>(nquad0 * nquad1);
1588  d2factors[0] = Array<OneD, NekDouble>(nquad0 * nquad1);
1589  d2factors[5] = Array<OneD, NekDouble>(nquad0 * nquad1);
1590  }
1591 
1592  if (d0factors[1].size() != nquad0 * nquad2)
1593  {
1594  d0factors[1] = Array<OneD, NekDouble>(nquad0 * nquad2);
1595  d0factors[3] = Array<OneD, NekDouble>(nquad0 * nquad2);
1596  d1factors[1] = Array<OneD, NekDouble>(nquad0 * nquad2);
1597  d1factors[3] = Array<OneD, NekDouble>(nquad0 * nquad2);
1598  d2factors[1] = Array<OneD, NekDouble>(nquad0 * nquad2);
1599  d2factors[3] = Array<OneD, NekDouble>(nquad0 * nquad2);
1600  }
1601 
1602  if (d0factors[2].size() != nquad1 * nquad2)
1603  {
1604  d0factors[2] = Array<OneD, NekDouble>(nquad1 * nquad2);
1605  d0factors[4] = Array<OneD, NekDouble>(nquad1 * nquad2);
1606  d1factors[2] = Array<OneD, NekDouble>(nquad1 * nquad2);
1607  d1factors[4] = Array<OneD, NekDouble>(nquad1 * nquad2);
1608  d2factors[2] = Array<OneD, NekDouble>(nquad1 * nquad2);
1609  d2factors[4] = Array<OneD, NekDouble>(nquad1 * nquad2);
1610  }
1611 
1612  // Outwards normals
1613  const Array<OneD, const Array<OneD, NekDouble>> &normal_0 =
1614  GetTraceNormal(0);
1615  const Array<OneD, const Array<OneD, NekDouble>> &normal_1 =
1616  GetTraceNormal(1);
1617  const Array<OneD, const Array<OneD, NekDouble>> &normal_2 =
1618  GetTraceNormal(2);
1619  const Array<OneD, const Array<OneD, NekDouble>> &normal_3 =
1620  GetTraceNormal(3);
1621  const Array<OneD, const Array<OneD, NekDouble>> &normal_4 =
1622  GetTraceNormal(4);
1623  const Array<OneD, const Array<OneD, NekDouble>> &normal_5 =
1624  GetTraceNormal(5);
1625 
1626  int ncoords = normal_0.size();
1627 
1628  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1629  {
1630  // faces 0 and 5
1631  for (int i = 0; i < nquad0 * nquad1; ++i)
1632  {
1633  d0factors[0][i] = df[0][i] * normal_0[0][i];
1634  d0factors[5][i] =
1635  df[0][nquad0 * nquad1 * (nquad2 - 1) + i] * normal_5[0][i];
1636  d1factors[0][i] = df[1][i] * normal_0[0][i];
1637  d1factors[5][i] =
1638  df[1][nquad0 * nquad1 * (nquad2 - 1) + i] * normal_5[0][i];
1639  d2factors[0][i] = df[2][i] * normal_0[0][i];
1640  d2factors[5][i] =
1641  df[2][nquad0 * nquad1 * (nquad2 - 1) + i] * normal_5[0][i];
1642  }
1643 
1644  for (int n = 1; n < ncoords; ++n)
1645  {
1646  for (int i = 0; i < nquad0 * nquad1; ++i)
1647  {
1648  d0factors[0][i] += df[3 * n][i] * normal_0[n][i];
1649  d0factors[5][i] +=
1650  df[3 * n][nquad0 * nquad1 * (nquad2 - 1) + i] *
1651  normal_5[n][i];
1652  d1factors[0][i] += df[3 * n + 1][i] * normal_0[n][i];
1653  d1factors[5][i] +=
1654  df[3 * n + 1][nquad0 * nquad1 * (nquad2 - 1) + i] *
1655  normal_5[n][i];
1656  d2factors[0][i] += df[3 * n + 2][i] * normal_0[n][i];
1657  d2factors[5][i] +=
1658  df[3 * n + 2][nquad0 * nquad1 * (nquad2 - 1) + i] *
1659  normal_5[n][i];
1660  }
1661  }
1662 
1663  // faces 1 and 3
1664  for (int j = 0; j < nquad2; ++j)
1665  {
1666  for (int i = 0; i < nquad0; ++i)
1667  {
1668  d0factors[1][i] = df[0][j * nquad0 * nquad1 + i] *
1669  normal_1[0][j * nquad0 + i];
1670  d0factors[3][i] =
1671  df[0][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1672  normal_3[0][j * nquad0 + i];
1673  d1factors[1][i] = df[1][j * nquad0 * nquad1 + i] *
1674  normal_1[0][j * nquad0 + i];
1675  d1factors[3][i] =
1676  df[1][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1677  normal_3[0][j * nquad0 + i];
1678  d2factors[1][i] = df[2][j * nquad0 * nquad1 + i] *
1679  normal_1[0][j * nquad0 + i];
1680  d2factors[3][i] =
1681  df[2][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1682  normal_3[0][j * nquad0 + i];
1683  }
1684  }
1685 
1686  for (int n = 1; n < ncoords; ++n)
1687  {
1688  for (int j = 0; j < nquad2; ++j)
1689  {
1690  for (int i = 0; i < nquad0; ++i)
1691  {
1692  d0factors[1][i] = df[3 * n][j * nquad0 * nquad1 + i] *
1693  normal_1[0][j * nquad0 + i];
1694  d0factors[3][i] =
1695  df[3 * n][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1696  normal_3[0][j * nquad0 + i];
1697  d1factors[1][i] = df[3 * n + 1][j * nquad0 * nquad1 + i] *
1698  normal_1[0][j * nquad0 + i];
1699  d1factors[3][i] =
1700  df[3 * n + 1][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1701  normal_3[0][j * nquad0 + i];
1702  d2factors[1][i] = df[3 * n + 2][j * nquad0 * nquad1 + i] *
1703  normal_1[0][j * nquad0 + i];
1704  d2factors[3][i] =
1705  df[3 * n + 2][(j + 1) * nquad0 * nquad1 - nquad0 + i] *
1706  normal_3[0][j * nquad0 + i];
1707  }
1708  }
1709  }
1710 
1711  // faces 2 and 4
1712  for (int j = 0; j < nquad2; ++j)
1713  {
1714  for (int i = 0; i < nquad1; ++i)
1715  {
1716  d0factors[2][j * nquad1 + i] =
1717  df[0][j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1718  normal_2[0][j * nquad1 + i];
1719  d0factors[4][j * nquad1 + i] =
1720  df[0][j * nquad0 * nquad1 + i * nquad0] *
1721  normal_4[0][j * nquad1 + i];
1722  d1factors[2][j * nquad1 + i] =
1723  df[1][j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1724  normal_2[0][j * nquad1 + i];
1725  d1factors[4][j * nquad1 + i] =
1726  df[1][j * nquad0 * nquad1 + i * nquad0] *
1727  normal_4[0][j * nquad1 + i];
1728  d2factors[2][j * nquad1 + i] =
1729  df[2][j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1730  normal_2[0][j * nquad1 + i];
1731  d2factors[4][j * nquad1 + i] =
1732  df[2][j * nquad0 * nquad1 + i * nquad0] *
1733  normal_4[0][j * nquad1 + i];
1734  }
1735  }
1736 
1737  for (int n = 1; n < ncoords; ++n)
1738  {
1739  for (int j = 0; j < nquad2; ++j)
1740  {
1741  for (int i = 0; i < nquad1; ++i)
1742  {
1743  d0factors[2][j * nquad1 + i] +=
1744  df[3 * n][j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1745  normal_2[n][j * nquad0 + i];
1746  d0factors[4][j * nquad0 + i] +=
1747  df[3 * n][i * nquad0 + j * nquad0 * nquad1] *
1748  normal_4[n][j * nquad0 + i];
1749  d1factors[2][j * nquad1 + i] +=
1750  df[3 * n + 1]
1751  [j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1752  normal_2[n][j * nquad0 + i];
1753  d1factors[4][j * nquad0 + i] +=
1754  df[3 * n + 1][i * nquad0 + j * nquad0 * nquad1] *
1755  normal_4[n][j * nquad0 + i];
1756  d2factors[2][j * nquad1 + i] +=
1757  df[3 * n + 2]
1758  [j * nquad0 * nquad1 + (i + 1) * nquad0 - 1] *
1759  normal_2[n][j * nquad0 + i];
1760  d2factors[4][j * nquad0 + i] +=
1761  df[3 * n + 2][i * nquad0 + j * nquad0 * nquad1] *
1762  normal_4[n][j * nquad0 + i];
1763  }
1764  }
1765  }
1766  }
1767  else
1768  {
1769  // Faces 0 and 5
1770  for (int i = 0; i < nquad0 * nquad1; ++i)
1771  {
1772  d0factors[0][i] = df[0][0] * normal_0[0][i];
1773  d0factors[5][i] = df[0][0] * normal_5[0][i];
1774 
1775  d1factors[0][i] = df[1][0] * normal_0[0][i];
1776  d1factors[5][i] = df[1][0] * normal_5[0][i];
1777 
1778  d2factors[0][i] = df[2][0] * normal_0[0][i];
1779  d2factors[5][i] = df[2][0] * normal_5[0][i];
1780  }
1781 
1782  for (int n = 1; n < ncoords; ++n)
1783  {
1784  for (int i = 0; i < nquad0 * nquad1; ++i)
1785  {
1786  d0factors[0][i] += df[3 * n][0] * normal_0[n][i];
1787  d0factors[5][i] += df[3 * n][0] * normal_5[n][i];
1788 
1789  d1factors[0][i] += df[3 * n + 1][0] * normal_0[n][i];
1790  d1factors[5][i] += df[3 * n + 1][0] * normal_5[n][i];
1791 
1792  d2factors[0][i] += df[3 * n + 2][0] * normal_0[n][i];
1793  d2factors[5][i] += df[3 * n + 2][0] * normal_5[n][i];
1794  }
1795  }
1796 
1797  // faces 1 and 3
1798  for (int i = 0; i < nquad0 * nquad2; ++i)
1799  {
1800  d0factors[1][i] = df[0][0] * normal_1[0][i];
1801  d0factors[3][i] = df[0][0] * normal_3[0][i];
1802 
1803  d1factors[1][i] = df[1][0] * normal_1[0][i];
1804  d1factors[3][i] = df[1][0] * normal_3[0][i];
1805 
1806  d2factors[1][i] = df[2][0] * normal_1[0][i];
1807  d2factors[3][i] = df[2][0] * normal_3[0][i];
1808  }
1809 
1810  for (int n = 1; n < ncoords; ++n)
1811  {
1812  for (int i = 0; i < nquad0 * nquad2; ++i)
1813  {
1814  d0factors[1][i] += df[3 * n][0] * normal_1[n][i];
1815  d0factors[3][i] += df[3 * n][0] * normal_3[n][i];
1816 
1817  d1factors[1][i] += df[3 * n + 1][0] * normal_1[n][i];
1818  d1factors[3][i] += df[3 * n + 1][0] * normal_3[n][i];
1819 
1820  d2factors[1][i] += df[3 * n + 2][0] * normal_1[n][i];
1821  d2factors[3][i] += df[3 * n + 2][0] * normal_3[n][i];
1822  }
1823  }
1824 
1825  // faces 2 and 4
1826  for (int i = 0; i < nquad1 * nquad2; ++i)
1827  {
1828  d0factors[2][i] = df[0][0] * normal_2[0][i];
1829  d0factors[4][i] = df[0][0] * normal_4[0][i];
1830 
1831  d1factors[2][i] = df[1][0] * normal_2[0][i];
1832  d1factors[4][i] = df[1][0] * normal_4[0][i];
1833 
1834  d2factors[2][i] = df[2][0] * normal_2[0][i];
1835  d2factors[4][i] = df[2][0] * normal_4[0][i];
1836  }
1837 
1838  for (int n = 1; n < ncoords; ++n)
1839  {
1840  for (int i = 0; i < nquad1 * nquad2; ++i)
1841  {
1842  d0factors[2][i] += df[3 * n][0] * normal_2[n][i];
1843  d0factors[4][i] += df[3 * n][0] * normal_4[n][i];
1844 
1845  d1factors[2][i] += df[3 * n + 1][0] * normal_2[n][i];
1846  d1factors[4][i] += df[3 * n + 1][0] * normal_4[n][i];
1847 
1848  d2factors[2][i] += df[3 * n + 2][0] * normal_2[n][i];
1849  d2factors[4][i] += df[3 * n + 2][0] * normal_4[n][i];
1850  }
1851  }
1852  }
1853 }
const NormalVector & GetTraceNormal(const int id)
Definition: Expansion.cpp:250

References Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::StdExpansion::GetNumPoints(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::LocalRegions::Expansion::GetTraceNormal(), and Nektar::LocalRegions::Expansion::m_metricinfo.

◆ v_PhysDeriv() [1/2]

void Nektar::LocalRegions::HexExp::v_PhysDeriv ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d0,
Array< OneD, NekDouble > &  out_d1,
Array< OneD, NekDouble > &  out_d2 
)
protectedvirtual

Calculate the derivative of the physical points.

For Hexahedral region can use the Tensor_Deriv function defined under StdExpansion.

Parameters
inarrayInput array
out_d0Derivative of inarray in first direction.
out_d1Derivative of inarray in second direction.
out_d2Derivative of inarray in third direction.

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 151 of file HexExp.cpp.

155 {
156  int nquad0 = m_base[0]->GetNumPoints();
157  int nquad1 = m_base[1]->GetNumPoints();
158  int nquad2 = m_base[2]->GetNumPoints();
159  int ntot = nquad0 * nquad1 * nquad2;
160 
161  Array<TwoD, const NekDouble> df =
162  m_metricinfo->GetDerivFactors(GetPointsKeys());
163  Array<OneD, NekDouble> Diff0 = Array<OneD, NekDouble>(ntot);
164  Array<OneD, NekDouble> Diff1 = Array<OneD, NekDouble>(ntot);
165  Array<OneD, NekDouble> Diff2 = Array<OneD, NekDouble>(ntot);
166 
167  StdHexExp::v_PhysDeriv(inarray, Diff0, Diff1, Diff2);
168 
169  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
170  {
171  if (out_d0.size())
172  {
173  Vmath::Vmul(ntot, &df[0][0], 1, &Diff0[0], 1, &out_d0[0], 1);
174  Vmath::Vvtvp(ntot, &df[1][0], 1, &Diff1[0], 1, &out_d0[0], 1,
175  &out_d0[0], 1);
176  Vmath::Vvtvp(ntot, &df[2][0], 1, &Diff2[0], 1, &out_d0[0], 1,
177  &out_d0[0], 1);
178  }
179 
180  if (out_d1.size())
181  {
182  Vmath::Vmul(ntot, &df[3][0], 1, &Diff0[0], 1, &out_d1[0], 1);
183  Vmath::Vvtvp(ntot, &df[4][0], 1, &Diff1[0], 1, &out_d1[0], 1,
184  &out_d1[0], 1);
185  Vmath::Vvtvp(ntot, &df[5][0], 1, &Diff2[0], 1, &out_d1[0], 1,
186  &out_d1[0], 1);
187  }
188 
189  if (out_d2.size())
190  {
191  Vmath::Vmul(ntot, &df[6][0], 1, &Diff0[0], 1, &out_d2[0], 1);
192  Vmath::Vvtvp(ntot, &df[7][0], 1, &Diff1[0], 1, &out_d2[0], 1,
193  &out_d2[0], 1);
194  Vmath::Vvtvp(ntot, &df[8][0], 1, &Diff2[0], 1, &out_d2[0], 1,
195  &out_d2[0], 1);
196  }
197  }
198  else // regular geometry
199  {
200  if (out_d0.size())
201  {
202  Vmath::Smul(ntot, df[0][0], &Diff0[0], 1, &out_d0[0], 1);
203  Blas::Daxpy(ntot, df[1][0], &Diff1[0], 1, &out_d0[0], 1);
204  Blas::Daxpy(ntot, df[2][0], &Diff2[0], 1, &out_d0[0], 1);
205  }
206 
207  if (out_d1.size())
208  {
209  Vmath::Smul(ntot, df[3][0], &Diff0[0], 1, &out_d1[0], 1);
210  Blas::Daxpy(ntot, df[4][0], &Diff1[0], 1, &out_d1[0], 1);
211  Blas::Daxpy(ntot, df[5][0], &Diff2[0], 1, &out_d1[0], 1);
212  }
213 
214  if (out_d2.size())
215  {
216  Vmath::Smul(ntot, df[6][0], &Diff0[0], 1, &out_d2[0], 1);
217  Blas::Daxpy(ntot, df[7][0], &Diff1[0], 1, &out_d2[0], 1);
218  Blas::Daxpy(ntot, df[8][0], &Diff2[0], 1, &out_d2[0], 1);
219  }
220  }
221 }
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.
Definition: Blas.hpp:154

References Blas::Daxpy(), Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_metricinfo, Vmath::Smul(), Vmath::Vmul(), and Vmath::Vvtvp().

◆ v_PhysDeriv() [2/2]

void Nektar::LocalRegions::HexExp::v_PhysDeriv ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Calculate the derivative of the physical points in a single direction.

Parameters
dirDirection in which to compute derivative. Valid values are 0, 1, 2.
inarrayInput array.
outarrayOutput array.

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 232 of file HexExp.cpp.

235 {
236  switch (dir)
237  {
238  case 0:
239  {
240  PhysDeriv(inarray, outarray, NullNekDouble1DArray,
242  }
243  break;
244  case 1:
245  {
246  PhysDeriv(inarray, NullNekDouble1DArray, outarray,
248  }
249  break;
250  case 2:
251  {
253  outarray);
254  }
255  break;
256  default:
257  {
258  ASSERTL1(false, "input dir is out of range");
259  }
260  break;
261  }
262 }
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)
Definition: StdExpansion.h:850
static Array< OneD, NekDouble > NullNekDouble1DArray

References ASSERTL1, Nektar::NullNekDouble1DArray, and Nektar::StdRegions::StdExpansion::PhysDeriv().

◆ v_PhysDirectionalDeriv()

void Nektar::LocalRegions::HexExp::v_PhysDirectionalDeriv ( const Array< OneD, const NekDouble > &  inarray,
const Array< OneD, const NekDouble > &  direction,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Physical derivative along a direction vector.

See also
StdRegions::StdExpansion::PhysDirectionalDeriv

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 264 of file HexExp.cpp.

268 {
269 
270  int shapedim = 3;
271  int nquad0 = m_base[0]->GetNumPoints();
272  int nquad1 = m_base[1]->GetNumPoints();
273  int nquad2 = m_base[2]->GetNumPoints();
274  int ntot = nquad0 * nquad1 * nquad2;
275 
276  Array<TwoD, const NekDouble> df =
277  m_metricinfo->GetDerivFactors(GetPointsKeys());
278  Array<OneD, NekDouble> Diff0 = Array<OneD, NekDouble>(ntot);
279  Array<OneD, NekDouble> Diff1 = Array<OneD, NekDouble>(ntot);
280  Array<OneD, NekDouble> Diff2 = Array<OneD, NekDouble>(ntot);
281 
282  StdHexExp::v_PhysDeriv(inarray, Diff0, Diff1, Diff2);
283 
284  Array<OneD, Array<OneD, NekDouble>> dfdir(shapedim);
285  Expansion::ComputeGmatcdotMF(df, direction, dfdir);
286 
287  Vmath::Vmul(ntot, &dfdir[0][0], 1, &Diff0[0], 1, &outarray[0], 1);
288  Vmath::Vvtvp(ntot, &dfdir[1][0], 1, &Diff1[0], 1, &outarray[0], 1,
289  &outarray[0], 1);
290  Vmath::Vvtvp(ntot, &dfdir[2][0], 1, &Diff2[0], 1, &outarray[0], 1,
291  &outarray[0], 1);
292 }

References Nektar::LocalRegions::Expansion::ComputeGmatcdotMF(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_metricinfo, Vmath::Vmul(), and Vmath::Vvtvp().

◆ v_PhysEvaluate()

NekDouble Nektar::LocalRegions::HexExp::v_PhysEvaluate ( const Array< OneD, const NekDouble > &  coords,
const Array< OneD, const NekDouble > &  physvals 
)
protectedvirtual

This function evaluates the expansion at a single (arbitrary) point of the domain.

Based on the value of the expansion at the quadrature points, this function calculates the value of the expansion at an arbitrary single points (with coordinates \( \mathbf{x_c}\) given by the pointer coords). This operation, equivalent to

\[ u(\mathbf{x_c}) = \sum_p \phi_p(\mathbf{x_c}) \hat{u}_p \]

is evaluated using Lagrangian interpolants through the quadrature points:

\[ u(\mathbf{x_c}) = \sum_p h_p(\mathbf{x_c}) u_p\]

This function requires that the physical value array \(\mathbf{u}\) (implemented as the attribute #phys) is set.

Parameters
coordsthe coordinates of the single point
Returns
returns the value of the expansion at the single point

Reimplemented from Nektar::StdRegions::StdExpansion3D.

Definition at line 629 of file HexExp.cpp.

631 {
632  Array<OneD, NekDouble> Lcoord = Array<OneD, NekDouble>(3);
633 
634  ASSERTL0(m_geom, "m_geom not defined");
635  m_geom->GetLocCoords(coord, Lcoord);
636  return StdHexExp::v_PhysEvaluate(Lcoord, physvals);
637 }

References ASSERTL0, and Nektar::LocalRegions::Expansion::m_geom.

◆ v_ReduceOrderCoeffs()

void Nektar::LocalRegions::HexExp::v_ReduceOrderCoeffs ( int  numMin,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

This function is used to compute exactly the advective numerical flux on the interface of two elements with different expansions, hence an appropriate number of Gauss points has to be used. The number of Gauss points has to be equal to the number used by the highest polynomial degree of the two adjacent elements

Parameters
numMinIs the reduced polynomial order
inarrayInput array of coefficients
dumpVarOutput array of reduced coefficients.

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1311 of file HexExp.cpp.

1314 {
1315  int n_coeffs = inarray.size();
1316  int nmodes0 = m_base[0]->GetNumModes();
1317  int nmodes1 = m_base[1]->GetNumModes();
1318  int nmodes2 = m_base[2]->GetNumModes();
1319  int numMax = nmodes0;
1320 
1321  Array<OneD, NekDouble> coeff(n_coeffs);
1322  Array<OneD, NekDouble> coeff_tmp1(nmodes0 * nmodes1, 0.0);
1323  Array<OneD, NekDouble> coeff_tmp2(n_coeffs, 0.0);
1324  Array<OneD, NekDouble> tmp, tmp2, tmp3, tmp4;
1325 
1326  Vmath::Vcopy(n_coeffs, inarray, 1, coeff_tmp2, 1);
1327 
1328  const LibUtilities::PointsKey Pkey0(nmodes0,
1330  const LibUtilities::PointsKey Pkey1(nmodes1,
1332  const LibUtilities::PointsKey Pkey2(nmodes2,
1334 
1335  LibUtilities::BasisKey b0(m_base[0]->GetBasisType(), nmodes0, Pkey0);
1336  LibUtilities::BasisKey b1(m_base[1]->GetBasisType(), nmodes1, Pkey1);
1337  LibUtilities::BasisKey b2(m_base[2]->GetBasisType(), nmodes2, Pkey2);
1338  LibUtilities::BasisKey bortho0(LibUtilities::eOrtho_A, nmodes0, Pkey0);
1339  LibUtilities::BasisKey bortho1(LibUtilities::eOrtho_A, nmodes1, Pkey1);
1340  LibUtilities::BasisKey bortho2(LibUtilities::eOrtho_A, nmodes2, Pkey2);
1341 
1342  LibUtilities::InterpCoeff3D(b0, b1, b2, coeff_tmp2, bortho0, bortho1,
1343  bortho2, coeff);
1344 
1345  Vmath::Zero(n_coeffs, coeff_tmp2, 1);
1346 
1347  int cnt = 0, cnt2 = 0;
1348 
1349  for (int u = 0; u < numMin + 1; ++u)
1350  {
1351  for (int i = 0; i < numMin; ++i)
1352  {
1353  Vmath::Vcopy(numMin, tmp = coeff + cnt + cnt2, 1,
1354  tmp2 = coeff_tmp1 + cnt, 1);
1355 
1356  cnt = i * numMax;
1357  }
1358 
1359  Vmath::Vcopy(nmodes0 * nmodes1, tmp3 = coeff_tmp1, 1,
1360  tmp4 = coeff_tmp2 + cnt2, 1);
1361 
1362  cnt2 = u * nmodes0 * nmodes1;
1363  }
1364 
1365  LibUtilities::InterpCoeff3D(bortho0, bortho1, bortho2, coeff_tmp2, b0, b1,
1366  b2, outarray);
1367 }
void InterpCoeff3D(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)
@ eOrtho_A
Principle Orthogonal Functions .
Definition: BasisType.h:44

References Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eOrtho_A, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::LibUtilities::InterpCoeff3D(), Nektar::StdRegions::StdExpansion::m_base, Vmath::Vcopy(), and Vmath::Zero().

◆ v_StdPhysEvaluate()

NekDouble Nektar::LocalRegions::HexExp::v_StdPhysEvaluate ( const Array< OneD, const NekDouble > &  Lcoord,
const Array< OneD, const NekDouble > &  physvals 
)
protectedvirtual

Given the local cartesian coordinate Lcoord evaluate the value of physvals at this point by calling through to the StdExpansion method

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 621 of file HexExp.cpp.

624 {
625  // Evaluate point in local coordinates.
626  return StdHexExp::v_PhysEvaluate(Lcoord, physvals);
627 }

◆ v_SVVLaplacianFilter()

void Nektar::LocalRegions::HexExp::v_SVVLaplacianFilter ( Array< OneD, NekDouble > &  array,
const StdRegions::StdMatrixKey mkey 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 1369 of file HexExp.cpp.

1371 {
1372  int nq = GetTotPoints();
1373 
1374  // Calculate sqrt of the Jacobian
1375  Array<OneD, const NekDouble> jac = m_metricinfo->GetJac(GetPointsKeys());
1376  Array<OneD, NekDouble> sqrt_jac(nq);
1377  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1378  {
1379  Vmath::Vsqrt(nq, jac, 1, sqrt_jac, 1);
1380  }
1381  else
1382  {
1383  Vmath::Fill(nq, sqrt(jac[0]), sqrt_jac, 1);
1384  }
1385 
1386  // Multiply array by sqrt(Jac)
1387  Vmath::Vmul(nq, sqrt_jac, 1, array, 1, array, 1);
1388 
1389  // Apply std region filter
1390  StdHexExp::v_SVVLaplacianFilter(array, mkey);
1391 
1392  // Divide by sqrt(Jac)
1393  Vmath::Vdiv(nq, array, 1, sqrt_jac, 1, array, 1);
1394 }
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.
Definition: Vmath.cpp:284

References Nektar::SpatialDomains::eDeformed, Vmath::Fill(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::LocalRegions::Expansion::m_metricinfo, tinysimd::sqrt(), Vmath::Vdiv(), Vmath::Vmul(), and Vmath::Vsqrt().

◆ v_WeakDerivMatrixOp()

void Nektar::LocalRegions::HexExp::v_WeakDerivMatrixOp ( const int  i,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdHexExp.

Definition at line 1219 of file HexExp.cpp.

1223 {
1224  StdExpansion::WeakDerivMatrixOp_MatFree(i, inarray, outarray, mkey);
1225 }

◆ v_WeakDirectionalDerivMatrixOp()

void Nektar::LocalRegions::HexExp::v_WeakDirectionalDerivMatrixOp ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdRegions::StdMatrixKey mkey 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1227 of file HexExp.cpp.

1230 {
1231  StdExpansion::WeakDirectionalDerivMatrixOp_MatFree(inarray, outarray, mkey);
1232 }

Member Data Documentation

◆ m_matrixManager

LibUtilities::NekManager<MatrixKey, DNekScalMat, MatrixKey::opLess> Nektar::LocalRegions::HexExp::m_matrixManager
private

Definition at line 249 of file HexExp.h.

Referenced by IProductWRTDerivBase_MatOp(), v_FwdTrans(), and v_GetLocMatrix().

◆ m_staticCondMatrixManager

LibUtilities::NekManager<MatrixKey, DNekScalBlkMat, MatrixKey::opLess> Nektar::LocalRegions::HexExp::m_staticCondMatrixManager
private

Definition at line 251 of file HexExp.h.

Referenced by v_DropLocStaticCondMatrix(), and v_GetLocStaticCondMatrix().