Nektar++
Public Member Functions | Protected Member Functions | List of all members
Nektar::StdRegions::StdHexExp Class Reference

Class representing a hexehedral element in reference space. More...

#include <StdHexExp.h>

Inheritance diagram for Nektar::StdRegions::StdHexExp:
[legend]

Public Member Functions

 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)
 
- 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 GetNedges () const
 This function returns the number of edges of the expansion domain. More...
 
int GetEdgeNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge. More...
 
int GetTotalEdgeIntNcoeffs () const
 
int GetEdgeNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th edge. More...
 
int DetCartesianDirOfEdge (const int edge)
 
const LibUtilities::BasisKey DetEdgeBasisKey (const int i) const
 
const LibUtilities::BasisKey DetFaceBasisKey (const int i, const int k) const
 
int GetFaceNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th face. More...
 
int GetFaceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th face. More...
 
int GetFaceIntNcoeffs (const int i) const
 
int GetTotalFaceIntNcoeffs () const
 
int GetTraceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge/face. More...
 
LibUtilities::PointsKey GetFacePointsKey (const int i, const int j) const
 
int NumBndryCoeffs (void) const
 
int NumDGBndryCoeffs (void) const
 
LibUtilities::BasisType GetEdgeBasisType (const int i) const
 This function returns the type of expansion basis on the i-th edge. More...
 
const LibUtilities::PointsKey GetNodalPointsKey () const
 This function returns the type of expansion Nodal point type if defined. More...
 
int GetNfaces () const
 This function returns the number of faces of the expansion domain. More...
 
int GetNtrace () 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 FwdTrans_BndConstrained (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)
 
IndexMapValuesSharedPtr GetIndexMap (const IndexMapKey &ikey)
 
const Array< OneD, const NekDouble > & GetPhysNormals (void)
 
void SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
virtual void SetUpPhysNormals (const int edge)
 
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)
 
StdRegions::Orientation GetForient (int face)
 
StdRegions::Orientation GetEorient (int edge)
 
void SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
 
void SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
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 GetEdgeInteriorMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
void GetFaceNumModes (const int fid, const Orientation faceOrient, int &numModes0, int &numModes1)
 
void GetFaceInteriorMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
void GetEdgeToElementMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int P=-1)
 
void GetFaceToElementMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int nummodesA=-1, int nummodesB=-1)
 
void GetEdgePhysVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Extract the physical values along edge edge from inarray into outarray following the local edge orientation and point distribution defined by defined in EdgeExp. More...
 
void GetEdgePhysVals (const int edge, const std::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetTracePhysVals (const int edge, const std::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetVertexPhysVals (const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
 
void GetEdgeInterpVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetEdgeQFactors (const int edge, 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 GetFacePhysVals (const int face, const std::shared_ptr< StdExpansion > &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=eNoOrientation)
 
void GetEdgePhysMap (const int edge, Array< OneD, int > &outarray)
 
void GetFacePhysMap (const int face, Array< OneD, int > &outarray)
 
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)
 
void AddRobinMassMatrix (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
 
void AddRobinEdgeContribution (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, Array< OneD, NekDouble > &coeffs)
 
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...
 
void LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 Convert local cartesian coordinate xi into local collapsed coordinates eta. More...
 
virtual int v_GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals (void)
 
virtual void v_SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
virtual void v_SetUpPhysNormals (const int edge)
 
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)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray)
 
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual void v_DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual StdRegions::Orientation v_GetForient (int face)
 
virtual StdRegions::Orientation v_GetEorient (int edge)
 
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 NormalVectorGetEdgeNormal (const int edge) const
 
void ComputeEdgeNormal (const int edge)
 
void NegateEdgeNormal (const int edge)
 
bool EdgeNormalNegated (const int edge)
 
void ComputeFaceNormal (const int face)
 
void NegateFaceNormal (const int face)
 
bool FaceNormalNegated (const int face)
 
void ComputeVertexNormal (const int vertex)
 
void NegateVertexNormal (const int vertex)
 
bool VertexNormalNegated (const int vertex)
 
const NormalVectorGetFaceNormal (const int face) const
 
const NormalVectorGetVertexNormal (const int vertex) const
 
const NormalVectorGetSurfaceNormal (const int id) const
 
const LibUtilities::PointsKeyVector GetPointsKeys () const
 
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap (int eid)
 
Array< OneD, unsigned int > GetFaceInverseBoundaryMap (int fid, StdRegions::Orientation faceOrient=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)
 
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)
 

Protected Member Functions

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)
 Differentiation Methods. More...
 
virtual void v_PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
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_FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTBase_MatOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multbyweights=true)
 
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 (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
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_FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 
virtual int v_GetNverts () const
 
virtual int v_GetNedges () const
 
virtual int v_GetNfaces () const
 
virtual LibUtilities::ShapeType v_DetShapeType () const
 
virtual int v_NumBndryCoeffs () const
 
virtual int v_NumDGBndryCoeffs () const
 
virtual int v_GetEdgeNcoeffs (const int i) const
 
virtual int v_GetTotalEdgeIntNcoeffs () const
 
virtual int v_GetFaceNcoeffs (const int i) const
 
virtual int v_GetFaceIntNcoeffs (const int i) const
 
virtual int v_GetTotalFaceIntNcoeffs () const
 
virtual int v_GetFaceNumPoints (const int i) const
 
virtual LibUtilities::PointsKey v_GetFacePointsKey (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_DetFaceBasisKey (const int i, const int k) const
 
virtual LibUtilities::BasisType v_GetEdgeBasisType (const int i) const
 
virtual bool v_IsBoundaryInteriorExpansion ()
 
virtual void v_GetCoords (Array< OneD, NekDouble > &coords_x, Array< OneD, NekDouble > &coords_y, Array< OneD, NekDouble > &coords_z)
 
virtual void v_GetFaceNumModes (const int fid, const Orientation faceOrient, int &numModes0, int &numModes1)
 
virtual void v_GetFaceToElementMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int nummodesA=-1, int nummodesB=-1)
 
virtual int v_GetVertexMap (int localVertexId, bool useCoeffPacking=false)
 
virtual void v_GetEdgeInteriorMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
virtual void v_GetFaceInteriorMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
virtual void v_GetInteriorMap (Array< OneD, unsigned int > &outarray)
 
virtual void v_GetBoundaryMap (Array< OneD, unsigned int > &outarray)
 
virtual DNekMatSharedPtr v_GenMatrix (const StdMatrixKey &mkey)
 
virtual DNekMatSharedPtr v_CreateStdMatrix (const StdMatrixKey &mkey)
 
virtual void v_MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_GeneralMatrixOp_MatOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
 
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, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
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 NekDouble v_Integral (const Array< OneD, const NekDouble > &inarray)
 Integrates the specified function over the domain. More...
 
virtual void v_NegateFaceNormal (const int face)
 
virtual bool v_FaceNormalNegated (const int face)
 
virtual int v_GetTraceNcoeffs (const int i) const
 
- 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...
 
IndexMapValuesSharedPtr CreateIndexMap (const IndexMapKey &ikey)
 Create an IndexMap which contains mapping information linking any specific element shape with either its boundaries, edges, faces, verteces, etc. 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 (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
 
virtual NekDouble v_StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::StdRegions::StdExpansion3D
std::map< int, NormalVectorm_faceNormals
 
std::map< int, bool > m_negatedNormals
 
- 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
 
LibUtilities::NekManager< IndexMapKey, IndexMapValues, IndexMapKey::opLessm_IndexMapManager
 

Detailed Description

Class representing a hexehedral element in reference space.

Definition at line 47 of file StdHexExp.h.

Constructor & Destructor Documentation

◆ StdHexExp() [1/3]

Nektar::StdRegions::StdHexExp::StdHexExp ( )

Definition at line 48 of file StdHexExp.cpp.

49  {
50  }

◆ StdHexExp() [2/3]

Nektar::StdRegions::StdHexExp::StdHexExp ( const LibUtilities::BasisKey Ba,
const LibUtilities::BasisKey Bb,
const LibUtilities::BasisKey Bc 
)

Definition at line 53 of file StdHexExp.cpp.

55  :
56  StdExpansion(Ba.GetNumModes()*Bb.GetNumModes()*Bc.GetNumModes(), 3,
57  Ba, Bb, Bc),
58  StdExpansion3D(Ba.GetNumModes()*Bb.GetNumModes()*Bc.GetNumModes(),
59  Ba, Bb, Bc)
60  {
61  }
StdExpansion()
Default Constructor.

◆ StdHexExp() [3/3]

Nektar::StdRegions::StdHexExp::StdHexExp ( const StdHexExp T)

Definition at line 64 of file StdHexExp.cpp.

64  :
65  StdExpansion(T),
67  {
68  }

◆ ~StdHexExp()

Nektar::StdRegions::StdHexExp::~StdHexExp ( )

Definition at line 71 of file StdHexExp.cpp.

72  {
73  }

Member Function Documentation

◆ v_BwdTrans()

void Nektar::StdRegions::StdHexExp::v_BwdTrans ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Backward transformation is three dimensional tensorial expansion \( u (\xi_{1i}, \xi_{2j}, \xi_{3k}) = \sum_{p=0}^{Q_x} \psi_p^a (\xi_{1i}) \lbrace { \sum_{q=0}^{Q_y} \psi_{q}^a (\xi_{2j}) \lbrace { \sum_{r=0}^{Q_z} \hat u_{pqr} \psi_{r}^a (\xi_{3k}) \rbrace} \rbrace}. \) And sumfactorizing step of the form is as:\ \( f_{r} (\xi_{3k}) = \sum_{r=0}^{Q_z} \hat u_{pqr} \psi_{r}^a (\xi_{3k}),\\ g_{p} (\xi_{2j}, \xi_{3k}) = \sum_{r=0}^{Q_y} \psi_{p}^a (\xi_{2j}) f_{r} (\xi_{3k}),\\ u(\xi_{1i}, \xi_{2j}, \xi_{3k}) = \sum_{p=0}^{Q_x} \psi_{p}^a (\xi_{1i}) g_{p} (\xi_{2j}, \xi_{3k}). \)

Parameters
inarray?
outarray?

Implements Nektar::StdRegions::StdExpansion.

Definition at line 178 of file StdHexExp.cpp.

181  {
184  "Basis[1] is not a general tensor type");
185 
188  "Basis[2] is not a general tensor type");
189 
190  if(m_base[0]->Collocation() && m_base[1]->Collocation()
191  && m_base[2]->Collocation())
192  {
194  * m_base[1]->GetNumPoints()
195  * m_base[2]->GetNumPoints(),
196  inarray, 1, outarray, 1);
197  }
198  else
199  {
200  StdHexExp::BwdTrans_SumFac(inarray,outarray);
201  }
202  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:250
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164
void BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:228
Array< OneD, LibUtilities::BasisSharedPtr > m_base
@ eModified_B
Principle Modified Functions .
Definition: BasisType.h:49
@ eModified_C
Principle Modified Functions .
Definition: BasisType.h:50
@ eOrtho_C
Principle Orthogonal Functions .
Definition: BasisType.h:47
@ eOrtho_B
Principle Orthogonal Functions .
Definition: BasisType.h:46
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064

References ASSERTL1, Nektar::StdRegions::StdExpansion::BwdTrans_SumFac(), Nektar::LibUtilities::eModified_B, Nektar::LibUtilities::eModified_C, Nektar::LibUtilities::eOrtho_B, Nektar::LibUtilities::eOrtho_C, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::GetNumPoints(), Nektar::StdRegions::StdExpansion::m_base, and Vmath::Vcopy().

◆ v_BwdTrans_SumFac()

void Nektar::StdRegions::StdHexExp::v_BwdTrans_SumFac ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 208 of file StdHexExp.cpp.

210  {
211  Array<OneD, NekDouble> wsp(m_base[0]->GetNumPoints()*
212  m_base[2]->GetNumModes()*
213  (m_base[1]->GetNumModes() + m_base[1]->GetNumPoints())); // FIX THIS
214 
215  BwdTrans_SumFacKernel(m_base[0]->GetBdata(),
216  m_base[1]->GetBdata(),
217  m_base[2]->GetBdata(),
218  inarray,outarray,wsp,true,true,true);
219  }
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)

References Nektar::StdRegions::StdExpansion3D::BwdTrans_SumFacKernel(), Nektar::StdRegions::StdExpansion::GetNumPoints(), and Nektar::StdRegions::StdExpansion::m_base.

◆ v_BwdTrans_SumFacKernel()

void Nektar::StdRegions::StdHexExp::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 
)
protectedvirtual
Parameters
base0x-dirn basis matrix
base1y-dirn basis matrix
base2z-dirn basis matrix
inarrayInput vector of modes.
outarrayOutput vector of physical space data.
wspWorkspace of size Q_x*P_z*(P_y+Q_y)
doCheckCollDir0Check for collocation of basis.
doCheckCollDir1Check for collocation of basis.
doCheckCollDir2Check for collocation of basis.
Todo:
Account for some directions being collocated. See StdQuadExp as an example.

Implements Nektar::StdRegions::StdExpansion3D.

Definition at line 235 of file StdHexExp.cpp.

245  {
246  int nquad0 = m_base[0]->GetNumPoints();
247  int nquad1 = m_base[1]->GetNumPoints();
248  int nquad2 = m_base[2]->GetNumPoints();
249  int nmodes0 = m_base[0]->GetNumModes();
250  int nmodes1 = m_base[1]->GetNumModes();
251  int nmodes2 = m_base[2]->GetNumModes();
252 
253  // Check if using collocation, if requested.
254  bool colldir0 = doCheckCollDir0?(m_base[0]->Collocation()):false;
255  bool colldir1 = doCheckCollDir1?(m_base[1]->Collocation()):false;
256  bool colldir2 = doCheckCollDir2?(m_base[2]->Collocation()):false;
257 
258  // If collocation in all directions, Physical values at quadrature
259  // points is just a copy of the modes.
260  if(colldir0 && colldir1 && colldir2)
261  {
262  Vmath::Vcopy(m_ncoeffs,inarray.get(),1,outarray.get(),1);
263  }
264  else
265  {
266  // Check sufficiently large workspace.
267  ASSERTL1(wsp.num_elements()>=nquad0*nmodes2*(nmodes1+nquad1),
268  "Workspace size is not sufficient");
269 
270  // Assign second half of workspace for 2nd DGEMM operation.
271  Array<OneD, NekDouble> wsp2 = wsp + nquad0*nmodes1*nmodes2;
272 
273  // BwdTrans in each direction using DGEMM
274  Blas::Dgemm('T','T', nmodes1*nmodes2, nquad0, nmodes0,
275  1.0, &inarray[0], nmodes0,
276  base0.get(), nquad0,
277  0.0, &wsp[0], nmodes1*nmodes2);
278  Blas::Dgemm('T','T', nquad0*nmodes2, nquad1, nmodes1,
279  1.0, &wsp[0], nmodes1,
280  base1.get(), nquad1,
281  0.0, &wsp2[0], nquad0*nmodes2);
282  Blas::Dgemm('T','T', nquad0*nquad1, nquad2, nmodes2,
283  1.0, &wsp2[0], nmodes2,
284  base2.get(), nquad2,
285  0.0, &outarray[0], nquad0*nquad1);
286  }
287  }
static void Dgemm(const char &transa, const char &transb, const int &m, const int &n, const int &k, const double &alpha, const double *a, const int &lda, const double *b, const int &ldb, const double &beta, double *c, const int &ldc)
BLAS level 3: Matrix-matrix multiply C = A x B where A[m x n], B[n x k], C[m x k].
Definition: Blas.hpp:213

References ASSERTL1, Blas::Dgemm(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, and Vmath::Vcopy().

◆ v_CalcNumberOfCoefficients()

int Nektar::StdRegions::StdHexExp::v_CalcNumberOfCoefficients ( const std::vector< unsigned int > &  nummodes,
int &  modes_offset 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 839 of file StdHexExp.cpp.

840  {
841  int nmodes = nummodes[modes_offset]*nummodes[modes_offset+1]*nummodes[modes_offset+2];
842  modes_offset += 3;
843 
844  return nmodes;
845  }

◆ v_CreateStdMatrix()

DNekMatSharedPtr Nektar::StdRegions::StdHexExp::v_CreateStdMatrix ( const StdMatrixKey mkey)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 2263 of file StdHexExp.cpp.

2264  {
2265  return StdExpansion::CreateGeneralMatrix(mkey);
2266  }
DNekMatSharedPtr CreateGeneralMatrix(const StdMatrixKey &mkey)
this function generates the mass matrix

References Nektar::StdRegions::StdExpansion::CreateGeneralMatrix().

◆ v_DetFaceBasisKey()

const LibUtilities::BasisKey Nektar::StdRegions::StdHexExp::v_DetFaceBasisKey ( const int  i,
const int  k 
) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 848 of file StdHexExp.cpp.

850  {
851  ASSERTL2(i >= 0 && i <= 5, "face id is out of range");
852  ASSERTL2(k >= 0 && k <= 1, "basis key id is out of range");
853 
854  int dir = k;
855  switch(i)
856  {
857  case 0:
858  case 5:
859  dir = k;
860  break;
861  case 1:
862  case 3:
863  dir = 2*k;
864  break;
865  case 2:
866  case 4:
867  dir = k+1;
868  break;
869  }
870 
871  return EvaluateQuadFaceBasisKey(k,
872  m_base[dir]->GetBasisType(),
873  m_base[dir]->GetNumPoints(),
874  m_base[dir]->GetNumModes());
875  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
Definition: ErrorUtil.hpp:274
LibUtilities::BasisKey EvaluateQuadFaceBasisKey(const int facedir, const LibUtilities::BasisType faceDirBasisType, const int numpoints, const int nummodes)

References ASSERTL2, Nektar::StdRegions::EvaluateQuadFaceBasisKey(), Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::GetNumPoints(), and Nektar::StdRegions::StdExpansion::m_base.

◆ v_DetShapeType()

LibUtilities::ShapeType Nektar::StdRegions::StdHexExp::v_DetShapeType ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 684 of file StdHexExp.cpp.

685  {
687  }

References Nektar::LibUtilities::eHexahedron.

◆ v_ExponentialFilter()

void Nektar::StdRegions::StdHexExp::v_ExponentialFilter ( Array< OneD, NekDouble > &  array,
const NekDouble  alpha,
const NekDouble  exponent,
const NekDouble  cutoff 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 2497 of file StdHexExp.cpp.

2502  {
2503  // Generate an orthogonal expansion
2504  int qa = m_base[0]->GetNumPoints();
2505  int qb = m_base[1]->GetNumPoints();
2506  int qc = m_base[2]->GetNumPoints();
2507  int nmodesA = m_base[0]->GetNumModes();
2508  int nmodesB = m_base[1]->GetNumModes();
2509  int nmodesC = m_base[2]->GetNumModes();
2510  int P = nmodesA - 1;
2511  int Q = nmodesB - 1;
2512  int R = nmodesC - 1;
2513 
2514  // Declare orthogonal basis.
2515  LibUtilities::PointsKey pa(qa,m_base[0]->GetPointsType());
2516  LibUtilities::PointsKey pb(qb,m_base[1]->GetPointsType());
2517  LibUtilities::PointsKey pc(qc,m_base[2]->GetPointsType());
2518 
2519  LibUtilities::BasisKey Ba(LibUtilities::eOrtho_A, nmodesA, pa);
2520  LibUtilities::BasisKey Bb(LibUtilities::eOrtho_A, nmodesB, pb);
2521  LibUtilities::BasisKey Bc(LibUtilities::eOrtho_A, nmodesC, pc);
2522  StdHexExp OrthoExp(Ba,Bb,Bc);
2523 
2524  // Cutoff
2525  int Pcut = cutoff*P;
2526  int Qcut = cutoff*Q;
2527  int Rcut = cutoff*R;
2528 
2529  // Project onto orthogonal space.
2530  Array<OneD, NekDouble> orthocoeffs(OrthoExp.GetNcoeffs());
2531  OrthoExp.FwdTrans(array,orthocoeffs);
2532 
2533  //
2534  NekDouble fac, fac1, fac2, fac3;
2535  int index = 0;
2536  for(int i = 0; i < nmodesA; ++i)
2537  {
2538  for(int j = 0; j < nmodesB; ++j)
2539  {
2540  for(int k = 0; k < nmodesC; ++k, ++index)
2541  {
2542  //to filter out only the "high-modes"
2543  if(i > Pcut || j > Qcut || k > Rcut)
2544  {
2545  fac1 = (NekDouble) (i - Pcut)/( (NekDouble)(P - Pcut) );
2546  fac2 = (NekDouble) (j - Qcut)/( (NekDouble)(Q - Qcut) );
2547  fac3 = (NekDouble) (k - Rcut)/( (NekDouble)(R - Rcut) );
2548  fac = max( max(fac1, fac2), fac3);
2549  fac = pow(fac, exponent);
2550  orthocoeffs[index] *= exp(-alpha*fac);
2551  }
2552  }
2553  }
2554  }
2555 
2556  // backward transform to physical space
2557  OrthoExp.BwdTrans(orthocoeffs,array);
2558  }
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
Definition: StdExpansion.h:215
@ eOrtho_A
Principle Orthogonal Functions .
Definition: BasisType.h:45
double NekDouble
P
Definition: main.py:133

References Nektar::StdRegions::StdExpansion::BwdTrans(), Nektar::LibUtilities::eOrtho_A, Nektar::StdRegions::StdExpansion::FwdTrans(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::StdRegions::StdExpansion::m_base, and main::P.

◆ v_FillMode()

void Nektar::StdRegions::StdHexExp::v_FillMode ( const int  mode,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual
Note
for hexahedral expansions _base0 modes run fastest.

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 618 of file StdHexExp.cpp.

620  {
621  int i,j;
622  int nquad0 = m_base[0]->GetNumPoints();
623  int nquad1 = m_base[1]->GetNumPoints();
624  int nquad2 = m_base[2]->GetNumPoints();
625 
626  Array<OneD, const NekDouble> base0 = m_base[0]->GetBdata();
627  Array<OneD, const NekDouble> base1 = m_base[1]->GetBdata();
628  Array<OneD, const NekDouble> base2 = m_base[2]->GetBdata();
629 
630  int btmp0 = m_base[0]->GetNumModes();
631  int btmp1 = m_base[1]->GetNumModes();
632  int mode2 = mode/(btmp0*btmp1);
633  int mode1 = (mode-mode2*btmp0*btmp1)/btmp0;
634  int mode0 = (mode-mode2*btmp0*btmp1)%btmp0;
635 
636  ASSERTL2(mode == mode2 * btmp0 * btmp1 + mode1 * btmp0 + mode0,
637  "Mode lookup failed.");
638  ASSERTL2(mode < m_ncoeffs,
639  "Calling argument mode is larger than total expansion "
640  "order");
641 
642  for(i = 0; i < nquad1*nquad2; ++i)
643  {
644  Vmath::Vcopy(nquad0,(NekDouble *)(base0.get() + mode0*nquad0),1,
645  &outarray[0]+i*nquad0, 1);
646  }
647 
648  for(j = 0; j < nquad2; ++j)
649  {
650  for(i = 0; i < nquad0; ++i)
651  {
652  Vmath::Vmul(nquad1,(NekDouble *)(base1.get() + mode1*nquad1),1,
653  &outarray[0]+i+j*nquad0*nquad1, nquad0,
654  &outarray[0]+i+j*nquad0*nquad1, nquad0);
655  }
656  }
657 
658  for(i = 0; i < nquad2; i++)
659  {
660  Blas::Dscal(nquad0*nquad1,base2[mode2*nquad2+i],
661  &outarray[0]+i*nquad0*nquad1,1);
662  }
663  }
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
Definition: Blas.hpp:125
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:186

References ASSERTL2, Blas::Dscal(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, Vmath::Vcopy(), and Vmath::Vmul().

◆ v_FwdTrans()

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

Solves the system \( \mathbf{B^{\top}WB\hat{u}}=\mathbf{B^{\top}Wu^{\delta}} \)

Parameters
inarrayarray of physical quadrature points to be transformed, \( \mathbf{u^{\delta}} \).
outarrayarray of expansion coefficients, \( \mathbf{\hat{u}} \).

Implements Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 299 of file StdHexExp.cpp.

302  {
303  // If using collocation expansion, coefficients match physical
304  // data points so just do a direct copy.
305  if( (m_base[0]->Collocation())
306  &&(m_base[1]->Collocation())
307  &&(m_base[2]->Collocation()) )
308  {
309  Vmath::Vcopy(GetNcoeffs(), &inarray[0], 1, &outarray[0], 1);
310  }
311  else
312  {
313  // Compute B^TWu
314  IProductWRTBase(inarray,outarray);
315 
316  // get Mass matrix inverse
317  StdMatrixKey masskey(eInvMass,DetShapeType(),*this);
318  DNekMatSharedPtr matsys = GetStdMatrix(masskey);
319 
320  // copy inarray in case inarray == outarray
321  DNekVec in (m_ncoeffs,outarray);
322  DNekVec out(m_ncoeffs,outarray,eWrapper);
323 
324  // Solve for coefficients.
325  out = (*matsys)*in;
326 
327  }
328  }
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:130
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:714
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:634
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:469
NekVector< NekDouble > DNekVec
Definition: NekTypeDefs.hpp:48
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69

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

◆ v_GeneralMatrixOp_MatOp()

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

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 2315 of file StdHexExp.cpp.

2319  {
2321 
2322  if(inarray.get() == outarray.get())
2323  {
2324  Array<OneD,NekDouble> tmp(m_ncoeffs);
2325  Vmath::Vcopy(m_ncoeffs,inarray.get(),1,tmp.get(),1);
2326 
2327  Blas::Dgemv('N', m_ncoeffs, m_ncoeffs, 1.0, mat->GetPtr().get(),
2328  m_ncoeffs, tmp.get(), 1, 0.0, outarray.get(), 1);
2329  }
2330  else
2331  {
2332  Blas::Dgemv('N', m_ncoeffs, m_ncoeffs, 1.0, mat->GetPtr().get(),
2333  m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
2334  }
2335  }
LibUtilities::NekManager< StdMatrixKey, DNekMat, StdMatrixKey::opLess > m_stdMatrixManager
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:168

References Blas::Dgemv(), Nektar::StdRegions::StdExpansion::m_ncoeffs, Nektar::StdRegions::StdExpansion::m_stdMatrixManager, and Vmath::Vcopy().

◆ v_GenMatrix()

DNekMatSharedPtr Nektar::StdRegions::StdHexExp::v_GenMatrix ( const StdMatrixKey mkey)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 2257 of file StdHexExp.cpp.

2258  {
2259  return StdExpansion::CreateGeneralMatrix(mkey);
2260  }

References Nektar::StdRegions::StdExpansion::CreateGeneralMatrix().

◆ v_GetBoundaryMap()

void Nektar::StdRegions::StdHexExp::v_GetBoundaryMap ( Array< OneD, unsigned int > &  outarray)
protectedvirtual
Parameters
outarrayStorage for computed map.

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 2166 of file StdHexExp.cpp.

2167  {
2170  "BasisType is not a boundary interior form");
2173  "BasisType is not a boundary interior form");
2176  "BasisType is not a boundary interior form");
2177 
2178  int i;
2179  int nummodes [3] = {m_base[0]->GetNumModes(),
2180  m_base[1]->GetNumModes(),
2181  m_base[2]->GetNumModes()};
2182 
2183  int nBndCoeffs = NumBndryCoeffs();
2184 
2185  if(outarray.num_elements()!=nBndCoeffs)
2186  {
2187  outarray = Array<OneD, unsigned int>(nBndCoeffs);
2188  }
2189 
2190  const LibUtilities::BasisType Btype [3] = {GetBasisType(0),
2191  GetBasisType(1),
2192  GetBasisType(2)};
2193 
2194  int p,q,r;
2195  int cnt = 0;
2196 
2197  int BndIdx [3][2];
2198  int IntIdx [3][2];
2199 
2200  for(i = 0; i < 3; i++)
2201  {
2202  BndIdx[i][0] = 0;
2203 
2204  if( Btype[i] == LibUtilities::eModified_A)
2205  {
2206  BndIdx[i][1] = 1;
2207  IntIdx[i][0] = 2;
2208  IntIdx[i][1] = nummodes[i];
2209  }
2210  else
2211  {
2212  BndIdx[i][1] = nummodes[i]-1;
2213  IntIdx[i][0] = 1;
2214  IntIdx[i][1] = nummodes[i]-1;
2215  }
2216  }
2217 
2218 
2219  for(i = 0; i < 2; i++)
2220  {
2221  r = BndIdx[2][i];
2222  for( q = 0; q < nummodes[1]; q++)
2223  {
2224  for( p = 0; p < nummodes[0]; p++)
2225  {
2226  outarray[cnt++] = r*nummodes[0]*nummodes[1]+q*nummodes[0] + p;
2227  }
2228  }
2229  }
2230 
2231  for(r = IntIdx[2][0]; r < IntIdx[2][1]; r++)
2232  {
2233  for( i = 0; i < 2; i++)
2234  {
2235  q = BndIdx[1][i];
2236  for( p = 0; p < nummodes[0]; p++)
2237  {
2238  outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2239  q*nummodes[0] + p;
2240  }
2241  }
2242 
2243  for( q = IntIdx[1][0]; q < IntIdx[1][1]; q++)
2244  {
2245  for( i = 0; i < 2; i++)
2246  {
2247  p = BndIdx[0][i];
2248  outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2249  q*nummodes[0] + p;
2250  }
2251  }
2252  }
2253 
2254  sort(outarray.get(), outarray.get() + nBndCoeffs);
2255  }
@ eGLL_Lagrange
Lagrange for SEM basis .
Definition: BasisType.h:54
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:48

References ASSERTL1, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::NumBndryCoeffs(), and CellMLToNektar.cellml_metadata::p.

◆ v_GetCoords()

void Nektar::StdRegions::StdHexExp::v_GetCoords ( Array< OneD, NekDouble > &  coords_x,
Array< OneD, NekDouble > &  coords_y,
Array< OneD, NekDouble > &  coords_z 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 895 of file StdHexExp.cpp.

898  {
899  Array<OneD, const NekDouble> eta_x = m_base[0]->GetZ();
900  Array<OneD, const NekDouble> eta_y = m_base[1]->GetZ();
901  Array<OneD, const NekDouble> eta_z = m_base[2]->GetZ();
902  int Qx = GetNumPoints(0);
903  int Qy = GetNumPoints(1);
904  int Qz = GetNumPoints(2);
905 
906  // Convert collapsed coordinates into cartesian coordinates:
907  // eta --> xi
908  for( int k = 0; k < Qz; ++k ) {
909  for( int j = 0; j < Qy; ++j ) {
910  for( int i = 0; i < Qx; ++i ) {
911  int s = i + Qx*(j + Qy*k);
912  xi_x[s] = eta_x[i];
913  xi_y[s] = eta_y[j];
914  xi_z[s] = eta_z[k];
915 
916  }
917  }
918  }
919  }

References Nektar::StdRegions::StdExpansion::GetNumPoints(), and Nektar::StdRegions::StdExpansion::m_base.

◆ v_GetEdgeBasisType()

LibUtilities::BasisType Nektar::StdRegions::StdHexExp::v_GetEdgeBasisType ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 877 of file StdHexExp.cpp.

878  {
879  ASSERTL2((i >= 0)&&(i <= 11),"edge id is out of range");
880 
881  if((i == 0)||(i == 2)||(i==8)||(i==10))
882  {
883  return GetBasisType(0);
884  }
885  else if((i == 1)||(i == 3)||(i == 9)||(i == 11))
886  {
887  return GetBasisType(1);
888  }
889  else
890  {
891  return GetBasisType(2);
892  }
893  }

References ASSERTL2, and Nektar::StdRegions::StdExpansion::GetBasisType().

◆ v_GetEdgeInteriorMap()

void Nektar::StdRegions::StdHexExp::v_GetEdgeInteriorMap ( const int  eid,
const Orientation  edgeOrient,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray 
)
protectedvirtual
Parameters
eidThe edge to compute the numbering for.
edgeOrientOrientation of the edge.
maparrayStorage for computed mapping array.
signarray?

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1464 of file StdHexExp.cpp.

1468  {
1471  "BasisType is not a boundary interior form");
1474  "BasisType is not a boundary interior form");
1477  "BasisType is not a boundary interior form");
1478 
1479  ASSERTL1((eid>=0)&&(eid<12),
1480  "local edge id must be between 0 and 11");
1481 
1482  int nEdgeIntCoeffs = GetEdgeNcoeffs(eid)-2;
1483 
1484  if(maparray.num_elements()!=nEdgeIntCoeffs)
1485  {
1486  maparray = Array<OneD, unsigned int>(nEdgeIntCoeffs);
1487  }
1488 
1489  if(signarray.num_elements() != nEdgeIntCoeffs)
1490  {
1491  signarray = Array<OneD, int>(nEdgeIntCoeffs,1);
1492  }
1493  else
1494  {
1495  fill( signarray.get() , signarray.get()+nEdgeIntCoeffs, 1 );
1496  }
1497 
1498  int nummodes [3] = {m_base[0]->GetNumModes(),
1499  m_base[1]->GetNumModes(),
1500  m_base[2]->GetNumModes()};
1501 
1502  const LibUtilities::BasisType bType [3] = {GetBasisType(0),
1503  GetBasisType(1),
1504  GetBasisType(2)};
1505 
1506  bool reverseOrdering = false;
1507  bool signChange = false;
1508 
1509  int IdxRange [3][2] = {{0,0},{0,0},{0,0}};
1510 
1511  switch(eid)
1512  {
1513  case 0:
1514  case 1:
1515  case 2:
1516  case 3:
1517  {
1518  IdxRange[2][0] = 0;
1519  IdxRange[2][1] = 1;
1520  }
1521  break;
1522  case 8:
1523  case 9:
1524  case 10:
1525  case 11:
1526  {
1527  if( bType[2] == LibUtilities::eGLL_Lagrange)
1528  {
1529  IdxRange[2][0] = nummodes[2] - 1;
1530  IdxRange[2][1] = nummodes[2];
1531  }
1532  else
1533  {
1534  IdxRange[2][0] = 1;
1535  IdxRange[2][1] = 2;
1536  }
1537  }
1538  break;
1539  case 4:
1540  case 5:
1541  case 6:
1542  case 7:
1543  {
1544  if( bType[2] == LibUtilities::eGLL_Lagrange)
1545  {
1546  IdxRange[2][0] = 1;
1547  IdxRange[2][1] = nummodes[2] - 1;
1548 
1549  if(edgeOrient==eBackwards)
1550  {
1551  reverseOrdering = true;
1552  }
1553  }
1554  else
1555  {
1556  IdxRange[2][0] = 2;
1557  IdxRange[2][1] = nummodes[2];
1558 
1559  if(edgeOrient==eBackwards)
1560  {
1561  signChange = true;
1562  }
1563  }
1564  }
1565  break;
1566  }
1567 
1568  switch(eid)
1569  {
1570  case 0:
1571  case 4:
1572  case 5:
1573  case 8:
1574  {
1575  IdxRange[1][0] = 0;
1576  IdxRange[1][1] = 1;
1577  }
1578  break;
1579  case 2:
1580  case 6:
1581  case 7:
1582  case 10:
1583  {
1584  if( bType[1] == LibUtilities::eGLL_Lagrange)
1585  {
1586  IdxRange[1][0] = nummodes[1] - 1;
1587  IdxRange[1][1] = nummodes[1];
1588  }
1589  else
1590  {
1591  IdxRange[1][0] = 1;
1592  IdxRange[1][1] = 2;
1593  }
1594  }
1595  break;
1596  case 1:
1597  case 9:
1598  {
1599  if( bType[1] == LibUtilities::eGLL_Lagrange)
1600  {
1601  IdxRange[1][0] = 1;
1602  IdxRange[1][1] = nummodes[1] - 1;
1603 
1604  if(edgeOrient==eBackwards)
1605  {
1606  reverseOrdering = true;
1607  }
1608  }
1609  else
1610  {
1611  IdxRange[1][0] = 2;
1612  IdxRange[1][1] = nummodes[1];
1613 
1614  if(edgeOrient==eBackwards)
1615  {
1616  signChange = true;
1617  }
1618  }
1619  }
1620  break;
1621  case 3:
1622  case 11:
1623  {
1624  if( bType[1] == LibUtilities::eGLL_Lagrange)
1625  {
1626  IdxRange[1][0] = 1;
1627  IdxRange[1][1] = nummodes[1] - 1;
1628 
1629  if(edgeOrient==eForwards)
1630  {
1631  reverseOrdering = true;
1632  }
1633  }
1634  else
1635  {
1636  IdxRange[1][0] = 2;
1637  IdxRange[1][1] = nummodes[1];
1638 
1639  if(edgeOrient==eForwards)
1640  {
1641  signChange = true;
1642  }
1643  }
1644  }
1645  break;
1646  }
1647 
1648  switch(eid)
1649  {
1650  case 3:
1651  case 4:
1652  case 7:
1653  case 11:
1654  {
1655  IdxRange[0][0] = 0;
1656  IdxRange[0][1] = 1;
1657  }
1658  break;
1659  case 1:
1660  case 5:
1661  case 6:
1662  case 9:
1663  {
1664  if( bType[0] == LibUtilities::eGLL_Lagrange)
1665  {
1666  IdxRange[0][0] = nummodes[0] - 1;
1667  IdxRange[0][1] = nummodes[0];
1668  }
1669  else
1670  {
1671  IdxRange[0][0] = 1;
1672  IdxRange[0][1] = 2;
1673  }
1674  }
1675  break;
1676  case 0:
1677  case 8:
1678  {
1679  if( bType[0] == LibUtilities::eGLL_Lagrange)
1680  {
1681  IdxRange[0][0] = 1;
1682  IdxRange[0][1] = nummodes[0] - 1;
1683 
1684  if(edgeOrient==eBackwards)
1685  {
1686  reverseOrdering = true;
1687  }
1688  }
1689  else
1690  {
1691  IdxRange[0][0] = 2;
1692  IdxRange[0][1] = nummodes[0];
1693 
1694  if(edgeOrient==eBackwards)
1695  {
1696  signChange = true;
1697  }
1698  }
1699  }
1700  break;
1701  case 2:
1702  case 10:
1703  {
1704  if( bType[0] == LibUtilities::eGLL_Lagrange)
1705  {
1706  IdxRange[0][0] = 1;
1707  IdxRange[0][1] = nummodes[0] - 1;
1708 
1709  if(edgeOrient==eForwards)
1710  {
1711  reverseOrdering = true;
1712  }
1713  }
1714  else
1715  {
1716  IdxRange[0][0] = 2;
1717  IdxRange[0][1] = nummodes[0];
1718 
1719  if(edgeOrient==eForwards)
1720  {
1721  signChange = true;
1722  }
1723  }
1724  }
1725  break;
1726  }
1727 
1728  int p,q,r;
1729  int cnt = 0;
1730 
1731  for(r = IdxRange[2][0]; r < IdxRange[2][1]; r++)
1732  {
1733  for(q = IdxRange[1][0]; q < IdxRange[1][1]; q++)
1734  {
1735  for(p = IdxRange[0][0]; p < IdxRange[0][1]; p++)
1736  {
1737  maparray[cnt++]
1738  = r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
1739  }
1740  }
1741  }
1742 
1743  if( reverseOrdering )
1744  {
1745  reverse( maparray.get() , maparray.get()+nEdgeIntCoeffs );
1746  }
1747 
1748  if( signChange )
1749  {
1750  for(p = 1; p < nEdgeIntCoeffs; p+=2)
1751  {
1752  signarray[p] = -1;
1753  }
1754  }
1755  }
int GetEdgeNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th edge.
Definition: StdExpansion.h:286

References ASSERTL1, Nektar::StdRegions::eBackwards, Nektar::StdRegions::eForwards, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::GetEdgeNcoeffs(), Nektar::StdRegions::StdExpansion::m_base, and CellMLToNektar.cellml_metadata::p.

◆ v_GetEdgeNcoeffs()

int Nektar::StdRegions::StdHexExp::v_GetEdgeNcoeffs ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 731 of file StdHexExp.cpp.

732  {
733  ASSERTL2((i >= 0)&&(i <= 11),"edge id is out of range");
734 
735  if((i == 0)||(i == 2)||(i == 8)||(i == 10))
736  {
737  return GetBasisNumModes(0);
738  }
739  else if((i == 1)||(i == 3)||(i == 9)||(i == 11))
740  {
741  return GetBasisNumModes(1);
742  }
743  else
744  {
745  return GetBasisNumModes(2);
746  }
747  }
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
Definition: StdExpansion.h:177

References ASSERTL2, and Nektar::StdRegions::StdExpansion::GetBasisNumModes().

◆ v_GetFaceInteriorMap()

void Nektar::StdRegions::StdHexExp::v_GetFaceInteriorMap ( const int  fid,
const Orientation  faceOrient,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray 
)
protectedvirtual

Generate mapping describing which elemental modes lie on the interior of a given face. Accounts for face orientation.

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1762 of file StdHexExp.cpp.

1766  {
1769  "BasisType is not a boundary interior form");
1772  "BasisType is not a boundary interior form");
1775  "BasisType is not a boundary interior form");
1776 
1777  ASSERTL1((fid>=0)&&(fid<6),
1778  "local face id must be between 0 and 5");
1779 
1780  int nFaceIntCoeffs = GetFaceIntNcoeffs(fid);
1781 
1782  if(maparray.num_elements()!=nFaceIntCoeffs)
1783  {
1784  maparray = Array<OneD, unsigned int>(nFaceIntCoeffs);
1785  }
1786 
1787  if(signarray.num_elements() != nFaceIntCoeffs)
1788  {
1789  signarray = Array<OneD, int>(nFaceIntCoeffs,1);
1790  }
1791  else
1792  {
1793  fill( signarray.get() , signarray.get()+nFaceIntCoeffs, 1 );
1794  }
1795 
1796  int nummodes [3] = {m_base[0]->GetNumModes(),
1797  m_base[1]->GetNumModes(),
1798  m_base[2]->GetNumModes()};
1799 
1800  const LibUtilities::BasisType bType [3] = {GetBasisType(0),
1801  GetBasisType(1),
1802  GetBasisType(2)};
1803 
1804  int nummodesA = 0;
1805  int nummodesB = 0;
1806 
1807  // Determine the number of modes in face directions A & B based
1808  // on the face index given.
1809  switch(fid)
1810  {
1811  case 0:
1812  case 5:
1813  {
1814  nummodesA = nummodes[0];
1815  nummodesB = nummodes[1];
1816  }
1817  break;
1818  case 1:
1819  case 3:
1820  {
1821  nummodesA = nummodes[0];
1822  nummodesB = nummodes[2];
1823  }
1824  break;
1825  case 2:
1826  case 4:
1827  {
1828  nummodesA = nummodes[1];
1829  nummodesB = nummodes[2];
1830  }
1831  }
1832 
1833  int i,j;
1834  Array<OneD, int> arrayindx(nFaceIntCoeffs);
1835 
1836  // Create a mapping array to account for transposition of the
1837  // coordinates due to face orientation.
1838  for(i = 0; i < (nummodesB-2); i++)
1839  {
1840  for(j = 0; j < (nummodesA-2); j++)
1841  {
1842  if( faceOrient < eDir1FwdDir2_Dir2FwdDir1 )
1843  {
1844  arrayindx[i*(nummodesA-2)+j] = i*(nummodesA-2)+j;
1845  }
1846  else
1847  {
1848  arrayindx[i*(nummodesA-2)+j] = j*(nummodesB-2)+i;
1849  }
1850  }
1851  }
1852 
1853  int IdxRange [3][2];
1854  int Incr[3];
1855 
1856  Array<OneD, int> sign0(nummodes[0], 1);
1857  Array<OneD, int> sign1(nummodes[1], 1);
1858  Array<OneD, int> sign2(nummodes[2], 1);
1859 
1860  // Set the upper and lower bounds, and increment for the faces
1861  // involving the first coordinate direction.
1862  switch(fid)
1863  {
1864  case 0: // bottom face
1865  {
1866  IdxRange[2][0] = 0;
1867  IdxRange[2][1] = 1;
1868  Incr[2] = 1;
1869  }
1870  break;
1871  case 5: // top face
1872  {
1873  if( bType[2] == LibUtilities::eGLL_Lagrange)
1874  {
1875  IdxRange[2][0] = nummodes[2] - 1;
1876  IdxRange[2][1] = nummodes[2];
1877  Incr[2] = 1;
1878  }
1879  else
1880  {
1881  IdxRange[2][0] = 1;
1882  IdxRange[2][1] = 2;
1883  Incr[2] = 1;
1884  }
1885 
1886  }
1887  break;
1888  default: // all other faces
1889  {
1890  if( bType[2] == LibUtilities::eGLL_Lagrange)
1891  {
1892  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 2 )
1893  {
1894  IdxRange[2][0] = nummodes[2] - 2;
1895  IdxRange[2][1] = 0;
1896  Incr[2] = -1;
1897 
1898  }
1899  else
1900  {
1901  IdxRange[2][0] = 1;
1902  IdxRange[2][1] = nummodes[2] - 1;
1903  Incr[2] = 1;
1904  }
1905  }
1906  else
1907  {
1908  IdxRange[2][0] = 2;
1909  IdxRange[2][1] = nummodes[2];
1910  Incr[2] = 1;
1911 
1912  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 2 )
1913  {
1914  for(i = 3; i < nummodes[2]; i+=2)
1915  {
1916  sign2[i] = -1;
1917  }
1918  }
1919  }
1920  }
1921  }
1922 
1923  // Set the upper and lower bounds, and increment for the faces
1924  // involving the second coordinate direction.
1925  switch(fid)
1926  {
1927  case 1:
1928  {
1929  IdxRange[1][0] = 0;
1930  IdxRange[1][1] = 1;
1931  Incr[1] = 1;
1932  }
1933  break;
1934  case 3:
1935  {
1936  if( bType[1] == LibUtilities::eGLL_Lagrange)
1937  {
1938  IdxRange[1][0] = nummodes[1] - 1;
1939  IdxRange[1][1] = nummodes[1];
1940  Incr[1] = 1;
1941  }
1942  else
1943  {
1944  IdxRange[1][0] = 1;
1945  IdxRange[1][1] = 2;
1946  Incr[1] = 1;
1947  }
1948  }
1949  break;
1950  case 0:
1951  case 5:
1952  {
1953  if( bType[1] == LibUtilities::eGLL_Lagrange)
1954  {
1955  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 2 )
1956  {
1957  IdxRange[1][0] = nummodes[1] - 2;
1958  IdxRange[1][1] = 0;
1959  Incr[1] = -1;
1960 
1961  }
1962  else
1963  {
1964  IdxRange[1][0] = 1;
1965  IdxRange[1][1] = nummodes[1] - 1;
1966  Incr[1] = 1;
1967  }
1968  }
1969  else
1970  {
1971  IdxRange[1][0] = 2;
1972  IdxRange[1][1] = nummodes[1];
1973  Incr[1] = 1;
1974 
1975  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 2 )
1976  {
1977  for(i = 3; i < nummodes[1]; i+=2)
1978  {
1979  sign1[i] = -1;
1980  }
1981  }
1982  }
1983  }
1984  break;
1985  default: // case2: case4:
1986  {
1987  if( bType[1] == LibUtilities::eGLL_Lagrange)
1988  {
1989  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 4 > 1 )
1990  {
1991  IdxRange[1][0] = nummodes[1] - 2;
1992  IdxRange[1][1] = 0;
1993  Incr[1] = -1;
1994 
1995  }
1996  else
1997  {
1998  IdxRange[1][0] = 1;
1999  IdxRange[1][1] = nummodes[1] - 1;
2000  Incr[1] = 1;
2001  }
2002  }
2003  else
2004  {
2005  IdxRange[1][0] = 2;
2006  IdxRange[1][1] = nummodes[1];
2007  Incr[1] = 1;
2008 
2009  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 4 > 1 )
2010  {
2011  for(i = 3; i < nummodes[1]; i+=2)
2012  {
2013  sign1[i] = -1;
2014  }
2015  }
2016  }
2017  }
2018  }
2019 
2020  switch(fid)
2021  {
2022  case 4:
2023  {
2024  IdxRange[0][0] = 0;
2025  IdxRange[0][1] = 1;
2026  Incr[0] = 1;
2027  }
2028  break;
2029  case 2:
2030  {
2031  if( bType[0] == LibUtilities::eGLL_Lagrange)
2032  {
2033  IdxRange[0][0] = nummodes[0] - 1;
2034  IdxRange[0][1] = nummodes[0];
2035  Incr[0] = 1;
2036  }
2037  else
2038  {
2039  IdxRange[0][0] = 1;
2040  IdxRange[0][1] = 2;
2041  Incr[0] = 1;
2042  }
2043  }
2044  break;
2045  default:
2046  {
2047  if( bType[0] == LibUtilities::eGLL_Lagrange)
2048  {
2049  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 4 > 1 )
2050  {
2051  IdxRange[0][0] = nummodes[0] - 2;
2052  IdxRange[0][1] = 0;
2053  Incr[0] = -1;
2054 
2055  }
2056  else
2057  {
2058  IdxRange[0][0] = 1;
2059  IdxRange[0][1] = nummodes[0] - 1;
2060  Incr[0] = 1;
2061  }
2062  }
2063  else
2064  {
2065  IdxRange[0][0] = 2;
2066  IdxRange[0][1] = nummodes[0];
2067  Incr[0] = 1;
2068 
2069  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 4 > 1 )
2070  {
2071  for(i = 3; i < nummodes[0]; i+=2)
2072  {
2073  sign0[i] = -1;
2074  }
2075  }
2076  }
2077  }
2078  }
2079 
2080  int p,q,r;
2081  int cnt = 0;
2082 
2083  for(r = IdxRange[2][0]; r != IdxRange[2][1]; r+=Incr[2])
2084  {
2085  for(q = IdxRange[1][0]; q != IdxRange[1][1]; q+=Incr[1])
2086  {
2087  for(p = IdxRange[0][0]; p != IdxRange[0][1]; p+=Incr[0])
2088  {
2089  maparray [ arrayindx[cnt ] ]
2090  = r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
2091  signarray[ arrayindx[cnt++] ]
2092  = sign0[p] * sign1[q] * sign2[r];
2093  }
2094  }
2095  }
2096  }
int GetFaceIntNcoeffs(const int i) const
Definition: StdExpansion.h:358

References ASSERTL1, Nektar::StdRegions::eDir1FwdDir1_Dir2FwdDir2, Nektar::StdRegions::eDir1FwdDir2_Dir2FwdDir1, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::GetFaceIntNcoeffs(), Nektar::StdRegions::StdExpansion::m_base, and CellMLToNektar.cellml_metadata::p.

◆ v_GetFaceIntNcoeffs()

int Nektar::StdRegions::StdHexExp::v_GetFaceIntNcoeffs ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 773 of file StdHexExp.cpp.

774  {
775  ASSERTL2((i >= 0) && (i <= 5), "face id is out of range");
776  if((i == 0) || (i == 5))
777  {
778  return (GetBasisNumModes(0)-2)*(GetBasisNumModes(1)-2);
779  }
780  else if((i == 1) || (i == 3))
781  {
782  return (GetBasisNumModes(0)-2)*(GetBasisNumModes(2)-2);
783  }
784  else
785  {
786  return (GetBasisNumModes(1)-2)*(GetBasisNumModes(2)-2);
787  }
788 
789  }

References ASSERTL2, and Nektar::StdRegions::StdExpansion::GetBasisNumModes().

◆ v_GetFaceNcoeffs()

int Nektar::StdRegions::StdHexExp::v_GetFaceNcoeffs ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 755 of file StdHexExp.cpp.

756  {
757  ASSERTL2((i >= 0) && (i <= 5), "face id is out of range");
758  if((i == 0) || (i == 5))
759  {
760  return GetBasisNumModes(0)*GetBasisNumModes(1);
761  }
762  else if((i == 1) || (i == 3))
763  {
764  return GetBasisNumModes(0)*GetBasisNumModes(2);
765  }
766  else
767  {
768  return GetBasisNumModes(1)*GetBasisNumModes(2);
769  }
770  }

References ASSERTL2, and Nektar::StdRegions::StdExpansion::GetBasisNumModes().

◆ v_GetFaceNumModes()

void Nektar::StdRegions::StdHexExp::v_GetFaceNumModes ( const int  fid,
const Orientation  faceOrient,
int &  numModes0,
int &  numModes1 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 921 of file StdHexExp.cpp.

926  {
927  int nummodes [3] = {m_base[0]->GetNumModes(),
928  m_base[1]->GetNumModes(),
929  m_base[2]->GetNumModes()};
930  switch(fid)
931  {
932  case 0:
933  case 5:
934  {
935  numModes0 = nummodes[0];
936  numModes1 = nummodes[1];
937  }
938  break;
939  case 1:
940  case 3:
941  {
942  numModes0 = nummodes[0];
943  numModes1 = nummodes[2];
944  }
945  break;
946  case 2:
947  case 4:
948  {
949  numModes0 = nummodes[1];
950  numModes1 = nummodes[2];
951  }
952  break;
953  default:
954  {
955  ASSERTL0(false,"fid out of range");
956  }
957  break;
958  }
959 
960  if ( faceOrient >= eDir1FwdDir2_Dir2FwdDir1 )
961  {
962  std::swap(numModes0, numModes1);
963  }
964  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216

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

◆ v_GetFaceNumPoints()

int Nektar::StdRegions::StdHexExp::v_GetFaceNumPoints ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 798 of file StdHexExp.cpp.

799  {
800  ASSERTL2(i >= 0 && i <= 5, "face id is out of range");
801 
802  if (i == 0 || i == 5)
803  {
804  return m_base[0]->GetNumPoints()*
805  m_base[1]->GetNumPoints();
806  }
807  else if (i == 1 || i == 3)
808  {
809  return m_base[0]->GetNumPoints()*
810  m_base[2]->GetNumPoints();
811  }
812  else
813  {
814  return m_base[1]->GetNumPoints()*
815  m_base[2]->GetNumPoints();
816  }
817  }

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

◆ v_GetFacePointsKey()

LibUtilities::PointsKey Nektar::StdRegions::StdHexExp::v_GetFacePointsKey ( const int  i,
const int  j 
) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 819 of file StdHexExp.cpp.

821  {
822  ASSERTL2(i >= 0 && i <= 5, "face id is out of range");
823  ASSERTL2(j == 0 || j == 1, "face direction is out of range");
824 
825  if (i == 0 || i == 5)
826  {
827  return m_base[j]->GetPointsKey();
828  }
829  else if (i == 1 || i == 3)
830  {
831  return m_base[2*j]->GetPointsKey();
832  }
833  else
834  {
835  return m_base[j+1]->GetPointsKey();
836  }
837  }

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

◆ v_GetFaceToElementMap()

void Nektar::StdRegions::StdHexExp::v_GetFaceToElementMap ( const int  fid,
const Orientation  faceOrient,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray,
int  P = -1,
int  Q = -1 
)
protectedvirtual

Only for basis type Modified_A or GLL_LAGRANGE in all directions.

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 969 of file StdHexExp.cpp.

976  {
977  int i,j;
978  int nummodesA=0, nummodesB=0;
979 
982  "Method only implemented if BasisType is indentical in "
983  "all directions");
986  "Method only implemented for Modified_A or GLL_Lagrange BasisType");
987 
988  const int nummodes0 = m_base[0]->GetNumModes();
989  const int nummodes1 = m_base[1]->GetNumModes();
990  const int nummodes2 = m_base[2]->GetNumModes();
991 
992  switch(fid)
993  {
994  case 0:
995  case 5:
996  nummodesA = nummodes0;
997  nummodesB = nummodes1;
998  break;
999  case 1:
1000  case 3:
1001  nummodesA = nummodes0;
1002  nummodesB = nummodes2;
1003  break;
1004  case 2:
1005  case 4:
1006  nummodesA = nummodes1;
1007  nummodesB = nummodes2;
1008  break;
1009  default:
1010  ASSERTL0(false,"fid must be between 0 and 5");
1011  }
1012 
1013  bool CheckForZeroedModes = false;
1014 
1015  if (P == -1)
1016  {
1017  P = nummodesA;
1018  Q = nummodesB;
1019  }
1020 
1021  if((P != nummodesA)||(Q != nummodesB))
1022  {
1023  CheckForZeroedModes = true;
1024  }
1025 
1026  bool modified = (GetEdgeBasisType(0) == LibUtilities::eModified_A);
1027  int nFaceCoeffs = P*Q;
1028 
1029  if(maparray.num_elements() != nFaceCoeffs)
1030  {
1031  maparray = Array<OneD, unsigned int>(nFaceCoeffs);
1032  }
1033 
1034  if(signarray.num_elements() != nFaceCoeffs)
1035  {
1036  signarray = Array<OneD, int>(nFaceCoeffs,1);
1037  }
1038  else
1039  {
1040  fill( signarray.get() , signarray.get()+nFaceCoeffs, 1 );
1041  }
1042 
1043  Array<OneD, int> arrayindx(nFaceCoeffs);
1044 
1045  for(i = 0; i < Q; i++)
1046  {
1047  for(j = 0; j < P; j++)
1048  {
1049  if( faceOrient < eDir1FwdDir2_Dir2FwdDir1 )
1050  {
1051  arrayindx[i*P+j] = i*P+j;
1052  }
1053  else
1054  {
1055  arrayindx[i*P+j] = j*Q+i;
1056  }
1057  }
1058  }
1059 
1060  int offset = 0;
1061  int jump1 = 1;
1062  int jump2 = 1;
1063 
1064  switch(fid)
1065  {
1066  case 5:
1067  {
1068  if (modified)
1069  {
1070  offset = nummodes0*nummodes1;
1071  }
1072  else
1073  {
1074  offset = (nummodes2-1)*nummodes0*nummodes1;
1075  jump1 = nummodes0;
1076  }
1077  }
1078  /* Falls through. */
1079  case 0:
1080  {
1081  jump1 = nummodes0;
1082  break;
1083  }
1084  case 3:
1085  {
1086  if (modified)
1087  {
1088  offset = nummodes0;
1089  }
1090  else
1091  {
1092  offset = nummodes0*(nummodes1-1);
1093  jump1 = nummodes0*nummodes1;
1094  }
1095  }
1096  /* Falls through. */
1097  case 1:
1098  {
1099  jump1 = nummodes0*nummodes1;
1100  break;
1101  }
1102  case 2:
1103  {
1104  if (modified)
1105  {
1106  offset = 1;
1107  }
1108  else
1109  {
1110  offset = nummodes0-1;
1111  jump1 = nummodes0*nummodes1;
1112  jump2 = nummodes0;
1113 
1114  }
1115  }
1116  /* Falls through. */
1117  case 4:
1118  {
1119  jump1 = nummodes0*nummodes1;
1120  jump2 = nummodes0;
1121  break;
1122  }
1123  default:
1124  ASSERTL0(false,"fid must be between 0 and 5");
1125  }
1126 
1127  for(i = 0; i < Q; i++)
1128  {
1129  for(j = 0; j < P; j++)
1130  {
1131  maparray[ arrayindx[i*P+j] ]
1132  = i*jump1 + j*jump2 + offset;
1133  }
1134  }
1135 
1136 
1137  if(CheckForZeroedModes)
1138  {
1139  if(modified)
1140  {
1141  // zero signmap and set maparray to zero if elemental
1142  // modes are not as large as face modesl
1143  for(i = 0; i < nummodesB; i++)
1144  {
1145  for(j = nummodesA; j < P; j++)
1146  {
1147  signarray[arrayindx[i*P+j]] = 0.0;
1148  maparray[arrayindx[i*P+j]] = maparray[0];
1149  }
1150  }
1151 
1152  for(i = nummodesB; i < Q; i++)
1153  {
1154  for(j = 0; j < P; j++)
1155  {
1156  signarray[arrayindx[i*P+j]] = 0.0;
1157  maparray[arrayindx[i*P+j]] = maparray[0];
1158  }
1159  }
1160  }
1161  else
1162  {
1163  ASSERTL0(false,"Different trace space face dimention and element face dimention not possible for GLL-Lagrange bases");
1164  }
1165  }
1166 
1167  if( (faceOrient==eDir1FwdDir1_Dir2BwdDir2) ||
1168  (faceOrient==eDir1BwdDir1_Dir2BwdDir2) ||
1169  (faceOrient==eDir1BwdDir2_Dir2FwdDir1) ||
1170  (faceOrient==eDir1BwdDir2_Dir2BwdDir1) )
1171  {
1172  if(faceOrient<eDir1FwdDir2_Dir2FwdDir1)
1173  {
1174  if (modified)
1175  {
1176  for(i = 3; i < Q; i+=2)
1177  {
1178  for(j = 0; j < P; j++)
1179  {
1180  signarray[ arrayindx[i*P+j] ] *= -1;
1181  }
1182  }
1183 
1184  for(i = 0; i < P; i++)
1185  {
1186  swap( maparray[i] , maparray[i+P] );
1187  swap( signarray[i] , signarray[i+P] );
1188  }
1189 
1190  }
1191  else
1192  {
1193  for(i = 0; i < P; i++)
1194  {
1195  for(j = 0; j < Q/2; j++)
1196  {
1197  swap( maparray[i + j*P],
1198  maparray[i+P*Q
1199  -P -j*P] );
1200  swap( signarray[i + j*P],
1201  signarray[i+P*Q
1202  -P -j*P]);
1203  }
1204  }
1205  }
1206  }
1207  else
1208  {
1209  if (modified)
1210  {
1211  for(i = 0; i < Q; i++)
1212  {
1213  for(j = 3; j < P; j+=2)
1214  {
1215  signarray[ arrayindx[i*P+j] ] *= -1;
1216  }
1217  }
1218 
1219  for(i = 0; i < Q; i++)
1220  {
1221  swap( maparray[i] , maparray[i+Q] );
1222  swap( signarray[i] , signarray[i+Q] );
1223  }
1224 
1225  }
1226  else
1227  {
1228  for(i = 0; i < P; i++)
1229  {
1230  for(j = 0; j < Q/2; j++)
1231  {
1232  swap( maparray[i*Q + j],
1233  maparray[i*Q + Q -1 -j]);
1234  swap( signarray[i*Q + j],
1235  signarray[i*Q + Q -1 -j]);
1236  }
1237  }
1238  }
1239  }
1240  }
1241 
1242  if( (faceOrient==eDir1BwdDir1_Dir2FwdDir2) ||
1243  (faceOrient==eDir1BwdDir1_Dir2BwdDir2) ||
1244  (faceOrient==eDir1FwdDir2_Dir2BwdDir1) ||
1245  (faceOrient==eDir1BwdDir2_Dir2BwdDir1) )
1246  {
1247  if(faceOrient<eDir1FwdDir2_Dir2FwdDir1)
1248  {
1249  if (modified)
1250  {
1251  for(i = 0; i < Q; i++)
1252  {
1253  for(j = 3; j < P; j+=2)
1254  {
1255  signarray[ arrayindx[i*P+j] ] *= -1;
1256  }
1257  }
1258 
1259  for(i = 0; i < Q; i++)
1260  {
1261  swap( maparray[i*P],
1262  maparray[i*P+1]);
1263  swap( signarray[i*P],
1264  signarray[i*P+1]);
1265  }
1266  }
1267  else
1268  {
1269  for(i = 0; i < Q; i++)
1270  {
1271  for(j = 0; j < P/2; j++)
1272  {
1273  swap( maparray[i*P + j],
1274  maparray[i*P + P -1 -j]);
1275  swap( signarray[i*P + j],
1276  signarray[i*P + P -1 -j]);
1277  }
1278  }
1279  }
1280 
1281 
1282 
1283  }
1284  else
1285  {
1286  if (modified)
1287  {
1288  for(i = 3; i < Q; i+=2)
1289  {
1290  for(j = 0; j < P; j++)
1291  {
1292  signarray[ arrayindx[i*P+j] ] *= -1;
1293  }
1294  }
1295 
1296  for(i = 0; i < P; i++)
1297  {
1298  swap( maparray[i*Q],
1299  maparray[i*Q+1]);
1300  swap( signarray[i*Q],
1301  signarray[i*Q+1]);
1302  }
1303  }
1304  else
1305  {
1306  for(i = 0; i < Q; i++)
1307  {
1308  for(j = 0; j < P/2; j++)
1309  {
1310  swap( maparray[i + j*Q] ,
1311  maparray[i+P*Q - Q -j*Q] );
1312  swap( signarray[i + j*Q] ,
1313  signarray[i+P*Q - Q -j*Q] );
1314  }
1315  }
1316  }
1317  }
1318  }
1319  }
LibUtilities::BasisType GetEdgeBasisType(const int i) const
This function returns the type of expansion basis on the i-th edge.
Definition: StdExpansion.h:412

References ASSERTL0, ASSERTL1, Nektar::StdRegions::eDir1BwdDir1_Dir2BwdDir2, Nektar::StdRegions::eDir1BwdDir1_Dir2FwdDir2, Nektar::StdRegions::eDir1BwdDir2_Dir2BwdDir1, Nektar::StdRegions::eDir1BwdDir2_Dir2FwdDir1, Nektar::StdRegions::eDir1FwdDir1_Dir2BwdDir2, Nektar::StdRegions::eDir1FwdDir2_Dir2BwdDir1, Nektar::StdRegions::eDir1FwdDir2_Dir2FwdDir1, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::GetEdgeBasisType(), Nektar::StdRegions::StdExpansion::m_base, and main::P.

◆ v_GetInteriorMap()

void Nektar::StdRegions::StdHexExp::v_GetInteriorMap ( Array< OneD, unsigned int > &  outarray)
protectedvirtual
Parameters
outarrayStorage area for computed map.

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 2102 of file StdHexExp.cpp.

2103  {
2106  "BasisType is not a boundary interior form");
2109  "BasisType is not a boundary interior form");
2112  "BasisType is not a boundary interior form");
2113 
2114  int i;
2115  int nummodes [3] = {m_base[0]->GetNumModes(),
2116  m_base[1]->GetNumModes(),
2117  m_base[2]->GetNumModes()};
2118 
2119  int nIntCoeffs = m_ncoeffs - NumBndryCoeffs();
2120 
2121  if(outarray.num_elements() != nIntCoeffs)
2122  {
2123  outarray = Array<OneD, unsigned int>(nIntCoeffs);
2124  }
2125 
2126  const LibUtilities::BasisType Btype [3] = {GetBasisType(0),
2127  GetBasisType(1),
2128  GetBasisType(2)};
2129 
2130  int p,q,r;
2131  int cnt = 0;
2132 
2133  int IntIdx [3][2];
2134 
2135  for(i = 0; i < 3; i++)
2136  {
2137  if( Btype[i] == LibUtilities::eModified_A)
2138  {
2139  IntIdx[i][0] = 2;
2140  IntIdx[i][1] = nummodes[i];
2141  }
2142  else
2143  {
2144  IntIdx[i][0] = 1;
2145  IntIdx[i][1] = nummodes[i]-1;
2146  }
2147  }
2148 
2149  for(r = IntIdx[2][0]; r < IntIdx[2][1]; r++)
2150  {
2151  for( q = IntIdx[1][0]; q < IntIdx[1][1]; q++)
2152  {
2153  for( p = IntIdx[0][0]; p < IntIdx[0][1]; p++)
2154  {
2155  outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2156  q*nummodes[0] + p;
2157  }
2158  }
2159  }
2160  }

References ASSERTL1, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, Nektar::StdRegions::StdExpansion::NumBndryCoeffs(), and CellMLToNektar.cellml_metadata::p.

◆ v_GetNedges()

int Nektar::StdRegions::StdHexExp::v_GetNedges ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 672 of file StdHexExp.cpp.

673  {
674  return 12;
675  }

◆ v_GetNfaces()

int Nektar::StdRegions::StdHexExp::v_GetNfaces ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 678 of file StdHexExp.cpp.

679  {
680  return 6;
681  }

◆ v_GetNverts()

int Nektar::StdRegions::StdHexExp::v_GetNverts ( ) const
protectedvirtual

Implements Nektar::StdRegions::StdExpansion.

Definition at line 666 of file StdHexExp.cpp.

667  {
668  return 8;
669  }

◆ v_GetTotalEdgeIntNcoeffs()

int Nektar::StdRegions::StdHexExp::v_GetTotalEdgeIntNcoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 749 of file StdHexExp.cpp.

750  {
752  }

References Nektar::StdRegions::StdExpansion::GetBasisNumModes().

◆ v_GetTotalFaceIntNcoeffs()

int Nektar::StdRegions::StdHexExp::v_GetTotalFaceIntNcoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 791 of file StdHexExp.cpp.

792  {
793  return 2*((GetBasisNumModes(0)-2)*(GetBasisNumModes(1)-2)+
794  (GetBasisNumModes(0)-2)*(GetBasisNumModes(2)-2)+
795  (GetBasisNumModes(1)-2)*(GetBasisNumModes(2)-2));
796  }

References Nektar::StdRegions::StdExpansion::GetBasisNumModes().

◆ v_GetVertexMap()

int Nektar::StdRegions::StdHexExp::v_GetVertexMap ( int  localVertexId,
bool  useCoeffPacking = false 
)
protectedvirtual

Expansions in each of the three dimensions must be of type LibUtilities::eModified_A or LibUtilities::eGLL_Lagrange.

Parameters
localVertexIdID of vertex (0..7)
Returns
Position of vertex in local numbering scheme.

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1330 of file StdHexExp.cpp.

1331  {
1334  "BasisType is not a boundary interior form");
1337  "BasisType is not a boundary interior form");
1340  "BasisType is not a boundary interior form");
1341 
1342  ASSERTL1((localVertexId>=0)&&(localVertexId<8),
1343  "local vertex id must be between 0 and 7");
1344 
1345  int p = 0;
1346  int q = 0;
1347  int r = 0;
1348 
1349  // Retrieve the number of modes in each dimension.
1350  int nummodes [3] = {m_base[0]->GetNumModes(),
1351  m_base[1]->GetNumModes(),
1352  m_base[2]->GetNumModes()};
1353 
1354  if(useCoeffPacking == true) // follow packing of coefficients i.e q,r,p
1355  {
1356  if(localVertexId > 3)
1357  {
1359  {
1360  r = nummodes[2]-1;
1361  }
1362  else
1363  {
1364  r = 1;
1365  }
1366  }
1367 
1368  switch(localVertexId % 4)
1369  {
1370  case 0:
1371  break;
1372  case 1:
1373  {
1375  {
1376  p = nummodes[0]-1;
1377  }
1378  else
1379  {
1380  p = 1;
1381  }
1382  }
1383  break;
1384  case 2:
1385  {
1387  {
1388  q = nummodes[1]-1;
1389  }
1390  else
1391  {
1392  q = 1;
1393  }
1394  }
1395  break;
1396  case 3:
1397  {
1399  {
1400  p = nummodes[0]-1;
1401  q = nummodes[1]-1;
1402  }
1403  else
1404  {
1405  p = 1;
1406  q = 1;
1407  }
1408  }
1409  break;
1410  }
1411  }
1412  else
1413  {
1414  // Right face (vertices 1,2,5,6)
1415  if( (localVertexId % 4) % 3 > 0 )
1416  {
1418  {
1419  p = nummodes[0]-1;
1420  }
1421  else
1422  {
1423  p = 1;
1424  }
1425  }
1426 
1427  // Back face (vertices 2,3,6,7)
1428  if( localVertexId % 4 > 1 )
1429  {
1431  {
1432  q = nummodes[1]-1;
1433  }
1434  else
1435  {
1436  q = 1;
1437  }
1438  }
1439 
1440  // Top face (vertices 4,5,6,7)
1441  if( localVertexId > 3)
1442  {
1444  {
1445  r = nummodes[2]-1;
1446  }
1447  else
1448  {
1449  r = 1;
1450  }
1451  }
1452  }
1453  // Compute the local number.
1454  return r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
1455  }

References ASSERTL1, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::m_base, and CellMLToNektar.cellml_metadata::p.

◆ v_HelmholtzMatrixOp()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 2306 of file StdHexExp.cpp.

2310  {
2311  StdHexExp::v_HelmholtzMatrixOp_MatFree(inarray,outarray,mkey);
2312  }
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_IProductWRTBase()

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

\( \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
inarray?
outarray?

Implements Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 360 of file StdHexExp.cpp.

363  {
364  if(m_base[0]->Collocation() &&
365  m_base[1]->Collocation() &&
366  m_base[2]->Collocation())
367  {
368  MultiplyByQuadratureMetric(inarray,outarray);
369  }
370  else
371  {
372  StdHexExp::v_IProductWRTBase_SumFac(inarray,outarray);
373  }
374  }
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:945
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multbyweights=true)
Definition: StdHexExp.cpp:393

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

◆ v_IProductWRTBase_MatOp()

void Nektar::StdRegions::StdHexExp::v_IProductWRTBase_MatOp ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Implementation of the local matrix inner product operation.

Definition at line 379 of file StdHexExp.cpp.

381  {
382  int nq = GetTotPoints();
383  StdMatrixKey iprodmatkey(eIProductWRTBase,DetShapeType(),*this);
384  DNekMatSharedPtr iprodmat = GetStdMatrix(iprodmatkey);
385 
386  Blas::Dgemv('N',m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
387  m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
388  }
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:140

References Nektar::StdRegions::StdExpansion::DetShapeType(), Blas::Dgemv(), Nektar::StdRegions::eIProductWRTBase, Nektar::StdRegions::StdExpansion::GetStdMatrix(), Nektar::StdRegions::StdExpansion::GetTotPoints(), and Nektar::StdRegions::StdExpansion::m_ncoeffs.

◆ v_IProductWRTBase_SumFac()

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

Implementation of the sum-factorization inner product operation.

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 393 of file StdHexExp.cpp.

397  {
398  int nquad0 = m_base[0]->GetNumPoints();
399  int nquad1 = m_base[1]->GetNumPoints();
400  int nquad2 = m_base[2]->GetNumPoints();
401  int order0 = m_base[0]->GetNumModes();
402  int order1 = m_base[1]->GetNumModes();
403 
404  Array<OneD, NekDouble> wsp(nquad0*nquad1*(nquad2+order0) +
405  order0*order1*nquad2);
406 
407  if(multiplybyweights)
408  {
409  Array<OneD, NekDouble> tmp(inarray.num_elements());
410  MultiplyByQuadratureMetric(inarray,tmp);
411 
413  m_base[1]->GetBdata(),
414  m_base[2]->GetBdata(),
415  tmp,outarray,wsp,true,true,true);
416  }
417  else
418  {
420  m_base[1]->GetBdata(),
421  m_base[2]->GetBdata(),
422  inarray,outarray,wsp,true,true,true);
423  }
424  }
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)

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

Referenced by v_IProductWRTBase().

◆ v_IProductWRTBase_SumFacKernel()

void Nektar::StdRegions::StdHexExp::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 
)
protectedvirtual

Implementation of the sum-factorisation inner product operation.

Todo:
Implement cases where only some directions are collocated.

Implements Nektar::StdRegions::StdExpansion3D.

Definition at line 431 of file StdHexExp.cpp.

440  {
441  int nquad0 = m_base[0]->GetNumPoints();
442  int nquad1 = m_base[1]->GetNumPoints();
443  int nquad2 = m_base[2]->GetNumPoints();
444  int nmodes0 = m_base[0]->GetNumModes();
445  int nmodes1 = m_base[1]->GetNumModes();
446  int nmodes2 = m_base[2]->GetNumModes();
447 
448  bool colldir0 = doCheckCollDir0?(m_base[0]->Collocation()):false;
449  bool colldir1 = doCheckCollDir1?(m_base[1]->Collocation()):false;
450  bool colldir2 = doCheckCollDir2?(m_base[2]->Collocation()):false;
451 
452  if(colldir0 && colldir1 && colldir2)
453  {
454  Vmath::Vcopy(m_ncoeffs,inarray.get(),1,outarray.get(),1);
455  }
456  else
457  {
458  ASSERTL1(wsp.num_elements() >= nmodes0*nquad2*(nquad1+nmodes1),
459  "Insufficient workspace size");
460 
461  Array<OneD, NekDouble> tmp0 = wsp;
462  Array<OneD, NekDouble> tmp1 = wsp + nmodes0*nquad1*nquad2;
463 
464 
465  if(colldir0)
466  {
467  // reshuffle data for next operation.
468  for(int n = 0; n < nmodes0; ++n)
469  {
470  Vmath::Vcopy(nquad1*nquad2,inarray.get()+n,nquad0,
471  tmp0.get()+nquad1*nquad2*n,1);
472  }
473  }
474  else
475  {
476  Blas::Dgemm('T', 'N', nquad1*nquad2, nmodes0, nquad0,
477  1.0, inarray.get(), nquad0,
478  base0.get(), nquad0,
479  0.0, tmp0.get(), nquad1*nquad2);
480  }
481 
482  if(colldir1)
483  {
484  // reshuffle data for next operation.
485  for(int n = 0; n < nmodes1; ++n)
486  {
487  Vmath::Vcopy(nquad2*nmodes0,tmp0.get()+n,nquad1,
488  tmp1.get()+nquad2*nmodes0*n,1);
489  }
490  }
491  else
492  {
493  Blas::Dgemm('T', 'N', nquad2*nmodes0, nmodes1, nquad1,
494  1.0, tmp0.get(), nquad1,
495  base1.get(), nquad1,
496  0.0, tmp1.get(), nquad2*nmodes0);
497  }
498 
499  if(colldir2)
500  {
501  // reshuffle data for next operation.
502  for(int n = 0; n < nmodes2; ++n)
503  {
504  Vmath::Vcopy(nmodes0*nmodes1,tmp1.get()+n,nquad2,
505  outarray.get()+nmodes0*nmodes1*n,1);
506  }
507  }
508  else
509  {
510  Blas::Dgemm('T', 'N', nmodes0*nmodes1, nmodes2, nquad2,
511  1.0, tmp1.get(), nquad2,
512  base2.get(), nquad2,
513  0.0, outarray.get(), nmodes0*nmodes1);
514  }
515  }
516  }

References ASSERTL1, Blas::Dgemm(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, and Vmath::Vcopy().

◆ v_IProductWRTDerivBase()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 518 of file StdHexExp.cpp.

521  {
522  StdHexExp::IProductWRTDerivBase_SumFac(dir,inarray,outarray);
523  }
void IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)

References Nektar::StdRegions::StdExpansion::IProductWRTDerivBase_SumFac().

◆ v_IProductWRTDerivBase_MatOp()

void Nektar::StdRegions::StdHexExp::v_IProductWRTDerivBase_MatOp ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Definition at line 526 of file StdHexExp.cpp.

529  {
530  ASSERTL0((dir==0)||(dir==1)||(dir==2),"input dir is out of range");
531 
532  int nq = GetTotPoints();
534 
535  switch (dir)
536  {
537  case 0:
538  mtype = eIProductWRTDerivBase0;
539  break;
540  case 1:
541  mtype = eIProductWRTDerivBase1;
542  break;
543  case 2:
544  mtype = eIProductWRTDerivBase2;
545  break;
546  }
547 
548  StdMatrixKey iprodmatkey(mtype,DetShapeType(),*this);
549  DNekMatSharedPtr iprodmat = GetStdMatrix(iprodmatkey);
550 
551  Blas::Dgemv('N',m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
552  m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
553  }

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

◆ v_IProductWRTDerivBase_SumFac()

void Nektar::StdRegions::StdHexExp::v_IProductWRTDerivBase_SumFac ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 556 of file StdHexExp.cpp.

559  {
560  ASSERTL0((dir==0)||(dir==1)||(dir==2),"input dir is out of range");
561 
562  int nquad1 = m_base[1]->GetNumPoints();
563  int nquad2 = m_base[2]->GetNumPoints();
564  int order0 = m_base[0]->GetNumModes();
565  int order1 = m_base[1]->GetNumModes();
566 
567  // If outarray > inarray then no need for temporary storage.
568  Array<OneD, NekDouble> tmp = outarray;
569  if (outarray.num_elements() < inarray.num_elements())
570  {
571  tmp = Array<OneD, NekDouble>(inarray.num_elements());
572  }
573 
574  // Need workspace for sumfackernel though
575  Array<OneD, NekDouble> wsp(order0*nquad2*(nquad1+order1));
576 
577  // multiply by integration constants
578  MultiplyByQuadratureMetric(inarray,tmp);
579 
580  // perform sum-factorisation
581  switch (dir)
582  {
583  case 0:
584  IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(),
585  m_base[1]->GetBdata(),
586  m_base[2]->GetBdata(),
587  tmp,outarray,wsp,
588  false,true,true);
589  break;
590  case 1:
591  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
592  m_base[1]->GetDbdata(),
593  m_base[2]->GetBdata(),
594  tmp,outarray,wsp,
595  true,false,true);
596  break;
597  case 2:
598  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
599  m_base[1]->GetBdata(),
600  m_base[2]->GetDbdata(),
601  tmp,outarray,wsp,
602  true,true,false);
603  break;
604  }
605  }

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

◆ v_IsBoundaryInteriorExpansion()

bool Nektar::StdRegions::StdHexExp::v_IsBoundaryInteriorExpansion ( )
protectedvirtual

◆ v_LaplacianMatrixOp() [1/2]

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 2278 of file StdHexExp.cpp.

2282  {
2283  StdHexExp::v_LaplacianMatrixOp_MatFree(inarray,outarray,mkey);
2284  }
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::StdRegions::StdHexExp::v_LaplacianMatrixOp ( const int  k1,
const int  k2,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
const StdMatrixKey mkey 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 2287 of file StdHexExp.cpp.

2291  {
2292  StdExpansion::LaplacianMatrixOp_MatFree(k1,k2,inarray,outarray,
2293  mkey);
2294  }
void LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)

References Nektar::StdRegions::StdExpansion::LaplacianMatrixOp_MatFree().

◆ v_LocCoordToLocCollapsed()

void Nektar::StdRegions::StdHexExp::v_LocCoordToLocCollapsed ( const Array< OneD, const NekDouble > &  xi,
Array< OneD, NekDouble > &  eta 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 607 of file StdHexExp.cpp.

609  {
610  eta[0] = xi[0];
611  eta[1] = xi[1];
612  eta[2] = xi[2];
613  }

◆ v_MassMatrixOp()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 2269 of file StdHexExp.cpp.

2273  {
2274  StdExpansion::MassMatrixOp_MatFree(inarray,outarray,mkey);
2275  }
void MassMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)

References Nektar::StdRegions::StdExpansion::MassMatrixOp_MatFree().

◆ v_MultiplyByStdQuadratureMetric()

void Nektar::StdRegions::StdHexExp::v_MultiplyByStdQuadratureMetric ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 2338 of file StdHexExp.cpp.

2340  {
2341  int i;
2342  int nquad0 = m_base[0]->GetNumPoints();
2343  int nquad1 = m_base[1]->GetNumPoints();
2344  int nquad2 = m_base[2]->GetNumPoints();
2345  int nq01 = nquad0*nquad1;
2346  int nq12 = nquad1*nquad2;
2347 
2348  const Array<OneD, const NekDouble>& w0 = m_base[0]->GetW();
2349  const Array<OneD, const NekDouble>& w1 = m_base[1]->GetW();
2350  const Array<OneD, const NekDouble>& w2 = m_base[2]->GetW();
2351 
2352  for(i = 0; i < nq12; ++i)
2353  {
2354  Vmath::Vmul(nquad0, inarray.get()+i*nquad0, 1,
2355  w0.get(), 1, outarray.get()+i*nquad0,1);
2356  }
2357 
2358  for(i = 0; i < nq12; ++i)
2359  {
2360  Vmath::Smul(nquad0, w1[i%nquad1], outarray.get()+i*nquad0, 1,
2361  outarray.get()+i*nquad0, 1);
2362  }
2363 
2364  for(i = 0; i < nquad2; ++i)
2365  {
2366  Vmath::Smul(nq01, w2[i], outarray.get()+i*nq01, 1,
2367  outarray.get()+i*nq01, 1);
2368  }
2369  }
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216

References Nektar::StdRegions::StdExpansion::m_base, Vmath::Smul(), and Vmath::Vmul().

◆ v_NumBndryCoeffs()

int Nektar::StdRegions::StdHexExp::v_NumBndryCoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 690 of file StdHexExp.cpp.

691  {
694  "BasisType is not a boundary interior form");
697  "BasisType is not a boundary interior form");
700  "BasisType is not a boundary interior form");
701 
702  int nmodes0 = m_base[0]->GetNumModes();
703  int nmodes1 = m_base[1]->GetNumModes();
704  int nmodes2 = m_base[2]->GetNumModes();
705 
706  return ( 2*( nmodes0*nmodes1 + nmodes0*nmodes2
707  + nmodes1*nmodes2)
708  - 4*( nmodes0 + nmodes1 + nmodes2 ) + 8 );
709  }

References ASSERTL1, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::GetBasisType(), and Nektar::StdRegions::StdExpansion::m_base.

◆ v_NumDGBndryCoeffs()

int Nektar::StdRegions::StdHexExp::v_NumDGBndryCoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 711 of file StdHexExp.cpp.

712  {
715  "BasisType is not a boundary interior form");
718  "BasisType is not a boundary interior form");
721  "BasisType is not a boundary interior form");
722 
723  int nmodes0 = m_base[0]->GetNumModes();
724  int nmodes1 = m_base[1]->GetNumModes();
725  int nmodes2 = m_base[2]->GetNumModes();
726 
727  return 2*( nmodes0*nmodes1 + nmodes0*nmodes2
728  + nmodes1*nmodes2 );
729  }

References ASSERTL1, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::GetBasisType(), and Nektar::StdRegions::StdExpansion::m_base.

◆ v_PhysDeriv() [1/2]

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

Differentiation Methods.

For Hexahedral region can use the PhysTensorDeriv function defined under StdExpansion. Following tenserproduct:

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 94 of file StdHexExp.cpp.

98  {
99  StdExpansion3D::PhysTensorDeriv(inarray, out_d0, out_d1, out_d2);
100  }
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.

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

Referenced by v_StdPhysDeriv().

◆ v_PhysDeriv() [2/2]

void Nektar::StdRegions::StdHexExp::v_PhysDeriv ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual
Parameters
dirDirection in which to compute derivative. Valid values are 0, 1, 2.
inarrayInput array.
outarrayOutput array.

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 109 of file StdHexExp.cpp.

112  {
113  switch(dir)
114  {
115  case 0:
116  {
117  PhysDeriv(inarray, outarray, NullNekDouble1DArray,
119  }
120  break;
121  case 1:
122  {
123  PhysDeriv(inarray, NullNekDouble1DArray, outarray,
125  }
126  break;
127  case 2:
128  {
130  NullNekDouble1DArray, outarray);
131  }
132  break;
133  default:
134  {
135  ASSERTL1(false,"input dir is out of range");
136  }
137  break;
138  }
139  }
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)
static Array< OneD, NekDouble > NullNekDouble1DArray

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

◆ v_StdPhysDeriv() [1/2]

void Nektar::StdRegions::StdHexExp::v_StdPhysDeriv ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_d0,
Array< OneD, NekDouble > &  out_d1,
Array< OneD, NekDouble > &  out_d2 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 141 of file StdHexExp.cpp.

146  {
147  StdHexExp::v_PhysDeriv(inarray, out_d0, out_d1, out_d2);
148  }
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)
Differentiation Methods.
Definition: StdHexExp.cpp:94

References v_PhysDeriv().

◆ v_StdPhysDeriv() [2/2]

void Nektar::StdRegions::StdHexExp::v_StdPhysDeriv ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 151 of file StdHexExp.cpp.

154  {
155  StdHexExp::v_PhysDeriv(dir, inarray, outarray);
156  }

References v_PhysDeriv().

◆ v_SVVLaplacianFilter()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 2371 of file StdHexExp.cpp.

2373  {
2374  // Generate an orthonogal expansion
2375  int qa = m_base[0]->GetNumPoints();
2376  int qb = m_base[1]->GetNumPoints();
2377  int qc = m_base[2]->GetNumPoints();
2378  int nmodes_a = m_base[0]->GetNumModes();
2379  int nmodes_b = m_base[1]->GetNumModes();
2380  int nmodes_c = m_base[2]->GetNumModes();
2381  // Declare orthogonal basis.
2382  LibUtilities::PointsKey pa(qa,m_base[0]->GetPointsType());
2383  LibUtilities::PointsKey pb(qb,m_base[1]->GetPointsType());
2384  LibUtilities::PointsKey pc(qc,m_base[2]->GetPointsType());
2385 
2386  LibUtilities::BasisKey Ba(LibUtilities::eOrtho_A,nmodes_a,pa);
2387  LibUtilities::BasisKey Bb(LibUtilities::eOrtho_A,nmodes_b,pb);
2388  LibUtilities::BasisKey Bc(LibUtilities::eOrtho_A,nmodes_c,pc);
2389  StdHexExp OrthoExp(Ba,Bb,Bc);
2390 
2391  Array<OneD, NekDouble> orthocoeffs(OrthoExp.GetNcoeffs());
2392  int i,j,k,cnt=0;
2393 
2394  // project onto modal space.
2395  OrthoExp.FwdTrans(array,orthocoeffs);
2396 
2397  if(mkey.ConstFactorExists(eFactorSVVPowerKerDiffCoeff))
2398  {
2399  // Rodrigo's power kernel
2400  NekDouble cutoff = mkey.GetConstFactor(eFactorSVVCutoffRatio);
2401  NekDouble SvvDiffCoeff =
2402  mkey.GetConstFactor(eFactorSVVPowerKerDiffCoeff)*
2403  mkey.GetConstFactor(eFactorSVVDiffCoeff);
2404 
2405  for(int i = 0; i < nmodes_a; ++i)
2406  {
2407  for(int j = 0; j < nmodes_b; ++j)
2408  {
2409  NekDouble fac1 = std::max(
2410  pow((1.0*i)/(nmodes_a-1),cutoff*nmodes_a),
2411  pow((1.0*j)/(nmodes_b-1),cutoff*nmodes_b));
2412 
2413  for(int k = 0; k < nmodes_c; ++k)
2414  {
2415  NekDouble fac = std::max(fac1,
2416  pow((1.0*k)/(nmodes_c-1),cutoff*nmodes_c));
2417 
2418  orthocoeffs[cnt]
2419  *= SvvDiffCoeff * fac;
2420  cnt++;
2421  }
2422  }
2423  }
2424  }
2425  else if(mkey.ConstFactorExists(eFactorSVVDGKerDiffCoeff)) // Rodrigo/Mansoor's DG Kernel
2426  {
2427  NekDouble SvvDiffCoeff =
2428  mkey.GetConstFactor(eFactorSVVDGKerDiffCoeff)*
2429  mkey.GetConstFactor(eFactorSVVDiffCoeff);
2430 
2431  int max_abc = max(nmodes_a-kSVVDGFiltermodesmin,
2432  nmodes_b-kSVVDGFiltermodesmin);
2433  max_abc = max(max_abc, nmodes_c-kSVVDGFiltermodesmin);
2434  // clamp max_abc
2435  max_abc = max(max_abc,0);
2436  max_abc = min(max_abc,kSVVDGFiltermodesmax-kSVVDGFiltermodesmin);
2437 
2438  for(int i = 0; i < nmodes_a; ++i)
2439  {
2440  for(int j = 0; j < nmodes_b; ++j)
2441  {
2442  int maxij = max(i,j);
2443 
2444  for(int k = 0; k < nmodes_c; ++k)
2445  {
2446  int maxijk = max(maxij,k);
2447  maxijk = min(maxijk,kSVVDGFiltermodesmax-1);
2448 
2449  orthocoeffs[cnt] *= SvvDiffCoeff *
2450  kSVVDGFilter[max_abc][maxijk];
2451  cnt++;
2452  }
2453  }
2454  }
2455  }
2456  else
2457  {
2458 
2459  int cutoff = (int) (mkey.GetConstFactor(eFactorSVVCutoffRatio)*min(nmodes_a,nmodes_b));
2460  NekDouble SvvDiffCoeff = mkey.GetConstFactor(eFactorSVVDiffCoeff);
2461  // Filter just trilinear space
2462  int nmodes = max(nmodes_a,nmodes_b);
2463  nmodes = max(nmodes,nmodes_c);
2464 
2465  Array<OneD, NekDouble> fac(nmodes,1.0);
2466  for(j = cutoff; j < nmodes; ++j)
2467  {
2468  fac[j] = fabs((j-nmodes)/((NekDouble) (j-cutoff+1.0)));
2469  fac[j] *= fac[j]; //added this line to conform with equation
2470  }
2471 
2472  for(i = 0; i < nmodes_a; ++i)
2473  {
2474  for(j = 0; j < nmodes_b; ++j)
2475  {
2476  for(k = 0; k < nmodes_c; ++k)
2477  {
2478  if((i >= cutoff)||(j >= cutoff)||(k >= cutoff))
2479  {
2480  orthocoeffs[i*nmodes_a*nmodes_b +
2481  j*nmodes_c + k] *=
2482  (SvvDiffCoeff*exp(-(fac[i]+fac[j]+fac[k])));
2483  }
2484  else
2485  {
2486  orthocoeffs[i*nmodes_a*nmodes_b + j*nmodes_c + k] *= 0.0;
2487  }
2488  }
2489  }
2490  }
2491  }
2492 
2493  // backward transform to physical space
2494  OrthoExp.BwdTrans(orthocoeffs,array);
2495  }
const int kSVVDGFiltermodesmin
Definition: StdRegions.hpp:384
const int kSVVDGFiltermodesmax
Definition: StdRegions.hpp:385
const NekDouble kSVVDGFilter[9][11]
Definition: StdRegions.hpp:387

References Nektar::StdRegions::StdExpansion::BwdTrans(), Nektar::StdRegions::StdMatrixKey::ConstFactorExists(), Nektar::StdRegions::eFactorSVVCutoffRatio, Nektar::StdRegions::eFactorSVVDGKerDiffCoeff, Nektar::StdRegions::eFactorSVVDiffCoeff, Nektar::StdRegions::eFactorSVVPowerKerDiffCoeff, Nektar::LibUtilities::eOrtho_A, Nektar::StdRegions::StdExpansion::FwdTrans(), Nektar::StdRegions::StdMatrixKey::GetConstFactor(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::StdRegions::kSVVDGFilter, Nektar::StdRegions::kSVVDGFiltermodesmax, Nektar::StdRegions::kSVVDGFiltermodesmin, and Nektar::StdRegions::StdExpansion::m_base.

◆ v_WeakDerivMatrixOp()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 2297 of file StdHexExp.cpp.

2301  {
2302  StdExpansion::WeakDerivMatrixOp_MatFree(i,inarray,outarray,
2303  mkey);
2304  }
void WeakDerivMatrixOp_MatFree(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)

References Nektar::StdRegions::StdExpansion::WeakDerivMatrixOp_MatFree().