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)
 
int GetNedges () const
 return the number of edges in 3D expansion More...
 
int GetEdgeNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge. More...
 
void GetEdgeInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards)
 
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion
 StdExpansion ()
 Default Constructor. More...
 
 StdExpansion (const int numcoeffs, const int numbases, const LibUtilities::BasisKey &Ba=LibUtilities::NullBasisKey, const LibUtilities::BasisKey &Bb=LibUtilities::NullBasisKey, const LibUtilities::BasisKey &Bc=LibUtilities::NullBasisKey)
 Constructor. More...
 
 StdExpansion (const StdExpansion &T)
 Copy Constructor. More...
 
virtual ~StdExpansion ()
 Destructor. More...
 
int GetNumBases () const
 This function returns the number of 1D bases used in the expansion. More...
 
const Array< OneD, const LibUtilities::BasisSharedPtr > & GetBase () const
 This function gets the shared point to basis. More...
 
const LibUtilities::BasisSharedPtrGetBasis (int dir) const
 This function gets the shared point to basis in the dir direction. More...
 
int GetNcoeffs (void) const
 This function returns the total number of coefficients used in the expansion. More...
 
int GetTotPoints () const
 This function returns the total number of quadrature points used in the element. More...
 
LibUtilities::BasisType GetBasisType (const int dir) const
 This function returns the type of basis used in the dir direction. More...
 
int GetBasisNumModes (const int dir) const
 This function returns the number of expansion modes in the dir direction. More...
 
int EvalBasisNumModesMax (void) const
 This function returns the maximum number of expansion modes over all local directions. More...
 
LibUtilities::PointsType GetPointsType (const int dir) const
 This function returns the type of quadrature points used in the dir direction. More...
 
int GetNumPoints (const int dir) const
 This function returns the number of quadrature points in the dir direction. More...
 
const Array< OneD, const NekDouble > & GetPoints (const int dir) const
 This function returns a pointer to the array containing the quadrature points in dir direction. More...
 
int GetNverts () const
 This function returns the number of vertices of the expansion domain. More...
 
int GetTraceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th trace. More...
 
int GetTraceIntNcoeffs (const int i) const
 
int GetTraceNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th trace. More...
 
const LibUtilities::BasisKey GetTraceBasisKey (const int i, int k=-1) const
 This function returns the basis key belonging to the i-th trace. More...
 
LibUtilities::PointsKey GetTracePointsKey (const int i, int k=-1) const
 This function returns the basis key belonging to the i-th trace. More...
 
int NumBndryCoeffs (void) const
 
int NumDGBndryCoeffs (void) const
 
const LibUtilities::PointsKey GetNodalPointsKey () const
 This function returns the type of expansion Nodal point type if defined. More...
 
int GetNtraces () const
 Returns the number of trace elements connected to this element. More...
 
LibUtilities::ShapeType DetShapeType () const
 This function returns the shape of the expansion domain. More...
 
std::shared_ptr< StdExpansionGetStdExp (void) const
 
std::shared_ptr< StdExpansionGetLinStdExp (void) const
 
int GetShapeDimension () const
 
bool IsBoundaryInteriorExpansion ()
 
bool IsNodalNonTensorialExp ()
 
void BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Backward transformation from coefficient space to physical space. More...
 
void FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Forward transformation from physical space to coefficient space. More...
 
void 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)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray)
 
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
void DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
int CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
NekDouble StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
 
int GetCoordim ()
 
void GetBoundaryMap (Array< OneD, unsigned int > &outarray)
 
void GetInteriorMap (Array< OneD, unsigned int > &outarray)
 
int GetVertexMap (const int localVertexId, bool useCoeffPacking=false)
 
void GetTraceToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
 
void GetTraceInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eForwards)
 
void GetTraceNumModes (const int tid, int &numModes0, int &numModes1, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
 
void MultiplyByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
DNekMatSharedPtr CreateGeneralMatrix (const StdMatrixKey &mkey)
 this function generates the mass matrix \(\mathbf{M}[i][j] = \int \phi_i(\mathbf{x}) \phi_j(\mathbf{x}) d\mathbf{x}\) More...
 
void GeneralMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
 
void ExponentialFilter (Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
 
void LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionDiffusionReactionMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
void HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
DNekMatSharedPtr GenMatrix (const StdMatrixKey &mkey)
 
void PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
void PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void PhysDeriv_s (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
 
void PhysDeriv_n (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
 
void PhysDirectionalDeriv (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &outarray)
 
void StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
void StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
NekDouble PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble PhysEvaluateBasis (const Array< OneD, const NekDouble > &coords, int mode)
 This function evaluates the basis function mode mode at a point coords of the domain. More...
 
void LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 Convert local cartesian coordinate xi into local collapsed coordinates eta. More...
 
void LocCollapsedToLocCoord (const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi)
 Convert local collapsed coordinates eta into local cartesian coordinate xi. More...
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
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)
 
NekDouble Linf (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( L_\infty\) error \( |\epsilon|_\infty = \max |u - u_{exact}|\) where \( u_{exact}\) is given by the array sol. More...
 
NekDouble L2 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( L_2\) error, \( | \epsilon |_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 dx \right]^{1/2} d\xi_1 \) where \( u_{exact}\) is given by the array sol. More...
 
NekDouble H1 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( H^1\) error, \( | \epsilon |^1_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 + \nabla(u - u_{exact})\cdot\nabla(u - u_{exact})\cdot dx \right]^{1/2} d\xi_1 \) where \( u_{exact}\) is given by the array sol. More...
 
const LibUtilities::PointsKeyVector GetPointsKeys () const
 
DNekMatSharedPtr BuildInverseTransformationMatrix (const DNekScalMatSharedPtr &m_transformationmatrix)
 
void PhysInterpToSimplexEquiSpaced (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int npset=-1)
 This function performs an interpolation from the physical space points provided at input into an array of equispaced points which are not the collapsed coordinate. So for a tetrahedron you will only get a tetrahedral number of values. More...
 
void GetSimplexEquiSpacedConnectivity (Array< OneD, int > &conn, bool standard=true)
 This function provides the connectivity of local simplices (triangles or tets) to connect the equispaced data points provided by PhysInterpToSimplexEquiSpaced. More...
 
void EquiSpacedToCoeffs (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs a projection/interpolation from the equispaced points sometimes used in post-processing onto the coefficient space. More...
 
template<class T >
std::shared_ptr< T > as ()
 
void IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
 
void GenStdMatBwdDeriv (const int dir, DNekMatSharedPtr &mat)
 

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_LocCollapsedToLocCoord (const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi)
 
virtual void v_FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 
NekDouble v_PhysEvaluateBasis (const Array< OneD, const NekDouble > &coords, int mode) final
 
virtual int v_GetNverts () const
 
virtual int v_GetNedges () const
 
virtual int v_GetNtraces () const
 
virtual LibUtilities::ShapeType v_DetShapeType () const
 
virtual int v_NumBndryCoeffs () const
 
virtual int v_NumDGBndryCoeffs () const
 
virtual int v_GetTraceNcoeffs (const int i) const
 
virtual int v_GetTotalTraceIntNcoeffs () const
 
virtual int v_GetTraceIntNcoeffs (const int i) const
 
virtual int v_GetTraceNumPoints (const int i) const
 
virtual LibUtilities::PointsKey v_GetTracePointsKey (const int i, const int j) const
 
virtual int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
virtual const LibUtilities::BasisKey v_GetTraceBasisKey (const int i, const int k) const
 
virtual bool v_IsBoundaryInteriorExpansion ()
 
virtual void v_GetCoords (Array< OneD, NekDouble > &coords_x, Array< OneD, NekDouble > &coords_y, Array< OneD, NekDouble > &coords_z)
 
virtual void v_GetTraceNumModes (const int fid, int &numModes0, int &numModes1, Orientation faceOrient=eDir1FwdDir1_Dir2FwdDir2)
 
virtual int v_GetEdgeNcoeffs (const int i) const
 
virtual int v_GetVertexMap (int localVertexId, bool useCoeffPacking=false)
 
virtual void v_GetInteriorMap (Array< OneD, unsigned int > &outarray)
 
virtual void v_GetBoundaryMap (Array< OneD, unsigned int > &outarray)
 
virtual void v_GetTraceToElementMap (const int fid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation faceOrient, int P, int Q)
 
virtual void v_GetEdgeInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
 
virtual void v_GetTraceInteriorToElementMap (const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
 
virtual 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_GenStdMatBwdDeriv (const int dir, DNekMatSharedPtr &mat)
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion
DNekMatSharedPtr CreateStdMatrix (const StdMatrixKey &mkey)
 
DNekBlkMatSharedPtr CreateStdStaticCondMatrix (const StdMatrixKey &mkey)
 Create the static condensation of a matrix when using a boundary interior decomposition. More...
 
void BwdTrans_MatOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDirectionalDerivBase_SumFac (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GeneralMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
 
void LaplacianMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp_MatFree (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionDiffusionReactionMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
void HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void HelmholtzMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_SetCoeffsToOrientation (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)
 
template<int DIR>
NekDouble BaryEvaluate (const NekDouble &coord, const NekDouble *physvals)
 This function performs the barycentric interpolation of the polynomial stored in coord at a point physvals using barycentric interpolation weights in direction. More...
 
template<int DIR>
NekDouble BaryEvaluateBasis (const NekDouble &coord, const int &mode)
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::StdRegions::StdExpansion
Array< OneD, LibUtilities::BasisSharedPtrm_base
 
int m_elmt_id
 
int m_ncoeffs
 
LibUtilities::NekManager< StdMatrixKey, DNekMat, StdMatrixKey::opLessm_stdMatrixManager
 
LibUtilities::NekManager< StdMatrixKey, DNekBlkMat, StdMatrixKey::opLessm_stdStaticCondMatrixManager
 

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 52 of file StdHexExp.cpp.

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

◆ StdHexExp() [3/3]

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

Definition at line 62 of file StdHexExp.cpp.

62  :
63  StdExpansion(T),
65  {
66  }

◆ ~StdHexExp()

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

Definition at line 68 of file StdHexExp.cpp.

69  {
70  }

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 172 of file StdHexExp.cpp.

175  {
178  "Basis[1] is not a general tensor type");
179 
182  "Basis[2] is not a general tensor type");
183 
184  if(m_base[0]->Collocation() && m_base[1]->Collocation()
185  && m_base[2]->Collocation())
186  {
188  * m_base[1]->GetNumPoints()
189  * m_base[2]->GetNumPoints(),
190  inarray, 1, outarray, 1);
191  }
192  else
193  {
194  StdHexExp::BwdTrans_SumFac(inarray,outarray);
195  }
196  }
#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:158
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:221
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:1199

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 202 of file StdHexExp.cpp.

204  {
205  Array<OneD, NekDouble> wsp(m_base[0]->GetNumPoints()*
206  m_base[2]->GetNumModes()*
207  (m_base[1]->GetNumModes() + m_base[1]->GetNumPoints())); // FIX THIS
208 
209  BwdTrans_SumFacKernel(m_base[0]->GetBdata(),
210  m_base[1]->GetBdata(),
211  m_base[2]->GetBdata(),
212  inarray,outarray,wsp,true,true,true);
213  }
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 228 of file StdHexExp.cpp.

238  {
239  int nquad0 = m_base[0]->GetNumPoints();
240  int nquad1 = m_base[1]->GetNumPoints();
241  int nquad2 = m_base[2]->GetNumPoints();
242  int nmodes0 = m_base[0]->GetNumModes();
243  int nmodes1 = m_base[1]->GetNumModes();
244  int nmodes2 = m_base[2]->GetNumModes();
245 
246  // Check if using collocation, if requested.
247  bool colldir0 = doCheckCollDir0?(m_base[0]->Collocation()):false;
248  bool colldir1 = doCheckCollDir1?(m_base[1]->Collocation()):false;
249  bool colldir2 = doCheckCollDir2?(m_base[2]->Collocation()):false;
250 
251  // If collocation in all directions, Physical values at quadrature
252  // points is just a copy of the modes.
253  if(colldir0 && colldir1 && colldir2)
254  {
255  Vmath::Vcopy(m_ncoeffs,inarray.get(),1,outarray.get(),1);
256  }
257  else
258  {
259  // Check sufficiently large workspace.
260  ASSERTL1(wsp.size()>=nquad0*nmodes2*(nmodes1+nquad1),
261  "Workspace size is not sufficient");
262 
263  // Assign second half of workspace for 2nd DGEMM operation.
264  Array<OneD, NekDouble> wsp2 = wsp + nquad0*nmodes1*nmodes2;
265 
266  // BwdTrans in each direction using DGEMM
267  Blas::Dgemm('T','T', nmodes1*nmodes2, nquad0, nmodes0,
268  1.0, &inarray[0], nmodes0,
269  base0.get(), nquad0,
270  0.0, &wsp[0], nmodes1*nmodes2);
271  Blas::Dgemm('T','T', nquad0*nmodes2, nquad1, nmodes1,
272  1.0, &wsp[0], nmodes1,
273  base1.get(), nquad1,
274  0.0, &wsp2[0], nquad0*nmodes2);
275  Blas::Dgemm('T','T', nquad0*nquad1, nquad2, nmodes2,
276  1.0, &wsp2[0], nmodes2,
277  base2.get(), nquad2,
278  0.0, &outarray[0], nquad0*nquad1);
279  }
280  }
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 op(A)[m x k], op(B)[k x n], C[m x n] DGEMM perfo...
Definition: Blas.hpp:394

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 844 of file StdHexExp.cpp.

845  {
846  int nmodes = nummodes[modes_offset]*nummodes[modes_offset+1]*nummodes[modes_offset+2];
847  modes_offset += 3;
848 
849  return nmodes;
850  }

◆ 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_DetShapeType()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 714 of file StdHexExp.cpp.

715  {
717  }

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 2496 of file StdHexExp.cpp.

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

626  {
627  int nquad0 = m_base[0]->GetNumPoints();
628  int nquad1 = m_base[1]->GetNumPoints();
629  int nquad2 = m_base[2]->GetNumPoints();
630 
631  Array<OneD, const NekDouble> base0 = m_base[0]->GetBdata();
632  Array<OneD, const NekDouble> base1 = m_base[1]->GetBdata();
633  Array<OneD, const NekDouble> base2 = m_base[2]->GetBdata();
634 
635  int btmp0 = m_base[0]->GetNumModes();
636  int btmp1 = m_base[1]->GetNumModes();
637  int mode2 = mode/(btmp0*btmp1);
638  int mode1 = (mode-mode2*btmp0*btmp1)/btmp0;
639  int mode0 = (mode-mode2*btmp0*btmp1)%btmp0;
640 
641  ASSERTL2(mode == mode2 * btmp0 * btmp1 + mode1 * btmp0 + mode0,
642  "Mode lookup failed.");
643  ASSERTL2(mode < m_ncoeffs,
644  "Calling argument mode is larger than total expansion "
645  "order");
646 
647  for(int i = 0; i < nquad1*nquad2; ++i)
648  {
649  Vmath::Vcopy(nquad0,(NekDouble *)(base0.get() + mode0*nquad0),1,
650  &outarray[0]+i*nquad0, 1);
651  }
652 
653  for(int j = 0; j < nquad2; ++j)
654  {
655  for(int i = 0; i < nquad0; ++i)
656  {
657  Vmath::Vmul(nquad1,(NekDouble *)(base1.get() + mode1*nquad1),1,
658  &outarray[0]+i+j*nquad0*nquad1, nquad0,
659  &outarray[0]+i+j*nquad0*nquad1, nquad0);
660  }
661  }
662 
663  for(int i = 0; i < nquad2; i++)
664  {
665  Blas::Dscal(nquad0*nquad1,base2[mode2*nquad2+i],
666  &outarray[0]+i*nquad0*nquad1,1);
667  }
668  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
Definition: ErrorUtil.hpp:274
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
Definition: Blas.hpp:182
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:192

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 291 of file StdHexExp.cpp.

294  {
295  // If using collocation expansion, coefficients match physical
296  // data points so just do a direct copy.
297  if( (m_base[0]->Collocation())
298  &&(m_base[1]->Collocation())
299  &&(m_base[2]->Collocation()) )
300  {
301  Vmath::Vcopy(GetNcoeffs(), &inarray[0], 1, &outarray[0], 1);
302  }
303  else
304  {
305  // Compute B^TWu
306  IProductWRTBase(inarray,outarray);
307 
308  // get Mass matrix inverse
309  StdMatrixKey masskey(eInvMass,DetShapeType(),*this);
310  DNekMatSharedPtr matsys = GetStdMatrix(masskey);
311 
312  // copy inarray in case inarray == outarray
313  DNekVec in (m_ncoeffs,outarray);
314  DNekVec out(m_ncoeffs,outarray,eWrapper);
315 
316  // Solve for coefficients.
317  out = (*matsys)*in;
318 
319  }
320  }
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:124
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:617
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:537
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:376
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:265

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 1154 of file StdHexExp.cpp.

1155  {
1158  "BasisType is not a boundary interior form");
1161  "BasisType is not a boundary interior form");
1164  "BasisType is not a boundary interior form");
1165 
1166  int i;
1167  int nummodes [3] = {m_base[0]->GetNumModes(),
1168  m_base[1]->GetNumModes(),
1169  m_base[2]->GetNumModes()};
1170 
1171  int nBndCoeffs = NumBndryCoeffs();
1172 
1173  if(outarray.size()!=nBndCoeffs)
1174  {
1175  outarray = Array<OneD, unsigned int>(nBndCoeffs);
1176  }
1177 
1178  const LibUtilities::BasisType Btype [3] = {GetBasisType(0),
1179  GetBasisType(1),
1180  GetBasisType(2)};
1181 
1182  int p,q,r;
1183  int cnt = 0;
1184 
1185  int BndIdx [3][2];
1186  int IntIdx [3][2];
1187 
1188  for(i = 0; i < 3; i++)
1189  {
1190  BndIdx[i][0] = 0;
1191 
1192  if( Btype[i] == LibUtilities::eModified_A)
1193  {
1194  BndIdx[i][1] = 1;
1195  IntIdx[i][0] = 2;
1196  IntIdx[i][1] = nummodes[i];
1197  }
1198  else
1199  {
1200  BndIdx[i][1] = nummodes[i]-1;
1201  IntIdx[i][0] = 1;
1202  IntIdx[i][1] = nummodes[i]-1;
1203  }
1204  }
1205 
1206 
1207  for(i = 0; i < 2; i++)
1208  {
1209  r = BndIdx[2][i];
1210  for( q = 0; q < nummodes[1]; q++)
1211  {
1212  for( p = 0; p < nummodes[0]; p++)
1213  {
1214  outarray[cnt++] = r*nummodes[0]*nummodes[1]+q*nummodes[0] + p;
1215  }
1216  }
1217  }
1218 
1219  for(r = IntIdx[2][0]; r < IntIdx[2][1]; r++)
1220  {
1221  for( i = 0; i < 2; i++)
1222  {
1223  q = BndIdx[1][i];
1224  for( p = 0; p < nummodes[0]; p++)
1225  {
1226  outarray[cnt++] = r*nummodes[0]*nummodes[1] +
1227  q*nummodes[0] + p;
1228  }
1229  }
1230 
1231  for( q = IntIdx[1][0]; q < IntIdx[1][1]; q++)
1232  {
1233  for( i = 0; i < 2; i++)
1234  {
1235  p = BndIdx[0][i];
1236  outarray[cnt++] = r*nummodes[0]*nummodes[1] +
1237  q*nummodes[0] + p;
1238  }
1239  }
1240  }
1241 
1242  sort(outarray.get(), outarray.get() + nBndCoeffs);
1243  }
@ 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 881 of file StdHexExp.cpp.

884  {
885  Array<OneD, const NekDouble> eta_x = m_base[0]->GetZ();
886  Array<OneD, const NekDouble> eta_y = m_base[1]->GetZ();
887  Array<OneD, const NekDouble> eta_z = m_base[2]->GetZ();
888  int Qx = GetNumPoints(0);
889  int Qy = GetNumPoints(1);
890  int Qz = GetNumPoints(2);
891 
892  // Convert collapsed coordinates into cartesian coordinates:
893  // eta --> xi
894  for( int k = 0; k < Qz; ++k ) {
895  for( int j = 0; j < Qy; ++j ) {
896  for( int i = 0; i < Qx; ++i ) {
897  int s = i + Qx*(j + Qy*k);
898  xi_x[s] = eta_x[i];
899  xi_y[s] = eta_y[j];
900  xi_z[s] = eta_z[k];
901 
902  }
903  }
904  }
905  }

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

◆ v_GetEdgeInteriorToElementMap()

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

Reimplemented from Nektar::StdRegions::StdExpansion3D.

Definition at line 1607 of file StdHexExp.cpp.

1612  {
1615  "BasisType is not a boundary interior form");
1618  "BasisType is not a boundary interior form");
1621  "BasisType is not a boundary interior form");
1622 
1623  ASSERTL1((eid>=0)&&(eid<12),
1624  "local edge id must be between 0 and 11");
1625 
1626  int nEdgeIntCoeffs = GetEdgeNcoeffs(eid)-2;
1627 
1628  if(maparray.size()!=nEdgeIntCoeffs)
1629  {
1630  maparray = Array<OneD, unsigned int>(nEdgeIntCoeffs);
1631  }
1632 
1633  if(signarray.size() != nEdgeIntCoeffs)
1634  {
1635  signarray = Array<OneD, int>(nEdgeIntCoeffs,1);
1636  }
1637  else
1638  {
1639  fill( signarray.get() , signarray.get()+nEdgeIntCoeffs, 1 );
1640  }
1641 
1642  int nummodes [3] = {m_base[0]->GetNumModes(),
1643  m_base[1]->GetNumModes(),
1644  m_base[2]->GetNumModes()};
1645 
1646  const LibUtilities::BasisType bType [3] = {GetBasisType(0),
1647  GetBasisType(1),
1648  GetBasisType(2)};
1649 
1650  bool reverseOrdering = false;
1651  bool signChange = false;
1652 
1653  int IdxRange [3][2] = {{0,0},{0,0},{0,0}};
1654 
1655  switch(eid)
1656  {
1657  case 0:
1658  case 1:
1659  case 2:
1660  case 3:
1661  {
1662  IdxRange[2][0] = 0;
1663  IdxRange[2][1] = 1;
1664  }
1665  break;
1666  case 8:
1667  case 9:
1668  case 10:
1669  case 11:
1670  {
1671  if( bType[2] == LibUtilities::eGLL_Lagrange)
1672  {
1673  IdxRange[2][0] = nummodes[2] - 1;
1674  IdxRange[2][1] = nummodes[2];
1675  }
1676  else
1677  {
1678  IdxRange[2][0] = 1;
1679  IdxRange[2][1] = 2;
1680  }
1681  }
1682  break;
1683  case 4:
1684  case 5:
1685  case 6:
1686  case 7:
1687  {
1688  if( bType[2] == LibUtilities::eGLL_Lagrange)
1689  {
1690  IdxRange[2][0] = 1;
1691  IdxRange[2][1] = nummodes[2] - 1;
1692 
1693  if(edgeOrient==eBackwards)
1694  {
1695  reverseOrdering = true;
1696  }
1697  }
1698  else
1699  {
1700  IdxRange[2][0] = 2;
1701  IdxRange[2][1] = nummodes[2];
1702 
1703  if(edgeOrient==eBackwards)
1704  {
1705  signChange = true;
1706  }
1707  }
1708  }
1709  break;
1710  }
1711 
1712  switch(eid)
1713  {
1714  case 0:
1715  case 4:
1716  case 5:
1717  case 8:
1718  {
1719  IdxRange[1][0] = 0;
1720  IdxRange[1][1] = 1;
1721  }
1722  break;
1723  case 2:
1724  case 6:
1725  case 7:
1726  case 10:
1727  {
1728  if( bType[1] == LibUtilities::eGLL_Lagrange)
1729  {
1730  IdxRange[1][0] = nummodes[1] - 1;
1731  IdxRange[1][1] = nummodes[1];
1732  }
1733  else
1734  {
1735  IdxRange[1][0] = 1;
1736  IdxRange[1][1] = 2;
1737  }
1738  }
1739  break;
1740  case 1:
1741  case 9:
1742  {
1743  if( bType[1] == LibUtilities::eGLL_Lagrange)
1744  {
1745  IdxRange[1][0] = 1;
1746  IdxRange[1][1] = nummodes[1] - 1;
1747 
1748  if(edgeOrient==eBackwards)
1749  {
1750  reverseOrdering = true;
1751  }
1752  }
1753  else
1754  {
1755  IdxRange[1][0] = 2;
1756  IdxRange[1][1] = nummodes[1];
1757 
1758  if(edgeOrient==eBackwards)
1759  {
1760  signChange = true;
1761  }
1762  }
1763  }
1764  break;
1765  case 3:
1766  case 11:
1767  {
1768  if( bType[1] == LibUtilities::eGLL_Lagrange)
1769  {
1770  IdxRange[1][0] = 1;
1771  IdxRange[1][1] = nummodes[1] - 1;
1772 
1773  if(edgeOrient==eForwards)
1774  {
1775  reverseOrdering = true;
1776  }
1777  }
1778  else
1779  {
1780  IdxRange[1][0] = 2;
1781  IdxRange[1][1] = nummodes[1];
1782 
1783  if(edgeOrient==eForwards)
1784  {
1785  signChange = true;
1786  }
1787  }
1788  }
1789  break;
1790  }
1791 
1792  switch(eid)
1793  {
1794  case 3:
1795  case 4:
1796  case 7:
1797  case 11:
1798  {
1799  IdxRange[0][0] = 0;
1800  IdxRange[0][1] = 1;
1801  }
1802  break;
1803  case 1:
1804  case 5:
1805  case 6:
1806  case 9:
1807  {
1808  if( bType[0] == LibUtilities::eGLL_Lagrange)
1809  {
1810  IdxRange[0][0] = nummodes[0] - 1;
1811  IdxRange[0][1] = nummodes[0];
1812  }
1813  else
1814  {
1815  IdxRange[0][0] = 1;
1816  IdxRange[0][1] = 2;
1817  }
1818  }
1819  break;
1820  case 0:
1821  case 8:
1822  {
1823  if( bType[0] == LibUtilities::eGLL_Lagrange)
1824  {
1825  IdxRange[0][0] = 1;
1826  IdxRange[0][1] = nummodes[0] - 1;
1827 
1828  if(edgeOrient==eBackwards)
1829  {
1830  reverseOrdering = true;
1831  }
1832  }
1833  else
1834  {
1835  IdxRange[0][0] = 2;
1836  IdxRange[0][1] = nummodes[0];
1837 
1838  if(edgeOrient==eBackwards)
1839  {
1840  signChange = true;
1841  }
1842  }
1843  }
1844  break;
1845  case 2:
1846  case 10:
1847  {
1848  if( bType[0] == LibUtilities::eGLL_Lagrange)
1849  {
1850  IdxRange[0][0] = 1;
1851  IdxRange[0][1] = nummodes[0] - 1;
1852 
1853  if(edgeOrient==eForwards)
1854  {
1855  reverseOrdering = true;
1856  }
1857  }
1858  else
1859  {
1860  IdxRange[0][0] = 2;
1861  IdxRange[0][1] = nummodes[0];
1862 
1863  if(edgeOrient==eForwards)
1864  {
1865  signChange = true;
1866  }
1867  }
1868  }
1869  break;
1870  }
1871 
1872  int cnt = 0;
1873 
1874  for(int r = IdxRange[2][0]; r < IdxRange[2][1]; r++)
1875  {
1876  for(int q = IdxRange[1][0]; q < IdxRange[1][1]; q++)
1877  {
1878  for(int p = IdxRange[0][0]; p < IdxRange[0][1]; p++)
1879  {
1880  maparray[cnt++]
1881  = r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
1882  }
1883  }
1884  }
1885 
1886  if( reverseOrdering )
1887  {
1888  reverse( maparray.get() , maparray.get()+nEdgeIntCoeffs );
1889  }
1890 
1891  if(signChange)
1892  {
1893  for(int p = 1; p < nEdgeIntCoeffs; p+=2)
1894  {
1895  signarray[p] = -1;
1896  }
1897  }
1898  }
int GetEdgeNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th edge.

References ASSERTL1, Nektar::StdRegions::eBackwards, Nektar::StdRegions::eForwards, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion3D::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::StdExpansion3D.

Definition at line 2239 of file StdHexExp.cpp.

2240  {
2241  ASSERTL2((i >= 0)&&(i <= 11),"edge id is out of range");
2242 
2243  if((i == 0)||(i == 2)||(i == 8)||(i == 10))
2244  {
2245  return GetBasisNumModes(0);
2246  }
2247  else if((i == 1)||(i == 3)||(i == 9)||(i == 11))
2248  {
2249  return GetBasisNumModes(1);
2250  }
2251  else
2252  {
2253  return GetBasisNumModes(2);
2254  }
2255  }
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
Definition: StdExpansion.h:171

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

◆ 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 1090 of file StdHexExp.cpp.

1091  {
1094  "BasisType is not a boundary interior form");
1097  "BasisType is not a boundary interior form");
1100  "BasisType is not a boundary interior form");
1101 
1102  int i;
1103  int nummodes [3] = {m_base[0]->GetNumModes(),
1104  m_base[1]->GetNumModes(),
1105  m_base[2]->GetNumModes()};
1106 
1107  int nIntCoeffs = m_ncoeffs - NumBndryCoeffs();
1108 
1109  if(outarray.size() != nIntCoeffs)
1110  {
1111  outarray = Array<OneD, unsigned int>(nIntCoeffs);
1112  }
1113 
1114  const LibUtilities::BasisType Btype [3] = {GetBasisType(0),
1115  GetBasisType(1),
1116  GetBasisType(2)};
1117 
1118  int p,q,r;
1119  int cnt = 0;
1120 
1121  int IntIdx [3][2];
1122 
1123  for(i = 0; i < 3; i++)
1124  {
1125  if( Btype[i] == LibUtilities::eModified_A)
1126  {
1127  IntIdx[i][0] = 2;
1128  IntIdx[i][1] = nummodes[i];
1129  }
1130  else
1131  {
1132  IntIdx[i][0] = 1;
1133  IntIdx[i][1] = nummodes[i]-1;
1134  }
1135  }
1136 
1137  for(r = IntIdx[2][0]; r < IntIdx[2][1]; r++)
1138  {
1139  for( q = IntIdx[1][0]; q < IntIdx[1][1]; q++)
1140  {
1141  for( p = IntIdx[0][0]; p < IntIdx[0][1]; p++)
1142  {
1143  outarray[cnt++] = r*nummodes[0]*nummodes[1] +
1144  q*nummodes[0] + p;
1145  }
1146  }
1147  }
1148  }

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 ( void  ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion3D.

Definition at line 704 of file StdHexExp.cpp.

705  {
706  return 12;
707  }

◆ v_GetNtraces()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 709 of file StdHexExp.cpp.

710  {
711  return 6;
712  }

◆ v_GetNverts()

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

Implements Nektar::StdRegions::StdExpansion.

Definition at line 699 of file StdHexExp.cpp.

700  {
701  return 8;
702  }

◆ v_GetTotalTraceIntNcoeffs()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 796 of file StdHexExp.cpp.

797  {
798  return 2*((GetBasisNumModes(0)-2)*(GetBasisNumModes(1)-2)+
799  (GetBasisNumModes(0)-2)*(GetBasisNumModes(2)-2)+
800  (GetBasisNumModes(1)-2)*(GetBasisNumModes(2)-2));
801  }

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

◆ v_GetTraceBasisKey()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 852 of file StdHexExp.cpp.

854  {
855  ASSERTL2(i >= 0 && i <= 5, "face id is out of range");
856  ASSERTL2(k >= 0 && k <= 1, "basis key id is out of range");
857 
858  int dir = k;
859  switch(i)
860  {
861  case 0:
862  case 5:
863  dir = k;
864  break;
865  case 1:
866  case 3:
867  dir = 2*k;
868  break;
869  case 2:
870  case 4:
871  dir = k+1;
872  break;
873  }
874 
875  return EvaluateQuadFaceBasisKey(k,
876  m_base[dir]->GetBasisType(),
877  m_base[dir]->GetNumPoints(),
878  m_base[dir]->GetNumModes());
879  }
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_GetTraceInteriorToElementMap()

void Nektar::StdRegions::StdHexExp::v_GetTraceInteriorToElementMap ( const int  fid,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray,
const Orientation  faceOrient = eDir1FwdDir1_Dir2FwdDir2 
)
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 1905 of file StdHexExp.cpp.

1909  {
1912  "BasisType is not a boundary interior form");
1915  "BasisType is not a boundary interior form");
1918  "BasisType is not a boundary interior form");
1919 
1920  ASSERTL1((fid>=0)&&(fid<6),
1921  "local face id must be between 0 and 5");
1922 
1923  int nFaceIntCoeffs = v_GetTraceIntNcoeffs(fid);
1924 
1925  if(maparray.size()!=nFaceIntCoeffs)
1926  {
1927  maparray = Array<OneD, unsigned int>(nFaceIntCoeffs);
1928  }
1929 
1930  if(signarray.size() != nFaceIntCoeffs)
1931  {
1932  signarray = Array<OneD, int>(nFaceIntCoeffs,1);
1933  }
1934  else
1935  {
1936  fill( signarray.get() , signarray.get()+nFaceIntCoeffs, 1 );
1937  }
1938 
1939  int nummodes [3] = {m_base[0]->GetNumModes(),
1940  m_base[1]->GetNumModes(),
1941  m_base[2]->GetNumModes()};
1942 
1943  const LibUtilities::BasisType bType [3] = {GetBasisType(0),
1944  GetBasisType(1),
1945  GetBasisType(2)};
1946 
1947  int nummodesA = 0;
1948  int nummodesB = 0;
1949 
1950  // Determine the number of modes in face directions A & B based
1951  // on the face index given.
1952  switch(fid)
1953  {
1954  case 0:
1955  case 5:
1956  {
1957  nummodesA = nummodes[0];
1958  nummodesB = nummodes[1];
1959  }
1960  break;
1961  case 1:
1962  case 3:
1963  {
1964  nummodesA = nummodes[0];
1965  nummodesB = nummodes[2];
1966  }
1967  break;
1968  case 2:
1969  case 4:
1970  {
1971  nummodesA = nummodes[1];
1972  nummodesB = nummodes[2];
1973  }
1974  }
1975 
1976  Array<OneD, int> arrayindx(nFaceIntCoeffs);
1977 
1978  // Create a mapping array to account for transposition of the
1979  // coordinates due to face orientation.
1980  for(int i = 0; i < (nummodesB-2); i++)
1981  {
1982  for(int j = 0; j < (nummodesA-2); j++)
1983  {
1984  if( faceOrient < eDir1FwdDir2_Dir2FwdDir1 )
1985  {
1986  arrayindx[i*(nummodesA-2)+j] = i*(nummodesA-2)+j;
1987  }
1988  else
1989  {
1990  arrayindx[i*(nummodesA-2)+j] = j*(nummodesB-2)+i;
1991  }
1992  }
1993  }
1994 
1995  int IdxRange [3][2];
1996  int Incr[3];
1997 
1998  Array<OneD, int> sign0(nummodes[0], 1);
1999  Array<OneD, int> sign1(nummodes[1], 1);
2000  Array<OneD, int> sign2(nummodes[2], 1);
2001 
2002  // Set the upper and lower bounds, and increment for the faces
2003  // involving the first coordinate direction.
2004  switch(fid)
2005  {
2006  case 0: // bottom face
2007  {
2008  IdxRange[2][0] = 0;
2009  IdxRange[2][1] = 1;
2010  Incr[2] = 1;
2011  }
2012  break;
2013  case 5: // top face
2014  {
2015  if( bType[2] == LibUtilities::eGLL_Lagrange)
2016  {
2017  IdxRange[2][0] = nummodes[2] - 1;
2018  IdxRange[2][1] = nummodes[2];
2019  Incr[2] = 1;
2020  }
2021  else
2022  {
2023  IdxRange[2][0] = 1;
2024  IdxRange[2][1] = 2;
2025  Incr[2] = 1;
2026  }
2027 
2028  }
2029  break;
2030  default: // all other faces
2031  {
2032  if( bType[2] == LibUtilities::eGLL_Lagrange)
2033  {
2034  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 2 )
2035  {
2036  IdxRange[2][0] = nummodes[2] - 2;
2037  IdxRange[2][1] = 0;
2038  Incr[2] = -1;
2039 
2040  }
2041  else
2042  {
2043  IdxRange[2][0] = 1;
2044  IdxRange[2][1] = nummodes[2] - 1;
2045  Incr[2] = 1;
2046  }
2047  }
2048  else
2049  {
2050  IdxRange[2][0] = 2;
2051  IdxRange[2][1] = nummodes[2];
2052  Incr[2] = 1;
2053 
2054  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 2 )
2055  {
2056  for(int i = 3; i < nummodes[2]; i+=2)
2057  {
2058  sign2[i] = -1;
2059  }
2060  }
2061  }
2062  }
2063  }
2064 
2065  // Set the upper and lower bounds, and increment for the faces
2066  // involving the second coordinate direction.
2067  switch(fid)
2068  {
2069  case 1:
2070  {
2071  IdxRange[1][0] = 0;
2072  IdxRange[1][1] = 1;
2073  Incr[1] = 1;
2074  }
2075  break;
2076  case 3:
2077  {
2078  if( bType[1] == LibUtilities::eGLL_Lagrange)
2079  {
2080  IdxRange[1][0] = nummodes[1] - 1;
2081  IdxRange[1][1] = nummodes[1];
2082  Incr[1] = 1;
2083  }
2084  else
2085  {
2086  IdxRange[1][0] = 1;
2087  IdxRange[1][1] = 2;
2088  Incr[1] = 1;
2089  }
2090  }
2091  break;
2092  case 0:
2093  case 5:
2094  {
2095  if( bType[1] == LibUtilities::eGLL_Lagrange)
2096  {
2097  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 2 )
2098  {
2099  IdxRange[1][0] = nummodes[1] - 2;
2100  IdxRange[1][1] = 0;
2101  Incr[1] = -1;
2102 
2103  }
2104  else
2105  {
2106  IdxRange[1][0] = 1;
2107  IdxRange[1][1] = nummodes[1] - 1;
2108  Incr[1] = 1;
2109  }
2110  }
2111  else
2112  {
2113  IdxRange[1][0] = 2;
2114  IdxRange[1][1] = nummodes[1];
2115  Incr[1] = 1;
2116 
2117  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 2 )
2118  {
2119  for(int i = 3; i < nummodes[1]; i+=2)
2120  {
2121  sign1[i] = -1;
2122  }
2123  }
2124  }
2125  }
2126  break;
2127  default: // case2: case4:
2128  {
2129  if( bType[1] == LibUtilities::eGLL_Lagrange)
2130  {
2131  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 4 > 1 )
2132  {
2133  IdxRange[1][0] = nummodes[1] - 2;
2134  IdxRange[1][1] = 0;
2135  Incr[1] = -1;
2136 
2137  }
2138  else
2139  {
2140  IdxRange[1][0] = 1;
2141  IdxRange[1][1] = nummodes[1] - 1;
2142  Incr[1] = 1;
2143  }
2144  }
2145  else
2146  {
2147  IdxRange[1][0] = 2;
2148  IdxRange[1][1] = nummodes[1];
2149  Incr[1] = 1;
2150 
2151  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 4 > 1 )
2152  {
2153  for(int i = 3; i < nummodes[1]; i+=2)
2154  {
2155  sign1[i] = -1;
2156  }
2157  }
2158  }
2159  }
2160  }
2161 
2162  switch(fid)
2163  {
2164  case 4:
2165  {
2166  IdxRange[0][0] = 0;
2167  IdxRange[0][1] = 1;
2168  Incr[0] = 1;
2169  }
2170  break;
2171  case 2:
2172  {
2173  if( bType[0] == LibUtilities::eGLL_Lagrange)
2174  {
2175  IdxRange[0][0] = nummodes[0] - 1;
2176  IdxRange[0][1] = nummodes[0];
2177  Incr[0] = 1;
2178  }
2179  else
2180  {
2181  IdxRange[0][0] = 1;
2182  IdxRange[0][1] = 2;
2183  Incr[0] = 1;
2184  }
2185  }
2186  break;
2187  default:
2188  {
2189  if( bType[0] == LibUtilities::eGLL_Lagrange)
2190  {
2191  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 4 > 1 )
2192  {
2193  IdxRange[0][0] = nummodes[0] - 2;
2194  IdxRange[0][1] = 0;
2195  Incr[0] = -1;
2196 
2197  }
2198  else
2199  {
2200  IdxRange[0][0] = 1;
2201  IdxRange[0][1] = nummodes[0] - 1;
2202  Incr[0] = 1;
2203  }
2204  }
2205  else
2206  {
2207  IdxRange[0][0] = 2;
2208  IdxRange[0][1] = nummodes[0];
2209  Incr[0] = 1;
2210 
2211  if( ((int) (faceOrient-eDir1FwdDir1_Dir2FwdDir2)) % 4 > 1 )
2212  {
2213  for(int i = 3; i < nummodes[0]; i+=2)
2214  {
2215  sign0[i] = -1;
2216  }
2217  }
2218  }
2219  }
2220  }
2221 
2222  int cnt = 0;
2223 
2224  for(int r = IdxRange[2][0]; r != IdxRange[2][1]; r+=Incr[2])
2225  {
2226  for(int q = IdxRange[1][0]; q != IdxRange[1][1]; q+=Incr[1])
2227  {
2228  for(int p = IdxRange[0][0]; p != IdxRange[0][1]; p+=Incr[0])
2229  {
2230  maparray [ arrayindx[cnt ] ]
2231  = r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
2232  signarray[ arrayindx[cnt++] ]
2233  = sign0[p] * sign1[q] * sign2[r];
2234  }
2235  }
2236  }
2237  }
virtual int v_GetTraceIntNcoeffs(const int i) const
Definition: StdHexExp.cpp:778

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::m_base, CellMLToNektar.cellml_metadata::p, and v_GetTraceIntNcoeffs().

◆ v_GetTraceIntNcoeffs()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 778 of file StdHexExp.cpp.

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

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

Referenced by v_GetTraceInteriorToElementMap().

◆ v_GetTraceNcoeffs()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 761 of file StdHexExp.cpp.

762  {
763  ASSERTL2((i >= 0) && (i <= 5), "face id is out of range");
764  if((i == 0) || (i == 5))
765  {
766  return GetBasisNumModes(0)*GetBasisNumModes(1);
767  }
768  else if((i == 1) || (i == 3))
769  {
770  return GetBasisNumModes(0)*GetBasisNumModes(2);
771  }
772  else
773  {
774  return GetBasisNumModes(1)*GetBasisNumModes(2);
775  }
776  }

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

◆ v_GetTraceNumModes()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 907 of file StdHexExp.cpp.

912  {
913  int nummodes [3] = {m_base[0]->GetNumModes(),
914  m_base[1]->GetNumModes(),
915  m_base[2]->GetNumModes()};
916  switch(fid)
917  {
918  case 0:
919  case 5:
920  {
921  numModes0 = nummodes[0];
922  numModes1 = nummodes[1];
923  }
924  break;
925  case 1:
926  case 3:
927  {
928  numModes0 = nummodes[0];
929  numModes1 = nummodes[2];
930  }
931  break;
932  case 2:
933  case 4:
934  {
935  numModes0 = nummodes[1];
936  numModes1 = nummodes[2];
937  }
938  break;
939  default:
940  {
941  ASSERTL0(false,"fid out of range");
942  }
943  break;
944  }
945 
946  if ( faceOrient >= eDir1FwdDir2_Dir2FwdDir1 )
947  {
948  std::swap(numModes0, numModes1);
949  }
950  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216

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

◆ v_GetTraceNumPoints()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 803 of file StdHexExp.cpp.

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

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

◆ v_GetTracePointsKey()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 824 of file StdHexExp.cpp.

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

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

◆ v_GetTraceToElementMap()

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

Only for basis type Modified_A or GLL_LAGRANGE in all directions.

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1248 of file StdHexExp.cpp.

1255  {
1256  int i,j;
1257  int nummodesA=0, nummodesB=0;
1258 
1259  ASSERTL1(GetBasisType(0) == GetBasisType(1) &&
1260  GetBasisType(0) == GetBasisType(2),
1261  "Method only implemented if BasisType is indentical in "
1262  "all directions");
1265  "Method only implemented for Modified_A or "
1266  "GLL_Lagrange BasisType");
1267 
1268  const int nummodes0 = m_base[0]->GetNumModes();
1269  const int nummodes1 = m_base[1]->GetNumModes();
1270  const int nummodes2 = m_base[2]->GetNumModes();
1271 
1272  switch(fid)
1273  {
1274  case 0:
1275  case 5:
1276  nummodesA = nummodes0;
1277  nummodesB = nummodes1;
1278  break;
1279  case 1:
1280  case 3:
1281  nummodesA = nummodes0;
1282  nummodesB = nummodes2;
1283  break;
1284  case 2:
1285  case 4:
1286  nummodesA = nummodes1;
1287  nummodesB = nummodes2;
1288  break;
1289  default:
1290  ASSERTL0(false,"fid must be between 0 and 5");
1291  }
1292 
1293  bool CheckForZeroedModes = false;
1294 
1295  if (P == -1)
1296  {
1297  P = nummodesA;
1298  Q = nummodesB;
1299  }
1300 
1301  if((P != nummodesA)||(Q != nummodesB))
1302  {
1303  CheckForZeroedModes = true;
1304  }
1305 
1306  bool modified = (GetBasisType(0) == LibUtilities::eModified_A);
1307  int nFaceCoeffs = P*Q;
1308 
1309  if(maparray.size() != nFaceCoeffs)
1310  {
1311  maparray = Array<OneD, unsigned int>(nFaceCoeffs);
1312  }
1313 
1314  if(signarray.size() != nFaceCoeffs)
1315  {
1316  signarray = Array<OneD, int>(nFaceCoeffs,1);
1317  }
1318  else
1319  {
1320  fill( signarray.get() , signarray.get()+nFaceCoeffs, 1 );
1321  }
1322 
1323  Array<OneD, int> arrayindx(nFaceCoeffs);
1324 
1325  for(i = 0; i < Q; i++)
1326  {
1327  for(j = 0; j < P; j++)
1328  {
1329  if( faceOrient < eDir1FwdDir2_Dir2FwdDir1 )
1330  {
1331  arrayindx[i*P+j] = i*P+j;
1332  }
1333  else
1334  {
1335  arrayindx[i*P+j] = j*Q+i;
1336  }
1337  }
1338  }
1339 
1340  int offset = 0;
1341  int jump1 = 1;
1342  int jump2 = 1;
1343 
1344  switch(fid)
1345  {
1346  case 5:
1347  {
1348  if (modified)
1349  {
1350  offset = nummodes0*nummodes1;
1351  }
1352  else
1353  {
1354  offset = (nummodes2-1)*nummodes0*nummodes1;
1355  jump1 = nummodes0;
1356  }
1357  }
1358  /* Falls through. */
1359  case 0:
1360  {
1361  jump1 = nummodes0;
1362  break;
1363  }
1364  case 3:
1365  {
1366  if (modified)
1367  {
1368  offset = nummodes0;
1369  }
1370  else
1371  {
1372  offset = nummodes0*(nummodes1-1);
1373  jump1 = nummodes0*nummodes1;
1374  }
1375  }
1376  /* Falls through. */
1377  case 1:
1378  {
1379  jump1 = nummodes0*nummodes1;
1380  break;
1381  }
1382  case 2:
1383  {
1384  if (modified)
1385  {
1386  offset = 1;
1387  }
1388  else
1389  {
1390  offset = nummodes0-1;
1391  jump1 = nummodes0*nummodes1;
1392  jump2 = nummodes0;
1393 
1394  }
1395  }
1396  /* Falls through. */
1397  case 4:
1398  {
1399  jump1 = nummodes0*nummodes1;
1400  jump2 = nummodes0;
1401  break;
1402  }
1403  default:
1404  ASSERTL0(false,"fid must be between 0 and 5");
1405  }
1406 
1407  for(i = 0; i < Q; i++)
1408  {
1409  for(j = 0; j < P; j++)
1410  {
1411  maparray[ arrayindx[i*P+j] ]
1412  = i*jump1 + j*jump2 + offset;
1413  }
1414  }
1415 
1416 
1417  if(CheckForZeroedModes)
1418  {
1419  if(modified)
1420  {
1421  // zero signmap and set maparray to zero if elemental
1422  // modes are not as large as face modesl
1423  for(int i = 0; i < nummodesB; i++)
1424  {
1425  for(int j = nummodesA; j < P; j++)
1426  {
1427  signarray[arrayindx[i*P+j]] = 0.0;
1428  maparray[arrayindx[i*P+j]] = maparray[0];
1429  }
1430  }
1431 
1432  for(int i = nummodesB; i < Q; i++)
1433  {
1434  for(int j = 0; j < P; j++)
1435  {
1436  signarray[arrayindx[i*P+j]] = 0.0;
1437  maparray[arrayindx[i*P+j]] = maparray[0];
1438  }
1439  }
1440  }
1441  else
1442  {
1443  ASSERTL0(false,"Different trace space face dimention and element face dimention not possible for GLL-Lagrange bases");
1444  }
1445  }
1446 
1447  if( (faceOrient==eDir1FwdDir1_Dir2BwdDir2) ||
1448  (faceOrient==eDir1BwdDir1_Dir2BwdDir2) ||
1449  (faceOrient==eDir1BwdDir2_Dir2FwdDir1) ||
1450  (faceOrient==eDir1BwdDir2_Dir2BwdDir1) )
1451  {
1452  if(faceOrient<eDir1FwdDir2_Dir2FwdDir1)
1453  {
1454  if (modified)
1455  {
1456  for(int i = 3; i < Q; i+=2)
1457  {
1458  for(int j = 0; j < P; j++)
1459  {
1460  signarray[ arrayindx[i*P+j] ] *= -1;
1461  }
1462  }
1463 
1464  for(int i = 0; i < P; i++)
1465  {
1466  swap( maparray[i] , maparray[i+P] );
1467  swap( signarray[i] , signarray[i+P] );
1468  }
1469 
1470  }
1471  else
1472  {
1473  for(int i = 0; i < P; i++)
1474  {
1475  for(int j = 0; j < Q/2; j++)
1476  {
1477  swap( maparray[i + j*P],
1478  maparray[i+P*Q
1479  -P -j*P] );
1480  swap( signarray[i + j*P],
1481  signarray[i+P*Q
1482  -P -j*P]);
1483  }
1484  }
1485  }
1486  }
1487  else
1488  {
1489  if (modified)
1490  {
1491  for(int i = 0; i < Q; i++)
1492  {
1493  for(int j = 3; j < P; j+=2)
1494  {
1495  signarray[ arrayindx[i*P+j] ] *= -1;
1496  }
1497  }
1498 
1499  for(int i = 0; i < Q; i++)
1500  {
1501  swap( maparray[i] , maparray[i+Q] );
1502  swap( signarray[i] , signarray[i+Q] );
1503  }
1504 
1505  }
1506  else
1507  {
1508  for(int i = 0; i < P; i++)
1509  {
1510  for(int j = 0; j < Q/2; j++)
1511  {
1512  swap( maparray[i*Q + j],
1513  maparray[i*Q + Q -1 -j]);
1514  swap( signarray[i*Q + j],
1515  signarray[i*Q + Q -1 -j]);
1516  }
1517  }
1518  }
1519  }
1520  }
1521 
1522  if( (faceOrient==eDir1BwdDir1_Dir2FwdDir2) ||
1523  (faceOrient==eDir1BwdDir1_Dir2BwdDir2) ||
1524  (faceOrient==eDir1FwdDir2_Dir2BwdDir1) ||
1525  (faceOrient==eDir1BwdDir2_Dir2BwdDir1) )
1526  {
1527  if(faceOrient<eDir1FwdDir2_Dir2FwdDir1)
1528  {
1529  if (modified)
1530  {
1531  for(i = 0; i < Q; i++)
1532  {
1533  for(j = 3; j < P; j+=2)
1534  {
1535  signarray[ arrayindx[i*P+j] ] *= -1;
1536  }
1537  }
1538 
1539  for(i = 0; i < Q; i++)
1540  {
1541  swap( maparray[i*P],
1542  maparray[i*P+1]);
1543  swap( signarray[i*P],
1544  signarray[i*P+1]);
1545  }
1546  }
1547  else
1548  {
1549  for(i = 0; i < Q; i++)
1550  {
1551  for(j = 0; j < P/2; j++)
1552  {
1553  swap( maparray[i*P + j],
1554  maparray[i*P + P -1 -j]);
1555  swap( signarray[i*P + j],
1556  signarray[i*P + P -1 -j]);
1557  }
1558  }
1559  }
1560 
1561 
1562 
1563  }
1564  else
1565  {
1566  if (modified)
1567  {
1568  for(i = 3; i < Q; i+=2)
1569  {
1570  for(j = 0; j < P; j++)
1571  {
1572  signarray[ arrayindx[i*P+j] ] *= -1;
1573  }
1574  }
1575 
1576  for(i = 0; i < P; i++)
1577  {
1578  swap( maparray[i*Q],
1579  maparray[i*Q+1]);
1580  swap( signarray[i*Q],
1581  signarray[i*Q+1]);
1582  }
1583  }
1584  else
1585  {
1586  for(i = 0; i < Q; i++)
1587  {
1588  for(j = 0; j < P/2; j++)
1589  {
1590  swap( maparray[i + j*Q] ,
1591  maparray[i+P*Q - Q -j*Q] );
1592  swap( signarray[i + j*Q] ,
1593  signarray[i+P*Q - Q -j*Q] );
1594  }
1595  }
1596  }
1597  }
1598  }
1599  }

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::GetBasisType(), Nektar::StdRegions::StdExpansion::m_base, and main::P.

◆ 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 960 of file StdHexExp.cpp.

961  {
964  "BasisType is not a boundary interior form");
967  "BasisType is not a boundary interior form");
970  "BasisType is not a boundary interior form");
971 
972  ASSERTL1((localVertexId>=0)&&(localVertexId<8),
973  "local vertex id must be between 0 and 7");
974 
975  int p = 0;
976  int q = 0;
977  int r = 0;
978 
979  // Retrieve the number of modes in each dimension.
980  int nummodes [3] = {m_base[0]->GetNumModes(),
981  m_base[1]->GetNumModes(),
982  m_base[2]->GetNumModes()};
983 
984  if(useCoeffPacking == true) // follow packing of coefficients i.e q,r,p
985  {
986  if(localVertexId > 3)
987  {
989  {
990  r = nummodes[2]-1;
991  }
992  else
993  {
994  r = 1;
995  }
996  }
997 
998  switch(localVertexId % 4)
999  {
1000  case 0:
1001  break;
1002  case 1:
1003  {
1005  {
1006  p = nummodes[0]-1;
1007  }
1008  else
1009  {
1010  p = 1;
1011  }
1012  }
1013  break;
1014  case 2:
1015  {
1017  {
1018  q = nummodes[1]-1;
1019  }
1020  else
1021  {
1022  q = 1;
1023  }
1024  }
1025  break;
1026  case 3:
1027  {
1029  {
1030  p = nummodes[0]-1;
1031  q = nummodes[1]-1;
1032  }
1033  else
1034  {
1035  p = 1;
1036  q = 1;
1037  }
1038  }
1039  break;
1040  }
1041  }
1042  else
1043  {
1044  // Right face (vertices 1,2,5,6)
1045  if( (localVertexId % 4) % 3 > 0 )
1046  {
1048  {
1049  p = nummodes[0]-1;
1050  }
1051  else
1052  {
1053  p = 1;
1054  }
1055  }
1056  // Back face (vertices 2,3,6,7)
1057  if( localVertexId % 4 > 1 )
1058  {
1060  {
1061  q = nummodes[1]-1;
1062  }
1063  else
1064  {
1065  q = 1;
1066  }
1067  }
1068 
1069  // Top face (vertices 4,5,6,7)
1070  if( localVertexId > 3)
1071  {
1073  {
1074  r = nummodes[2]-1;
1075  }
1076  else
1077  {
1078  r = 1;
1079  }
1080  }
1081  }
1082  // Compute the local number.
1083  return r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
1084  }

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 352 of file StdHexExp.cpp.

355  {
356  if(m_base[0]->Collocation() &&
357  m_base[1]->Collocation() &&
358  m_base[2]->Collocation())
359  {
360  MultiplyByQuadratureMetric(inarray,outarray);
361  }
362  else
363  {
364  StdHexExp::v_IProductWRTBase_SumFac(inarray,outarray);
365  }
366  }
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:733
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multbyweights=true)
Definition: StdHexExp.cpp:386

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 371 of file StdHexExp.cpp.

374  {
375  int nq = GetTotPoints();
376  StdMatrixKey iprodmatkey(eIProductWRTBase,DetShapeType(),*this);
377  DNekMatSharedPtr iprodmat = GetStdMatrix(iprodmatkey);
378 
379  Blas::Dgemv('N',m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
380  m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
381  }
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:134

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 386 of file StdHexExp.cpp.

390  {
391  int nquad0 = m_base[0]->GetNumPoints();
392  int nquad1 = m_base[1]->GetNumPoints();
393  int nquad2 = m_base[2]->GetNumPoints();
394  int order0 = m_base[0]->GetNumModes();
395  int order1 = m_base[1]->GetNumModes();
396 
397  Array<OneD, NekDouble> wsp(nquad0*nquad1*(nquad2+order0) +
398  order0*order1*nquad2);
399 
400  if(multiplybyweights)
401  {
402  Array<OneD, NekDouble> tmp(inarray.size());
403  MultiplyByQuadratureMetric(inarray,tmp);
404 
406  m_base[1]->GetBdata(),
407  m_base[2]->GetBdata(),
408  tmp,outarray,wsp,true,true,true);
409  }
410  else
411  {
413  m_base[1]->GetBdata(),
414  m_base[2]->GetBdata(),
415  inarray,outarray,wsp,true,true,true);
416  }
417  }
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 424 of file StdHexExp.cpp.

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

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 512 of file StdHexExp.cpp.

515  {
516  StdHexExp::IProductWRTDerivBase_SumFac(dir,inarray,outarray);
517  }
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 520 of file StdHexExp.cpp.

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

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 551 of file StdHexExp.cpp.

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

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_LocCollapsedToLocCoord()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 612 of file StdHexExp.cpp.

615  {
616  xi[0] = eta[0];
617  xi[1] = eta[1];
618  xi[2] = eta[2];
619  }

◆ 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 603 of file StdHexExp.cpp.

606  {
607  eta[0] = xi[0];
608  eta[1] = xi[1];
609  eta[2] = xi[2];
610  }

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

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 720 of file StdHexExp.cpp.

721  {
724  "BasisType is not a boundary interior form");
727  "BasisType is not a boundary interior form");
730  "BasisType is not a boundary interior form");
731 
732  int nmodes0 = m_base[0]->GetNumModes();
733  int nmodes1 = m_base[1]->GetNumModes();
734  int nmodes2 = m_base[2]->GetNumModes();
735 
736  return ( 2*( nmodes0*nmodes1 + nmodes0*nmodes2
737  + nmodes1*nmodes2)
738  - 4*( nmodes0 + nmodes1 + nmodes2 ) + 8 );
739  }

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 741 of file StdHexExp.cpp.

742  {
745  "BasisType is not a boundary interior form");
748  "BasisType is not a boundary interior form");
751  "BasisType is not a boundary interior form");
752 
753  int nmodes0 = m_base[0]->GetNumModes();
754  int nmodes1 = m_base[1]->GetNumModes();
755  int nmodes2 = m_base[2]->GetNumModes();
756 
757  return 2*( nmodes0*nmodes1 + nmodes0*nmodes2
758  + nmodes1*nmodes2 );
759  }

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 90 of file StdHexExp.cpp.

94  {
95  StdExpansion3D::PhysTensorDeriv(inarray, out_d0, out_d1, out_d2);
96  }
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 104 of file StdHexExp.cpp.

107  {
108  switch(dir)
109  {
110  case 0:
111  {
112  PhysDeriv(inarray, outarray, NullNekDouble1DArray,
114  }
115  break;
116  case 1:
117  {
118  PhysDeriv(inarray, NullNekDouble1DArray, outarray,
120  }
121  break;
122  case 2:
123  {
125  NullNekDouble1DArray, outarray);
126  }
127  break;
128  default:
129  {
130  ASSERTL1(false,"input dir is out of range");
131  }
132  break;
133  }
134  }
void PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
Definition: StdExpansion.h:855
static Array< OneD, NekDouble > NullNekDouble1DArray

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

◆ v_PhysEvaluateBasis()

NekDouble Nektar::StdRegions::StdHexExp::v_PhysEvaluateBasis ( const Array< OneD, const NekDouble > &  coords,
int  mode 
)
finalprotectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 670 of file StdHexExp.cpp.

673  {
674  ASSERTL2(coords[0] > -1 - NekConstants::kNekZeroTol,
675  "coord[0] < -1");
676  ASSERTL2(coords[0] < 1 + NekConstants::kNekZeroTol,
677  "coord[0] > 1");
678  ASSERTL2(coords[1] > -1 - NekConstants::kNekZeroTol,
679  "coord[1] < -1");
680  ASSERTL2(coords[1] < 1 + NekConstants::kNekZeroTol,
681  "coord[1] > 1");
682  ASSERTL2(coords[2] > -1 - NekConstants::kNekZeroTol,
683  "coord[2] < -1");
684  ASSERTL2(coords[2] < 1 + NekConstants::kNekZeroTol,
685  "coord[2] > 1");
686 
687  const int nm0 = m_base[0]->GetNumModes();
688  const int nm1 = m_base[1]->GetNumModes();
689  const int mode2 = mode / (nm0 * nm1);
690  const int mode1 = (mode - mode2 * nm0 * nm1) / nm0;
691  const int mode0 = (mode - mode2 * nm0 * nm1) % nm0;
692 
693  return
694  StdExpansion::BaryEvaluateBasis<0>(coords[0], mode0) *
695  StdExpansion::BaryEvaluateBasis<1>(coords[1], mode1) *
696  StdExpansion::BaryEvaluateBasis<2>(coords[2], mode2);
697  }
static const NekDouble kNekZeroTol

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

◆ 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 136 of file StdHexExp.cpp.

141  {
142  StdHexExp::v_PhysDeriv(inarray, out_d0, out_d1, out_d2);
143  }
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:90

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 145 of file StdHexExp.cpp.

148  {
149  StdHexExp::v_PhysDeriv(dir, inarray, outarray);
150  }

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 2370 of file StdHexExp.cpp.

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

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().