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:
Inheritance graph
[legend]
Collaboration diagram for Nektar::StdRegions::StdHexExp:
Collaboration graph
[legend]

Public Member Functions

 StdHexExp ()
 
 StdHexExp (const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc)
 
 StdHexExp (const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, NekDouble *coeffs, NekDouble *phys)
 
 StdHexExp (const StdHexExp &T)
 
 ~StdHexExp ()
 
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion3D
 StdExpansion3D ()
 
 StdExpansion3D (int numcoeffs, const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc)
 
 StdExpansion3D (const StdExpansion3D &T)
 
virtual ~StdExpansion3D ()
 
void PhysTensorDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray_d1, Array< OneD, NekDouble > &outarray_d2, Array< OneD, NekDouble > &outarray_d3)
 Calculate the 3D derivative in the local tensor/collapsed coordinate at the physical points. More...
 
void BwdTrans_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
 
void IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
 
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion
 StdExpansion ()
 Default Constructor. More...
 
 StdExpansion (const int numcoeffs, const int numbases, const LibUtilities::BasisKey &Ba=LibUtilities::NullBasisKey, const LibUtilities::BasisKey &Bb=LibUtilities::NullBasisKey, const LibUtilities::BasisKey &Bc=LibUtilities::NullBasisKey)
 Constructor. More...
 
 StdExpansion (const StdExpansion &T)
 Copy Constructor. More...
 
virtual ~StdExpansion ()
 Destructor. More...
 
int GetNumBases () const
 This function returns the number of 1D bases used in the expansion. More...
 
const Array< OneD, const LibUtilities::BasisSharedPtr > & GetBase () const
 This function gets the shared point to basis. More...
 
const LibUtilities::BasisSharedPtrGetBasis (int dir) const
 This function gets the shared point to basis in the dir direction. More...
 
int GetNcoeffs (void) const
 This function returns the total number of coefficients used in the expansion. More...
 
int GetTotPoints () const
 This function returns the total number of quadrature points used in the element. More...
 
LibUtilities::BasisType GetBasisType (const int dir) const
 This function returns the type of basis used in the dir direction. More...
 
int GetBasisNumModes (const int dir) const
 This function returns the number of expansion modes in the dir direction. More...
 
int EvalBasisNumModesMax (void) const
 This function returns the maximum number of expansion modes over all local directions. More...
 
LibUtilities::PointsType GetPointsType (const int dir) const
 This function returns the type of quadrature points used in the dir direction. More...
 
int GetNumPoints (const int dir) const
 This function returns the number of quadrature points in the dir direction. More...
 
const Array< OneD, const NekDouble > & GetPoints (const int dir) const
 This function returns a pointer to the array containing the quadrature points in dir direction. More...
 
int GetNverts () const
 This function returns the number of vertices of the expansion domain. More...
 
int GetNedges () const
 This function returns the number of edges of the expansion domain. More...
 
int GetEdgeNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge. More...
 
int GetTotalEdgeIntNcoeffs () const
 
int GetEdgeNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th edge. More...
 
int DetCartesianDirOfEdge (const int edge)
 
const LibUtilities::BasisKey DetEdgeBasisKey (const int i) const
 
const LibUtilities::BasisKey DetFaceBasisKey (const int i, const int k) const
 
int GetFaceNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th face. More...
 
int GetFaceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th face. More...
 
int GetFaceIntNcoeffs (const int i) const
 
int GetTotalFaceIntNcoeffs () const
 
LibUtilities::PointsKey GetFacePointsKey (const int i, const int j) const
 
int NumBndryCoeffs (void) const
 
int NumDGBndryCoeffs (void) const
 
LibUtilities::BasisType GetEdgeBasisType (const int i) const
 This function returns the type of expansion basis on the i-th edge. More...
 
const LibUtilities::PointsKey GetNodalPointsKey () const
 This function returns the type of expansion Nodal point type if defined. More...
 
int GetNfaces () const
 This function returns the number of faces of the expansion domain. More...
 
int GetNtrace () const
 Returns the number of trace elements connected to this element. More...
 
LibUtilities::ShapeType DetShapeType () const
 This function returns the shape of the expansion domain. More...
 
boost::shared_ptr< StdExpansionGetStdExp (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)
 
int GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
void SetElmtId (const int id)
 Set the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
void GetCoords (Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2=NullNekDouble1DArray, Array< OneD, NekDouble > &coords_3=NullNekDouble1DArray)
 this function returns the physical coordinates of the quadrature points of the expansion More...
 
void GetCoord (const Array< OneD, const NekDouble > &Lcoord, Array< OneD, NekDouble > &coord)
 given the coordinates of a point of the element in the local collapsed coordinate system, this function calculates the physical coordinates of the point More...
 
DNekMatSharedPtr GetStdMatrix (const StdMatrixKey &mkey)
 
DNekBlkMatSharedPtr GetStdStaticCondMatrix (const StdMatrixKey &mkey)
 
IndexMapValuesSharedPtr GetIndexMap (const IndexMapKey &ikey)
 
const Array< OneD, const NekDouble > & GetPhysNormals (void)
 
void SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
virtual void SetUpPhysNormals (const int edge)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const 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)
 
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
void DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
StdRegions::Orientation GetForient (int face)
 
StdRegions::Orientation GetEorient (int edge)
 
StdRegions::Orientation GetPorient (int point)
 
StdRegions::Orientation GetCartesianEorient (int edge)
 
void SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
 
void SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
int CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
void ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs)
 
NekDouble StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
 
int GetCoordim ()
 
void GetBoundaryMap (Array< OneD, unsigned int > &outarray)
 
void GetInteriorMap (Array< OneD, unsigned int > &outarray)
 
int GetVertexMap (const int localVertexId, bool useCoeffPacking=false)
 
void GetEdgeInteriorMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
void GetFaceInteriorMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
void GetEdgeToElementMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
void GetFaceToElementMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int nummodesA=-1, int nummodesB=-1)
 
void GetEdgePhysVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Extract the physical values along edge edge from inarray into outarray following the local edge orientation and point distribution defined by defined in EdgeExp. More...
 
void GetEdgePhysVals (const int edge, const boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetTracePhysVals (const int edge, const boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetVertexPhysVals (const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
 
void GetEdgeInterpVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetEdgeQFactors (const int edge, Array< OneD, NekDouble > &outarray)
 Extract the metric factors to compute the contravariant fluxes along edge edge and stores them into outarray following the local edge orientation (i.e. anticlockwise convention). More...
 
void GetFacePhysVals (const int face, const boost::shared_ptr< StdExpansion > &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=eNoOrientation)
 
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 LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionDiffusionReactionMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
void HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
DNekMatSharedPtr GenMatrix (const StdMatrixKey &mkey)
 
void PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
void PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void PhysDeriv_s (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
 
void PhysDeriv_n (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
 
void PhysDirectionalDeriv (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &outarray)
 
void StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
void StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void AddRobinMassMatrix (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
 
void AddRobinEdgeContribution (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, Array< OneD, NekDouble > &coeffs)
 
NekDouble PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
void LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 Convert local cartesian coordinate xi into local collapsed coordinates eta. More...
 
const boost::shared_ptr< SpatialDomains::GeomFactors > & GetMetricInfo (void) const
 
virtual int v_GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals (void)
 
virtual void v_SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
virtual void v_SetUpPhysNormals (const int edge)
 
virtual void v_ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmode_offset, NekDouble *coeffs)
 Unpack data from input file assuming it comes from the same expansion type. More...
 
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 DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual void v_DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual StdRegions::Orientation v_GetForient (int face)
 
virtual StdRegions::Orientation v_GetEorient (int edge)
 
virtual StdRegions::Orientation v_GetCartesianEorient (int edge)
 
virtual StdRegions::Orientation v_GetPorient (int point)
 
NekDouble Linf (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete $ L_\infty$ error $ |\epsilon|_\infty = \max |u - u_{exact}|$ where $ u_{exact}$ is given by the array sol. More...
 
NekDouble L2 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete $ L_2$ error, $ | \epsilon |_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 dx \right]^{1/2} d\xi_1 $ where $ u_{exact}$ is given by the array sol. More...
 
NekDouble H1 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete $ H^1$ error, $ | \epsilon |^1_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 + \nabla(u - u_{exact})\cdot\nabla(u - u_{exact})\cdot dx \right]^{1/2} d\xi_1 $ where $ u_{exact}$ is given by the array sol. More...
 
const NormalVectorGetEdgeNormal (const int edge) const
 
void ComputeEdgeNormal (const int edge)
 
void NegateEdgeNormal (const int edge)
 
bool EdgeNormalNegated (const int edge)
 
void ComputeFaceNormal (const int face)
 
void NegateFaceNormal (const int face)
 
void ComputeVertexNormal (const int vertex)
 
const NormalVectorGetFaceNormal (const int face) const
 
const NormalVectorGetVertexNormal (const int vertex) const
 
const NormalVectorGetSurfaceNormal (const int id) const
 
const LibUtilities::PointsKeyVector GetPointsKeys () const
 
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap (int eid)
 
Array< OneD, unsigned int > GetFaceInverseBoundaryMap (int fid, StdRegions::Orientation faceOrient=eNoOrientation)
 
DNekMatSharedPtr BuildInverseTransformationMatrix (const DNekScalMatSharedPtr &m_transformationmatrix)
 
void PhysInterpToSimplexEquiSpaced (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 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...
 
template<class T >
boost::shared_ptr< T > as ()
 
void IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
 

Protected Member Functions

virtual void v_PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
 Differentiation Methods. More...
 
virtual void v_PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
 
virtual void v_StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_BwdTrans_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
 
virtual void v_FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTBase_MatOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multbyweights=true)
 
virtual void v_IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
 
virtual void v_IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTDerivBase_MatOp (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 
virtual void v_FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 
virtual int v_GetNverts () const
 
virtual int v_GetNedges () const
 
virtual int v_GetNfaces () const
 
virtual LibUtilities::ShapeType v_DetShapeType () const
 
virtual int v_NumBndryCoeffs () const
 
virtual int v_NumDGBndryCoeffs () const
 
virtual int v_GetEdgeNcoeffs (const int i) const
 
virtual int v_GetTotalEdgeIntNcoeffs () const
 
virtual int v_GetFaceNcoeffs (const int i) const
 
virtual int v_GetFaceIntNcoeffs (const int i) const
 
virtual int v_GetTotalFaceIntNcoeffs () const
 
virtual int v_GetFaceNumPoints (const int i) const
 
virtual LibUtilities::PointsKey v_GetFacePointsKey (const int i, const int j) const
 
virtual int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
virtual const LibUtilities::BasisKey v_DetFaceBasisKey (const int i, const int k) const
 
virtual LibUtilities::BasisType v_GetEdgeBasisType (const int i) const
 
virtual bool v_IsBoundaryInteriorExpansion ()
 
virtual void v_GetCoords (Array< OneD, NekDouble > &coords_x, Array< OneD, NekDouble > &coords_y, Array< OneD, NekDouble > &coords_z)
 
virtual void v_GetFaceToElementMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int nummodesA=-1, int nummodesB=-1)
 
virtual int v_GetVertexMap (int localVertexId, bool useCoeffPacking=false)
 
virtual void v_GetEdgeInteriorMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
virtual void v_GetFaceInteriorMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
virtual void v_GetInteriorMap (Array< OneD, unsigned int > &outarray)
 
virtual void v_GetBoundaryMap (Array< OneD, unsigned int > &outarray)
 
virtual DNekMatSharedPtr v_GenMatrix (const StdMatrixKey &mkey)
 
virtual DNekMatSharedPtr v_CreateStdMatrix (const StdMatrixKey &mkey)
 
virtual void v_MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_GeneralMatrixOp_MatOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion3D
virtual NekDouble v_PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
virtual NekDouble v_PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
 
virtual void v_LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual void v_HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual NekDouble v_Integral (const Array< OneD, const NekDouble > &inarray)
 Integrates the specified function over the domain. More...
 
virtual void v_NegateFaceNormal (const int face)
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion
DNekMatSharedPtr CreateStdMatrix (const StdMatrixKey &mkey)
 
DNekBlkMatSharedPtr CreateStdStaticCondMatrix (const StdMatrixKey &mkey)
 Create the static condensation of a matrix when using a boundary interior decomposition. More...
 
IndexMapValuesSharedPtr CreateIndexMap (const IndexMapKey &ikey)
 Create an IndexMap which contains mapping information linking any specific element shape with either its boundaries, edges, faces, verteces, etc. More...
 
void BwdTrans_MatOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GeneralMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
 
void LaplacianMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp_MatFree (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionDiffusionReactionMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
void HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void HelmholtzMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
virtual void v_SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
 
virtual NekDouble v_StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::StdRegions::StdExpansion3D
std::map< int, NormalVectorm_faceNormals
 
std::map< int, bool > m_negatedNormals
 
- Protected Attributes inherited from Nektar::StdRegions::StdExpansion
Array< OneD, LibUtilities::BasisSharedPtrm_base
 
int m_elmt_id
 
int m_ncoeffs
 
LibUtilities::NekManager< StdMatrixKey, DNekMat, StdMatrixKey::opLessm_stdMatrixManager
 
LibUtilities::NekManager< StdMatrixKey, DNekBlkMat, StdMatrixKey::opLessm_stdStaticCondMatrixManager
 
LibUtilities::NekManager< IndexMapKey, IndexMapValues, IndexMapKey::opLessm_IndexMapManager
 

Detailed Description

Class representing a hexehedral element in reference space.

Definition at line 48 of file StdHexExp.h.

Constructor & Destructor Documentation

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

Definition at line 47 of file StdHexExp.cpp.

48  {
49  }
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.
Nektar::StdRegions::StdHexExp::StdHexExp ( const LibUtilities::BasisKey Ba,
const LibUtilities::BasisKey Bb,
const LibUtilities::BasisKey Bc,
NekDouble coeffs,
NekDouble phys 
)

Definition at line 63 of file StdHexExp.cpp.

68  {
69  }
Nektar::StdRegions::StdHexExp::StdHexExp ( const StdHexExp T)

Definition at line 72 of file StdHexExp.cpp.

72  :
73  StdExpansion(T),
75  {
76  }
StdExpansion()
Default Constructor.
Nektar::StdRegions::StdHexExp::~StdHexExp ( )

Definition at line 79 of file StdHexExp.cpp.

80  {
81  }

Member Function Documentation

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

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

185  {
188  "Basis[1] is not a general tensor type");
189 
192  "Basis[2] is not a general tensor type");
193 
194  if(m_base[0]->Collocation() && m_base[1]->Collocation()
195  && m_base[2]->Collocation())
196  {
198  * m_base[1]->GetNumPoints()
199  * m_base[2]->GetNumPoints(),
200  inarray, 1, outarray, 1);
201  }
202  else
203  {
204  StdHexExp::BwdTrans_SumFac(inarray,outarray);
205  }
206  }
Principle Modified Functions .
Definition: BasisType.h:51
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:229
Principle Orthogonal Functions .
Definition: BasisType.h:47
Principle Modified Functions .
Definition: BasisType.h:50
Principle Orthogonal Functions .
Definition: BasisType.h:48
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:165
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1038
void BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
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 212 of file StdHexExp.cpp.

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

214  {
215  Array<OneD, NekDouble> wsp(m_base[0]->GetNumPoints()*
216  m_base[2]->GetNumModes()*
217  (m_base[1]->GetNumModes() + m_base[1]->GetNumPoints())); // FIX THIS
218 
219  BwdTrans_SumFacKernel(m_base[0]->GetBdata(),
220  m_base[1]->GetBdata(),
221  m_base[2]->GetBdata(),
222  inarray,outarray,wsp,true,true,true);
223  }
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)
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:229
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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 239 of file StdHexExp.cpp.

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

249  {
250  int nquad0 = m_base[0]->GetNumPoints();
251  int nquad1 = m_base[1]->GetNumPoints();
252  int nquad2 = m_base[2]->GetNumPoints();
253  int nmodes0 = m_base[0]->GetNumModes();
254  int nmodes1 = m_base[1]->GetNumModes();
255  int nmodes2 = m_base[2]->GetNumModes();
256 
257  // Check if using collocation, if requested.
258  bool colldir0 = doCheckCollDir0?(m_base[0]->Collocation()):false;
259  bool colldir1 = doCheckCollDir1?(m_base[1]->Collocation()):false;
260  bool colldir2 = doCheckCollDir2?(m_base[2]->Collocation()):false;
261 
262  // If collocation in all directions, Physical values at quadrature
263  // points is just a copy of the modes.
264  if(colldir0 && colldir1 && colldir2)
265  {
266  Vmath::Vcopy(m_ncoeffs,inarray.get(),1,outarray.get(),1);
267  }
268  else
269  {
270  // Check sufficiently large workspace.
271  ASSERTL1(wsp.num_elements()>=nquad0*nmodes2*(nmodes1+nquad1),
272  "Workspace size is not sufficient");
273 
274  // Assign second half of workspace for 2nd DGEMM operation.
275  Array<OneD, NekDouble> wsp2 = wsp + nquad0*nmodes1*nmodes2;
276 
277  // BwdTrans in each direction using DGEMM
278  Blas::Dgemm('T','T', nmodes1*nmodes2, nquad0, nmodes0,
279  1.0, &inarray[0], nmodes0,
280  base0.get(), nquad0,
281  0.0, &wsp[0], nmodes1*nmodes2);
282  Blas::Dgemm('T','T', nquad0*nmodes2, nquad1, nmodes1,
283  1.0, &wsp[0], nmodes1,
284  base1.get(), nquad1,
285  0.0, &wsp2[0], nquad0*nmodes2);
286  Blas::Dgemm('T','T', nquad0*nquad1, nquad2, nmodes2,
287  1.0, &wsp2[0], nmodes2,
288  base2.get(), nquad2,
289  0.0, &outarray[0], nquad0*nquad1);
290  }
291  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1038
int Nektar::StdRegions::StdHexExp::v_CalcNumberOfCoefficients ( const std::vector< unsigned int > &  nummodes,
int &  modes_offset 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 846 of file StdHexExp.cpp.

847  {
848  int nmodes = nummodes[modes_offset]*nummodes[modes_offset+1]*nummodes[modes_offset+2];
849  modes_offset += 3;
850 
851  return nmodes;
852  }
DNekMatSharedPtr Nektar::StdRegions::StdHexExp::v_CreateStdMatrix ( const StdMatrixKey mkey)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 2181 of file StdHexExp.cpp.

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

2182  {
2183  return StdExpansion::CreateGeneralMatrix(mkey);
2184  }
DNekMatSharedPtr CreateGeneralMatrix(const StdMatrixKey &mkey)
this function generates the mass matrix
const LibUtilities::BasisKey Nektar::StdRegions::StdHexExp::v_DetFaceBasisKey ( const int  i,
const int  k 
) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 855 of file StdHexExp.cpp.

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

857  {
858  ASSERTL2(i >= 0 && i <= 5, "face id is out of range");
859  ASSERTL2(k >= 0 && k <= 1, "basis key id is out of range");
860 
861  int dir = k;
862  switch(i)
863  {
864  case 0:
865  case 5:
866  dir = k;
867  break;
868  case 1:
869  case 3:
870  dir = 2*k;
871  break;
872  case 2:
873  case 4:
874  dir = k+1;
875  break;
876  }
877 
878  return EvaluateQuadFaceBasisKey(k,
879  m_base[dir]->GetBasisType(),
880  m_base[dir]->GetNumPoints(),
881  m_base[dir]->GetNumModes());
882  }
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:229
LibUtilities::BasisKey EvaluateQuadFaceBasisKey(const int facedir, const LibUtilities::BasisType faceDirBasisType, const int numpoints, const int nummodes)
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:165
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
Array< OneD, LibUtilities::BasisSharedPtr > m_base
LibUtilities::ShapeType Nektar::StdRegions::StdHexExp::v_DetShapeType ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 691 of file StdHexExp.cpp.

References Nektar::LibUtilities::eHexahedron.

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

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

624  {
625  int i,j;
626  int nquad0 = m_base[0]->GetNumPoints();
627  int nquad1 = m_base[1]->GetNumPoints();
628  int nquad2 = m_base[2]->GetNumPoints();
629 
630  Array<OneD, const NekDouble> base0 = m_base[0]->GetBdata();
631  Array<OneD, const NekDouble> base1 = m_base[1]->GetBdata();
632  Array<OneD, const NekDouble> base2 = m_base[2]->GetBdata();
633 
634  int btmp0 = m_base[0]->GetNumModes();
635  int btmp1 = m_base[1]->GetNumModes();
636  int mode2 = mode/(btmp0*btmp1);
637  int mode1 = (mode-mode2*btmp0*btmp1)/btmp0;
638  int mode0 = (mode-mode2*btmp0*btmp1)%btmp0;
639 
640  ASSERTL2(mode2 == (int)floor((1.0*mode)/(btmp0*btmp1)),
641  "Integer Truncation not Equiv to Floor");
642  ASSERTL2(mode1 == (int)floor((1.0*mode-mode2*btmp0*btmp1)
643  /(btmp0*btmp1)),
644  "Integer Truncation not Equiv to Floor");
645  ASSERTL2(m_ncoeffs <= mode,
646  "calling argument mode is larger than total expansion "
647  "order");
648 
649  for(i = 0; i < nquad1*nquad2; ++i)
650  {
651  Vmath::Vcopy(nquad0,(NekDouble *)(base0.get() + mode0*nquad0),1,
652  &outarray[0]+i*nquad0, 1);
653  }
654 
655  for(j = 0; j < nquad2; ++j)
656  {
657  for(i = 0; i < nquad0; ++i)
658  {
659  Vmath::Vmul(nquad1,(NekDouble *)(base1.get() + mode1*nquad1),1,
660  &outarray[0]+i+j*nquad0*nquad1, nquad0,
661  &outarray[0]+i+j*nquad0*nquad1, nquad0);
662  }
663  }
664 
665  for(i = 0; i < nquad2; i++)
666  {
667  Blas::Dscal(nquad0*nquad1,base2[mode2*nquad2+i],
668  &outarray[0]+i*nquad0*nquad1,1);
669  }
670  }
double NekDouble
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1038
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:169
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 303 of file StdHexExp.cpp.

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

306  {
307  // If using collocation expansion, coefficients match physical
308  // data points so just do a direct copy.
309  if( (m_base[0]->Collocation())
310  &&(m_base[1]->Collocation())
311  &&(m_base[2]->Collocation()) )
312  {
313  Vmath::Vcopy(GetNcoeffs(), &inarray[0], 1, &outarray[0], 1);
314  }
315  else
316  {
317  // Compute B^TWu
318  IProductWRTBase(inarray,outarray);
319 
320  // get Mass matrix inverse
321  StdMatrixKey masskey(eInvMass,DetShapeType(),*this);
322  DNekMatSharedPtr matsys = GetStdMatrix(masskey);
323 
324  // copy inarray in case inarray == outarray
325  DNekVec in (m_ncoeffs,outarray);
326  DNekVec out(m_ncoeffs,outarray,eWrapper);
327 
328  // Solve for coefficients.
329  out = (*matsys)*in;
330 
331  }
332  }
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:454
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:613
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:684
NekVector< NekDouble > DNekVec
Definition: NekTypeDefs.hpp:49
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:131
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1038
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 2233 of file StdHexExp.cpp.

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

2237  {
2239 
2240  if(inarray.get() == outarray.get())
2241  {
2242  Array<OneD,NekDouble> tmp(m_ncoeffs);
2243  Vmath::Vcopy(m_ncoeffs,inarray.get(),1,tmp.get(),1);
2244 
2245  Blas::Dgemv('N', m_ncoeffs, m_ncoeffs, 1.0, mat->GetPtr().get(),
2246  m_ncoeffs, tmp.get(), 1, 0.0, outarray.get(), 1);
2247  }
2248  else
2249  {
2250  Blas::Dgemv('N', m_ncoeffs, m_ncoeffs, 1.0, mat->GetPtr().get(),
2251  m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
2252  }
2253  }
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
LibUtilities::NekManager< StdMatrixKey, DNekMat, StdMatrixKey::opLess > m_stdMatrixManager
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1038
DNekMatSharedPtr Nektar::StdRegions::StdHexExp::v_GenMatrix ( const StdMatrixKey mkey)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp.

Definition at line 2175 of file StdHexExp.cpp.

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

2176  {
2177  return StdExpansion::CreateGeneralMatrix(mkey);
2178  }
DNekMatSharedPtr CreateGeneralMatrix(const StdMatrixKey &mkey)
this function generates the mass matrix
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 2084 of file StdHexExp.cpp.

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

2085  {
2088  "BasisType is not a boundary interior form");
2091  "BasisType is not a boundary interior form");
2094  "BasisType is not a boundary interior form");
2095 
2096  int i;
2097  int nummodes [3] = {m_base[0]->GetNumModes(),
2098  m_base[1]->GetNumModes(),
2099  m_base[2]->GetNumModes()};
2100 
2101  int nBndCoeffs = NumBndryCoeffs();
2102 
2103  if(outarray.num_elements()!=nBndCoeffs)
2104  {
2105  outarray = Array<OneD, unsigned int>(nBndCoeffs);
2106  }
2107 
2108  const LibUtilities::BasisType Btype [3] = {GetBasisType(0),
2109  GetBasisType(1),
2110  GetBasisType(2)};
2111 
2112  int p,q,r;
2113  int cnt = 0;
2114 
2115  int BndIdx [3][2];
2116  int IntIdx [3][2];
2117 
2118  for(i = 0; i < 3; i++)
2119  {
2120  BndIdx[i][0] = 0;
2121 
2122  if( Btype[i] == LibUtilities::eModified_A)
2123  {
2124  BndIdx[i][1] = 1;
2125  IntIdx[i][0] = 2;
2126  IntIdx[i][1] = nummodes[i];
2127  }
2128  else
2129  {
2130  BndIdx[i][1] = nummodes[i]-1;
2131  IntIdx[i][0] = 1;
2132  IntIdx[i][1] = nummodes[i]-1;
2133  }
2134  }
2135 
2136 
2137  for(i = 0; i < 2; i++)
2138  {
2139  r = BndIdx[2][i];
2140  for( q = 0; q < nummodes[1]; q++)
2141  {
2142  for( p = 0; p < nummodes[0]; p++)
2143  {
2144  outarray[cnt++] = r*nummodes[0]*nummodes[1]+q*nummodes[0] + p;
2145  }
2146  }
2147  }
2148 
2149  for(r = IntIdx[2][0]; r < IntIdx[2][1]; r++)
2150  {
2151  for( i = 0; i < 2; i++)
2152  {
2153  q = BndIdx[1][i];
2154  for( p = 0; p < nummodes[0]; p++)
2155  {
2156  outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2157  q*nummodes[0] + p;
2158  }
2159  }
2160 
2161  for( q = IntIdx[1][0]; q < IntIdx[1][1]; q++)
2162  {
2163  for( i = 0; i < 2; i++)
2164  {
2165  p = BndIdx[0][i];
2166  outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2167  q*nummodes[0] + p;
2168  }
2169  }
2170  }
2171 
2172  sort(outarray.get(), outarray.get() + nBndCoeffs);
2173  }
Principle Modified Functions .
Definition: BasisType.h:49
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:165
Lagrange for SEM basis .
Definition: BasisType.h:53
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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 902 of file StdHexExp.cpp.

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

905  {
906  Array<OneD, const NekDouble> eta_x = m_base[0]->GetZ();
907  Array<OneD, const NekDouble> eta_y = m_base[1]->GetZ();
908  Array<OneD, const NekDouble> eta_z = m_base[2]->GetZ();
909  int Qx = GetNumPoints(0);
910  int Qy = GetNumPoints(1);
911  int Qz = GetNumPoints(2);
912 
913  // Convert collapsed coordinates into cartesian coordinates:
914  // eta --> xi
915  for( int k = 0; k < Qz; ++k ) {
916  for( int j = 0; j < Qy; ++j ) {
917  for( int i = 0; i < Qx; ++i ) {
918  int s = i + Qx*(j + Qy*k);
919  xi_x[s] = eta_x[i];
920  xi_y[s] = eta_y[j];
921  xi_z[s] = eta_z[k];
922 
923  }
924  }
925  }
926  }
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:229
Array< OneD, LibUtilities::BasisSharedPtr > m_base
LibUtilities::BasisType Nektar::StdRegions::StdHexExp::v_GetEdgeBasisType ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 884 of file StdHexExp.cpp.

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

885  {
886  ASSERTL2((i >= 0)&&(i <= 11),"edge id is out of range");
887 
888  if((i == 0)||(i == 2)||(i==8)||(i==10))
889  {
890  return GetBasisType(0);
891  }
892  else if((i == 1)||(i == 3)||(i == 9)||(i == 11))
893  {
894  return GetBasisType(1);
895  }
896  else
897  {
898  return GetBasisType(2);
899  }
900  }
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:165
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
void Nektar::StdRegions::StdHexExp::v_GetEdgeInteriorMap ( const int  eid,
const Orientation  edgeOrient,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray 
)
protectedvirtual
Parameters
eidThe edge to compute the numbering for.
edgeOrientOrientation of the edge.
maparrayStorage for computed mapping array.
signarray?

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1382 of file StdHexExp.cpp.

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

1386  {
1389  "BasisType is not a boundary interior form");
1392  "BasisType is not a boundary interior form");
1395  "BasisType is not a boundary interior form");
1396 
1397  ASSERTL1((eid>=0)&&(eid<12),
1398  "local edge id must be between 0 and 11");
1399 
1400  int nEdgeIntCoeffs = GetEdgeNcoeffs(eid)-2;
1401 
1402  if(maparray.num_elements()!=nEdgeIntCoeffs)
1403  {
1404  maparray = Array<OneD, unsigned int>(nEdgeIntCoeffs);
1405  }
1406 
1407  if(signarray.num_elements() != nEdgeIntCoeffs)
1408  {
1409  signarray = Array<OneD, int>(nEdgeIntCoeffs,1);
1410  }
1411  else
1412  {
1413  fill( signarray.get() , signarray.get()+nEdgeIntCoeffs, 1 );
1414  }
1415 
1416  int nummodes [3] = {m_base[0]->GetNumModes(),
1417  m_base[1]->GetNumModes(),
1418  m_base[2]->GetNumModes()};
1419 
1420  const LibUtilities::BasisType bType [3] = {GetBasisType(0),
1421  GetBasisType(1),
1422  GetBasisType(2)};
1423 
1424  bool reverseOrdering = false;
1425  bool signChange = false;
1426 
1427  int IdxRange [3][2] = {{0,0},{0,0},{0,0}};
1428 
1429  switch(eid)
1430  {
1431  case 0:
1432  case 1:
1433  case 2:
1434  case 3:
1435  {
1436  IdxRange[2][0] = 0;
1437  IdxRange[2][1] = 1;
1438  }
1439  break;
1440  case 8:
1441  case 9:
1442  case 10:
1443  case 11:
1444  {
1445  if( bType[2] == LibUtilities::eGLL_Lagrange)
1446  {
1447  IdxRange[2][0] = nummodes[2] - 1;
1448  IdxRange[2][1] = nummodes[2];
1449  }
1450  else
1451  {
1452  IdxRange[2][0] = 1;
1453  IdxRange[2][1] = 2;
1454  }
1455  }
1456  break;
1457  case 4:
1458  case 5:
1459  case 6:
1460  case 7:
1461  {
1462  if( bType[2] == LibUtilities::eGLL_Lagrange)
1463  {
1464  IdxRange[2][0] = 1;
1465  IdxRange[2][1] = nummodes[2] - 1;
1466 
1467  if(edgeOrient==eBackwards)
1468  {
1469  reverseOrdering = true;
1470  }
1471  }
1472  else
1473  {
1474  IdxRange[2][0] = 2;
1475  IdxRange[2][1] = nummodes[2];
1476 
1477  if(edgeOrient==eBackwards)
1478  {
1479  signChange = true;
1480  }
1481  }
1482  }
1483  break;
1484  }
1485 
1486  switch(eid)
1487  {
1488  case 0:
1489  case 4:
1490  case 5:
1491  case 8:
1492  {
1493  IdxRange[1][0] = 0;
1494  IdxRange[1][1] = 1;
1495  }
1496  break;
1497  case 2:
1498  case 6:
1499  case 7:
1500  case 10:
1501  {
1502  if( bType[1] == LibUtilities::eGLL_Lagrange)
1503  {
1504  IdxRange[1][0] = nummodes[1] - 1;
1505  IdxRange[1][1] = nummodes[1];
1506  }
1507  else
1508  {
1509  IdxRange[1][0] = 1;
1510  IdxRange[1][1] = 2;
1511  }
1512  }
1513  break;
1514  case 1:
1515  case 9:
1516  {
1517  if( bType[1] == LibUtilities::eGLL_Lagrange)
1518  {
1519  IdxRange[1][0] = 1;
1520  IdxRange[1][1] = nummodes[1] - 1;
1521 
1522  if(edgeOrient==eBackwards)
1523  {
1524  reverseOrdering = true;
1525  }
1526  }
1527  else
1528  {
1529  IdxRange[1][0] = 2;
1530  IdxRange[1][1] = nummodes[1];
1531 
1532  if(edgeOrient==eBackwards)
1533  {
1534  signChange = true;
1535  }
1536  }
1537  }
1538  break;
1539  case 3:
1540  case 11:
1541  {
1542  if( bType[1] == LibUtilities::eGLL_Lagrange)
1543  {
1544  IdxRange[1][0] = 1;
1545  IdxRange[1][1] = nummodes[1] - 1;
1546 
1547  if(edgeOrient==eForwards)
1548  {
1549  reverseOrdering = true;
1550  }
1551  }
1552  else
1553  {
1554  IdxRange[1][0] = 2;
1555  IdxRange[1][1] = nummodes[1];
1556 
1557  if(edgeOrient==eForwards)
1558  {
1559  signChange = true;
1560  }
1561  }
1562  }
1563  break;
1564  }
1565 
1566  switch(eid)
1567  {
1568  case 3:
1569  case 4:
1570  case 7:
1571  case 11:
1572  {
1573  IdxRange[0][0] = 0;
1574  IdxRange[0][1] = 1;
1575  }
1576  break;
1577  case 1:
1578  case 5:
1579  case 6:
1580  case 9:
1581  {
1582  if( bType[0] == LibUtilities::eGLL_Lagrange)
1583  {
1584  IdxRange[0][0] = nummodes[0] - 1;
1585  IdxRange[0][1] = nummodes[0];
1586  }
1587  else
1588  {
1589  IdxRange[0][0] = 1;
1590  IdxRange[0][1] = 2;
1591  }
1592  }
1593  break;
1594  case 0:
1595  case 8:
1596  {
1597  if( bType[0] == LibUtilities::eGLL_Lagrange)
1598  {
1599  IdxRange[0][0] = 1;
1600  IdxRange[0][1] = nummodes[0] - 1;
1601 
1602  if(edgeOrient==eBackwards)
1603  {
1604  reverseOrdering = true;
1605  }
1606  }
1607  else
1608  {
1609  IdxRange[0][0] = 2;
1610  IdxRange[0][1] = nummodes[0];
1611 
1612  if(edgeOrient==eBackwards)
1613  {
1614  signChange = true;
1615  }
1616  }
1617  }
1618  break;
1619  case 2:
1620  case 10:
1621  {
1622  if( bType[0] == LibUtilities::eGLL_Lagrange)
1623  {
1624  IdxRange[0][0] = 1;
1625  IdxRange[0][1] = nummodes[0] - 1;
1626 
1627  if(edgeOrient==eForwards)
1628  {
1629  reverseOrdering = true;
1630  }
1631  }
1632  else
1633  {
1634  IdxRange[0][0] = 2;
1635  IdxRange[0][1] = nummodes[0];
1636 
1637  if(edgeOrient==eForwards)
1638  {
1639  signChange = true;
1640  }
1641  }
1642  }
1643  break;
1644  }
1645 
1646  int p,q,r;
1647  int cnt = 0;
1648 
1649  for(r = IdxRange[2][0]; r < IdxRange[2][1]; r++)
1650  {
1651  for(q = IdxRange[1][0]; q < IdxRange[1][1]; q++)
1652  {
1653  for(p = IdxRange[0][0]; p < IdxRange[0][1]; p++)
1654  {
1655  maparray[cnt++]
1656  = r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
1657  }
1658  }
1659  }
1660 
1661  if( reverseOrdering )
1662  {
1663  reverse( maparray.get() , maparray.get()+nEdgeIntCoeffs );
1664  }
1665 
1666  if( signChange )
1667  {
1668  for(p = 1; p < nEdgeIntCoeffs; p+=2)
1669  {
1670  signarray[p] = -1;
1671  }
1672  }
1673  }
Principle Modified Functions .
Definition: BasisType.h:49
int GetEdgeNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th edge.
Definition: StdExpansion.h:287
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:165
Lagrange for SEM basis .
Definition: BasisType.h:53
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
Array< OneD, LibUtilities::BasisSharedPtr > m_base
int Nektar::StdRegions::StdHexExp::v_GetEdgeNcoeffs ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 738 of file StdHexExp.cpp.

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

739  {
740  ASSERTL2((i >= 0)&&(i <= 11),"edge id is out of range");
741 
742  if((i == 0)||(i == 2)||(i == 8)||(i == 10))
743  {
744  return GetBasisNumModes(0);
745  }
746  else if((i == 1)||(i == 3)||(i == 9)||(i == 11))
747  {
748  return GetBasisNumModes(1);
749  }
750  else
751  {
752  return GetBasisNumModes(2);
753  }
754  }
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
Definition: StdExpansion.h:178
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
void Nektar::StdRegions::StdHexExp::v_GetFaceInteriorMap ( const int  fid,
const Orientation  faceOrient,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray 
)
protectedvirtual

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1680 of file StdHexExp.cpp.

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

1684  {
1687  "BasisType is not a boundary interior form");
1690  "BasisType is not a boundary interior form");
1693  "BasisType is not a boundary interior form");
1694 
1695  ASSERTL1((fid>=0)&&(fid<6),
1696  "local face id must be between 0 and 5");
1697 
1698  int nFaceIntCoeffs = GetFaceIntNcoeffs(fid);
1699 
1700  if(maparray.num_elements()!=nFaceIntCoeffs)
1701  {
1702  maparray = Array<OneD, unsigned int>(nFaceIntCoeffs);
1703  }
1704 
1705  if(signarray.num_elements() != nFaceIntCoeffs)
1706  {
1707  signarray = Array<OneD, int>(nFaceIntCoeffs,1);
1708  }
1709  else
1710  {
1711  fill( signarray.get() , signarray.get()+nFaceIntCoeffs, 1 );
1712  }
1713 
1714  int nummodes [3] = {m_base[0]->GetNumModes(),
1715  m_base[1]->GetNumModes(),
1716  m_base[2]->GetNumModes()};
1717 
1718  const LibUtilities::BasisType bType [3] = {GetBasisType(0),
1719  GetBasisType(1),
1720  GetBasisType(2)};
1721 
1722  int nummodesA = 0;
1723  int nummodesB = 0;
1724 
1725  // Determine the number of modes in face directions A & B based
1726  // on the face index given.
1727  switch(fid)
1728  {
1729  case 0:
1730  case 5:
1731  {
1732  nummodesA = nummodes[0];
1733  nummodesB = nummodes[1];
1734  }
1735  break;
1736  case 1:
1737  case 3:
1738  {
1739  nummodesA = nummodes[0];
1740  nummodesB = nummodes[2];
1741  }
1742  break;
1743  case 2:
1744  case 4:
1745  {
1746  nummodesA = nummodes[1];
1747  nummodesB = nummodes[2];
1748  }
1749  }
1750 
1751  int i,j;
1752  Array<OneD, int> arrayindx(nFaceIntCoeffs);
1753 
1754  // Create a mapping array to account for transposition of the
1755  // coordinates due to face orientation.
1756  for(i = 0; i < (nummodesB-2); i++)
1757  {
1758  for(j = 0; j < (nummodesA-2); j++)
1759  {
1760  if( faceOrient < 9 )
1761  {
1762  arrayindx[i*(nummodesA-2)+j] = i*(nummodesA-2)+j;
1763  }
1764  else
1765  {
1766  arrayindx[i*(nummodesA-2)+j] = j*(nummodesB-2)+i;
1767  }
1768  }
1769  }
1770 
1771  int IdxRange [3][2];
1772  int Incr[3];
1773 
1774  Array<OneD, int> sign0(nummodes[0], 1);
1775  Array<OneD, int> sign1(nummodes[1], 1);
1776  Array<OneD, int> sign2(nummodes[2], 1);
1777 
1778  // Set the upper and lower bounds, and increment for the faces
1779  // involving the first coordinate direction.
1780  switch(fid)
1781  {
1782  case 0: // bottom face
1783  {
1784  IdxRange[2][0] = 0;
1785  IdxRange[2][1] = 1;
1786  Incr[2] = 1;
1787  }
1788  break;
1789  case 5: // top face
1790  {
1791  if( bType[2] == LibUtilities::eGLL_Lagrange)
1792  {
1793  IdxRange[2][0] = nummodes[2] - 1;
1794  IdxRange[2][1] = nummodes[2];
1795  Incr[2] = 1;
1796  }
1797  else
1798  {
1799  IdxRange[2][0] = 1;
1800  IdxRange[2][1] = 2;
1801  Incr[2] = 1;
1802  }
1803 
1804  }
1805  break;
1806  default: // all other faces
1807  {
1808  if( bType[2] == LibUtilities::eGLL_Lagrange)
1809  {
1810  if( (((int) faceOrient)-5) % 2 )
1811  {
1812  IdxRange[2][0] = nummodes[2] - 2;
1813  IdxRange[2][1] = 0;
1814  Incr[2] = -1;
1815 
1816  }
1817  else
1818  {
1819  IdxRange[2][0] = 1;
1820  IdxRange[2][1] = nummodes[2] - 1;
1821  Incr[2] = 1;
1822  }
1823  }
1824  else
1825  {
1826  IdxRange[2][0] = 2;
1827  IdxRange[2][1] = nummodes[2];
1828  Incr[2] = 1;
1829 
1830  if( (((int) faceOrient)-5) % 2 )
1831  {
1832  for(i = 3; i < nummodes[2]; i+=2)
1833  {
1834  sign2[i] = -1;
1835  }
1836  }
1837  }
1838  }
1839  }
1840 
1841  // Set the upper and lower bounds, and increment for the faces
1842  // involving the second coordinate direction.
1843  switch(fid)
1844  {
1845  case 1:
1846  {
1847  IdxRange[1][0] = 0;
1848  IdxRange[1][1] = 1;
1849  Incr[1] = 1;
1850  }
1851  break;
1852  case 3:
1853  {
1854  if( bType[1] == LibUtilities::eGLL_Lagrange)
1855  {
1856  IdxRange[1][0] = nummodes[1] - 1;
1857  IdxRange[1][1] = nummodes[1];
1858  Incr[1] = 1;
1859  }
1860  else
1861  {
1862  IdxRange[1][0] = 1;
1863  IdxRange[1][1] = 2;
1864  Incr[1] = 1;
1865  }
1866  }
1867  break;
1868  case 0:
1869  case 5:
1870  {
1871  if( bType[1] == LibUtilities::eGLL_Lagrange)
1872  {
1873  if( (((int) faceOrient)-5) % 2 )
1874  {
1875  IdxRange[1][0] = nummodes[1] - 2;
1876  IdxRange[1][1] = 0;
1877  Incr[1] = -1;
1878 
1879  }
1880  else
1881  {
1882  IdxRange[1][0] = 1;
1883  IdxRange[1][1] = nummodes[1] - 1;
1884  Incr[1] = 1;
1885  }
1886  }
1887  else
1888  {
1889  IdxRange[1][0] = 2;
1890  IdxRange[1][1] = nummodes[1];
1891  Incr[1] = 1;
1892 
1893  if( (((int) faceOrient)-5) % 2 )
1894  {
1895  for(i = 3; i < nummodes[1]; i+=2)
1896  {
1897  sign1[i] = -1;
1898  }
1899  }
1900  }
1901  }
1902  break;
1903  default: // case2: case4:
1904  {
1905  if( bType[1] == LibUtilities::eGLL_Lagrange)
1906  {
1907  if( (((int) faceOrient)-5) % 4 > 1 )
1908  {
1909  IdxRange[1][0] = nummodes[1] - 2;
1910  IdxRange[1][1] = 0;
1911  Incr[1] = -1;
1912 
1913  }
1914  else
1915  {
1916  IdxRange[1][0] = 1;
1917  IdxRange[1][1] = nummodes[1] - 1;
1918  Incr[1] = 1;
1919  }
1920  }
1921  else
1922  {
1923  IdxRange[1][0] = 2;
1924  IdxRange[1][1] = nummodes[1];
1925  Incr[1] = 1;
1926 
1927  if( (((int) faceOrient)-5) % 4 > 1 )
1928  {
1929  for(i = 3; i < nummodes[1]; i+=2)
1930  {
1931  sign1[i] = -1;
1932  }
1933  }
1934  }
1935  }
1936  }
1937 
1938  switch(fid)
1939  {
1940  case 4:
1941  {
1942  IdxRange[0][0] = 0;
1943  IdxRange[0][1] = 1;
1944  Incr[0] = 1;
1945  }
1946  break;
1947  case 2:
1948  {
1949  if( bType[0] == LibUtilities::eGLL_Lagrange)
1950  {
1951  IdxRange[0][0] = nummodes[0] - 1;
1952  IdxRange[0][1] = nummodes[0];
1953  Incr[0] = 1;
1954  }
1955  else
1956  {
1957  IdxRange[0][0] = 1;
1958  IdxRange[0][1] = 2;
1959  Incr[0] = 1;
1960  }
1961  }
1962  break;
1963  default:
1964  {
1965  if( bType[0] == LibUtilities::eGLL_Lagrange)
1966  {
1967  if( (((int) faceOrient)-5) % 4 > 1 )
1968  {
1969  IdxRange[0][0] = nummodes[0] - 2;
1970  IdxRange[0][1] = 0;
1971  Incr[0] = -1;
1972 
1973  }
1974  else
1975  {
1976  IdxRange[0][0] = 1;
1977  IdxRange[0][1] = nummodes[0] - 1;
1978  Incr[0] = 1;
1979  }
1980  }
1981  else
1982  {
1983  IdxRange[0][0] = 2;
1984  IdxRange[0][1] = nummodes[0];
1985  Incr[0] = 1;
1986 
1987  if( (((int) faceOrient)-5) % 4 > 1 )
1988  {
1989  for(i = 3; i < nummodes[0]; i+=2)
1990  {
1991  sign0[i] = -1;
1992  }
1993  }
1994  }
1995  }
1996  }
1997 
1998  int p,q,r;
1999  int cnt = 0;
2000 
2001  for(r = IdxRange[2][0]; r != IdxRange[2][1]; r+=Incr[2])
2002  {
2003  for(q = IdxRange[1][0]; q != IdxRange[1][1]; q+=Incr[1])
2004  {
2005  for(p = IdxRange[0][0]; p != IdxRange[0][1]; p+=Incr[0])
2006  {
2007  maparray [ arrayindx[cnt ] ]
2008  = r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
2009  signarray[ arrayindx[cnt++] ]
2010  = sign0[p] * sign1[q] * sign2[r];
2011  }
2012  }
2013  }
2014  }
Principle Modified Functions .
Definition: BasisType.h:49
int GetFaceIntNcoeffs(const int i) const
Definition: StdExpansion.h:359
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:165
Lagrange for SEM basis .
Definition: BasisType.h:53
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
Array< OneD, LibUtilities::BasisSharedPtr > m_base
int Nektar::StdRegions::StdHexExp::v_GetFaceIntNcoeffs ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 780 of file StdHexExp.cpp.

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

781  {
782  ASSERTL2((i >= 0) && (i <= 5), "face id is out of range");
783  if((i == 0) || (i == 5))
784  {
785  return (GetBasisNumModes(0)-2)*(GetBasisNumModes(1)-2);
786  }
787  else if((i == 1) || (i == 3))
788  {
789  return (GetBasisNumModes(0)-2)*(GetBasisNumModes(2)-2);
790  }
791  else
792  {
793  return (GetBasisNumModes(1)-2)*(GetBasisNumModes(2)-2);
794  }
795 
796  }
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
Definition: StdExpansion.h:178
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
int Nektar::StdRegions::StdHexExp::v_GetFaceNcoeffs ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 762 of file StdHexExp.cpp.

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

763  {
764  ASSERTL2((i >= 0) && (i <= 5), "face id is out of range");
765  if((i == 0) || (i == 5))
766  {
767  return GetBasisNumModes(0)*GetBasisNumModes(1);
768  }
769  else if((i == 1) || (i == 3))
770  {
771  return GetBasisNumModes(0)*GetBasisNumModes(2);
772  }
773  else
774  {
775  return GetBasisNumModes(1)*GetBasisNumModes(2);
776  }
777  }
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
Definition: StdExpansion.h:178
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
int Nektar::StdRegions::StdHexExp::v_GetFaceNumPoints ( const int  i) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 805 of file StdHexExp.cpp.

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

806  {
807  ASSERTL2(i >= 0 && i <= 5, "face id is out of range");
808 
809  if (i == 0 || i == 5)
810  {
811  return m_base[0]->GetNumPoints()*
812  m_base[1]->GetNumPoints();
813  }
814  else if (i == 1 || i == 3)
815  {
816  return m_base[0]->GetNumPoints()*
817  m_base[2]->GetNumPoints();
818  }
819  else
820  {
821  return m_base[1]->GetNumPoints()*
822  m_base[2]->GetNumPoints();
823  }
824  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
Array< OneD, LibUtilities::BasisSharedPtr > m_base
LibUtilities::PointsKey Nektar::StdRegions::StdHexExp::v_GetFacePointsKey ( const int  i,
const int  j 
) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 826 of file StdHexExp.cpp.

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

828  {
829  ASSERTL2(i >= 0 && i <= 5, "face id is out of range");
830  ASSERTL2(j == 0 || j == 1, "face direction is out of range");
831 
832  if (i == 0 || i == 5)
833  {
834  return m_base[j]->GetPointsKey();
835  }
836  else if (i == 1 || i == 3)
837  {
838  return m_base[2*j]->GetPointsKey();
839  }
840  else
841  {
842  return m_base[j+1]->GetPointsKey();
843  }
844  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Nektar::StdRegions::StdHexExp::v_GetFaceToElementMap ( const int  fid,
const Orientation  faceOrient,
Array< OneD, unsigned int > &  maparray,
Array< OneD, int > &  signarray,
int  nummodesA = -1,
int  nummodesB = -1 
)
protectedvirtual

Only for basis type Modified_A or GLL_LAGRANGE in all directions.

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 932 of file StdHexExp.cpp.

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

939  {
940  int i,j;
941  const int nummodes0 = m_base[0]->GetNumModes();
942  const int nummodes1 = m_base[1]->GetNumModes();
943  const int nummodes2 = m_base[2]->GetNumModes();
944 
947  "Method only implemented if BasisType is indentical in "
948  "all directions");
951  "Method only implemented for Modified_A or GLL_Lagrange BasisType");
952 
953  if (nummodesA == -1)
954  {
955  switch(fid)
956  {
957  case 0:
958  case 5:
959  nummodesA = nummodes0;
960  nummodesB = nummodes1;
961  break;
962  case 1:
963  case 3:
964  nummodesA = nummodes0;
965  nummodesB = nummodes2;
966  break;
967  case 2:
968  case 4:
969  nummodesA = nummodes1;
970  nummodesB = nummodes2;
971  break;
972  }
973  }
974 
975 
976  bool modified = GetEdgeBasisType(0) == LibUtilities::eModified_A;
977  int nFaceCoeffs = nummodesA*nummodesB;
978 
979  if(maparray.num_elements() != nFaceCoeffs)
980  {
981  maparray = Array<OneD, unsigned int>(nFaceCoeffs);
982  }
983 
984  if(signarray.num_elements() != nFaceCoeffs)
985  {
986  signarray = Array<OneD, int>(nFaceCoeffs,1);
987  }
988  else
989  {
990  fill( signarray.get() , signarray.get()+nFaceCoeffs, 1 );
991  }
992 
993  Array<OneD, int> arrayindx(nFaceCoeffs);
994 
995  for(i = 0; i < nummodesB; i++)
996  {
997  for(j = 0; j < nummodesA; j++)
998  {
999  if( faceOrient < 9 )
1000  {
1001  arrayindx[i*nummodesA+j] = i*nummodesA+j;
1002  }
1003  else
1004  {
1005  arrayindx[i*nummodesA+j] = j*nummodesB+i;
1006  }
1007  }
1008  }
1009 
1010  int offset = 0;
1011  int jump1 = 1;
1012  int jump2 = 1;
1013 
1014  switch(fid)
1015  {
1016  case 5:
1017  {
1018  if (modified)
1019  {
1020  offset = nummodes0*nummodes1;
1021  }
1022  else
1023  {
1024  offset = (nummodes2-1)*nummodes0*nummodes1;
1025  jump1 = nummodes0;
1026  }
1027  }
1028  case 0:
1029  {
1030  jump1 = nummodes0;
1031  }
1032  break;
1033  case 3:
1034  {
1035  if (modified)
1036  {
1037  offset = nummodes0;
1038  }
1039  else
1040  {
1041  offset = nummodes0*(nummodes1-1);
1042  jump1 = nummodes0*nummodes1;
1043  }
1044  }
1045  case 1:
1046  {
1047  jump1 = nummodes0*nummodes1;
1048  }
1049  break;
1050  case 2:
1051  {
1052  if (modified)
1053  {
1054  offset = 1;
1055  }
1056  else
1057  {
1058  offset = nummodes0-1;
1059  jump1 = nummodes0*nummodes1;
1060  jump2 = nummodes0;
1061 
1062  }
1063  }
1064  case 4:
1065  {
1066  jump1 = nummodes0*nummodes1;
1067  jump2 = nummodes0;
1068  }
1069  break;
1070  default:
1071  ASSERTL0(false,"fid must be between 0 and 5");
1072  }
1073 
1074  for(i = 0; i < nummodesB; i++)
1075  {
1076  for(j = 0; j < nummodesA; j++)
1077  {
1078  maparray[ arrayindx[i*nummodesA+j] ]
1079  = i*jump1 + j*jump2 + offset;
1080  }
1081  }
1082 
1083 
1084 
1085  if( (faceOrient==6) || (faceOrient==8) ||
1086  (faceOrient==11) || (faceOrient==12) )
1087  {
1088  if(faceOrient<9)
1089  {
1090  if (modified)
1091  {
1092  for(i = 3; i < nummodesB; i+=2)
1093  {
1094  for(j = 0; j < nummodesA; j++)
1095  {
1096  signarray[ arrayindx[i*nummodesA+j] ] *= -1;
1097  }
1098  }
1099 
1100  for(i = 0; i < nummodesA; i++)
1101  {
1102  swap( maparray[i] , maparray[i+nummodesA] );
1103  swap( signarray[i] , signarray[i+nummodesA] );
1104  }
1105 
1106  }
1107  else
1108  {
1109  for(i = 0; i < nummodesA; i++)
1110  {
1111  for(j = 0; j < nummodesB/2; j++)
1112  {
1113  swap( maparray[i + j*nummodesA],
1114  maparray[i+nummodesA*nummodesB
1115  -nummodesA -j*nummodesA] );
1116  swap( signarray[i + j*nummodesA],
1117  signarray[i+nummodesA*nummodesB
1118  -nummodesA -j*nummodesA]);
1119  }
1120  }
1121  }
1122  }
1123  else
1124  {
1125  if (modified)
1126  {
1127  for(i = 0; i < nummodesB; i++)
1128  {
1129  for(j = 3; j < nummodesA; j+=2)
1130  {
1131  signarray[ arrayindx[i*nummodesA+j] ] *= -1;
1132  }
1133  }
1134 
1135  for(i = 0; i < nummodesB; i++)
1136  {
1137  swap( maparray[i] , maparray[i+nummodesB] );
1138  swap( signarray[i] , signarray[i+nummodesB] );
1139  }
1140 
1141  }
1142  else
1143  {
1144  for(i = 0; i < nummodesA; i++)
1145  {
1146  for(j = 0; j < nummodesB/2; j++)
1147  {
1148  swap( maparray[i*nummodesB + j],
1149  maparray[i*nummodesB + nummodesB -1 -j]);
1150  swap( signarray[i*nummodesB + j],
1151  signarray[i*nummodesB + nummodesB -1 -j]);
1152  }
1153  }
1154  }
1155  }
1156  }
1157 
1158  if( (faceOrient==7) || (faceOrient==8) ||
1159  (faceOrient==10) || (faceOrient==12) )
1160  {
1161  if(faceOrient<9)
1162  {
1163  if (modified)
1164  {
1165  for(i = 0; i < nummodesB; i++)
1166  {
1167  for(j = 3; j < nummodesA; j+=2)
1168  {
1169  signarray[ arrayindx[i*nummodesA+j] ] *= -1;
1170  }
1171  }
1172 
1173  for(i = 0; i < nummodesB; i++)
1174  {
1175  swap( maparray[i*nummodesA],
1176  maparray[i*nummodesA+1]);
1177  swap( signarray[i*nummodesA],
1178  signarray[i*nummodesA+1]);
1179  }
1180  }
1181  else
1182  {
1183  for(i = 0; i < nummodesB; i++)
1184  {
1185  for(j = 0; j < nummodesA/2; j++)
1186  {
1187  swap( maparray[i*nummodesA + j],
1188  maparray[i*nummodesA + nummodesA -1 -j]);
1189  swap( signarray[i*nummodesA + j],
1190  signarray[i*nummodesA + nummodesA -1 -j]);
1191  }
1192  }
1193  }
1194 
1195 
1196 
1197  }
1198  else
1199  {
1200  if (modified)
1201  {
1202  for(i = 3; i < nummodesB; i+=2)
1203  {
1204  for(j = 0; j < nummodesA; j++)
1205  {
1206  signarray[ arrayindx[i*nummodesA+j] ] *= -1;
1207  }
1208  }
1209 
1210  for(i = 0; i < nummodesA; i++)
1211  {
1212  swap( maparray[i*nummodesB],
1213  maparray[i*nummodesB+1]);
1214  swap( signarray[i*nummodesB],
1215  signarray[i*nummodesB+1]);
1216  }
1217  }
1218  else
1219  {
1220  for(i = 0; i < nummodesB; i++)
1221  {
1222  for(j = 0; j < nummodesA/2; j++)
1223  {
1224  swap( maparray[i + j*nummodesB] ,
1225  maparray[i+nummodesA*nummodesB -
1226  nummodesB -j*nummodesB] );
1227  swap( signarray[i + j*nummodesB] ,
1228  signarray[i+nummodesA*nummodesB -
1229  nummodesB -j*nummodesB] );
1230 
1231  }
1232  }
1233 
1234  }
1235  }
1236  }
1237  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
Principle Modified Functions .
Definition: BasisType.h:49
LibUtilities::BasisType GetEdgeBasisType(const int i) const
This function returns the type of expansion basis on the i-th edge.
Definition: StdExpansion.h:397
Lagrange for SEM basis .
Definition: BasisType.h:53
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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 2020 of file StdHexExp.cpp.

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

2021  {
2024  "BasisType is not a boundary interior form");
2027  "BasisType is not a boundary interior form");
2030  "BasisType is not a boundary interior form");
2031 
2032  int i;
2033  int nummodes [3] = {m_base[0]->GetNumModes(),
2034  m_base[1]->GetNumModes(),
2035  m_base[2]->GetNumModes()};
2036 
2037  int nIntCoeffs = m_ncoeffs - NumBndryCoeffs();
2038 
2039  if(outarray.num_elements() != nIntCoeffs)
2040  {
2041  outarray = Array<OneD, unsigned int>(nIntCoeffs);
2042  }
2043 
2044  const LibUtilities::BasisType Btype [3] = {GetBasisType(0),
2045  GetBasisType(1),
2046  GetBasisType(2)};
2047 
2048  int p,q,r;
2049  int cnt = 0;
2050 
2051  int IntIdx [3][2];
2052 
2053  for(i = 0; i < 3; i++)
2054  {
2055  if( Btype[i] == LibUtilities::eModified_A)
2056  {
2057  IntIdx[i][0] = 2;
2058  IntIdx[i][1] = nummodes[i];
2059  }
2060  else
2061  {
2062  IntIdx[i][0] = 1;
2063  IntIdx[i][1] = nummodes[i]-1;
2064  }
2065  }
2066 
2067  for(r = IntIdx[2][0]; r < IntIdx[2][1]; r++)
2068  {
2069  for( q = IntIdx[1][0]; q < IntIdx[1][1]; q++)
2070  {
2071  for( p = IntIdx[0][0]; p < IntIdx[0][1]; p++)
2072  {
2073  outarray[cnt++] = r*nummodes[0]*nummodes[1] +
2074  q*nummodes[0] + p;
2075  }
2076  }
2077  }
2078  }
Principle Modified Functions .
Definition: BasisType.h:49
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:165
Lagrange for SEM basis .
Definition: BasisType.h:53
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
Array< OneD, LibUtilities::BasisSharedPtr > m_base
int Nektar::StdRegions::StdHexExp::v_GetNedges ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 679 of file StdHexExp.cpp.

680  {
681  return 12;
682  }
int Nektar::StdRegions::StdHexExp::v_GetNfaces ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 685 of file StdHexExp.cpp.

686  {
687  return 6;
688  }
int Nektar::StdRegions::StdHexExp::v_GetNverts ( ) const
protectedvirtual

Implements Nektar::StdRegions::StdExpansion.

Definition at line 673 of file StdHexExp.cpp.

674  {
675  return 8;
676  }
int Nektar::StdRegions::StdHexExp::v_GetTotalEdgeIntNcoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 756 of file StdHexExp.cpp.

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

757  {
759  }
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
Definition: StdExpansion.h:178
int Nektar::StdRegions::StdHexExp::v_GetTotalFaceIntNcoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 798 of file StdHexExp.cpp.

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

799  {
800  return 2*((GetBasisNumModes(0)-2)*(GetBasisNumModes(1)-2)+
801  (GetBasisNumModes(0)-2)*(GetBasisNumModes(2)-2)+
802  (GetBasisNumModes(1)-2)*(GetBasisNumModes(2)-2));
803  }
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
Definition: StdExpansion.h:178
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 1248 of file StdHexExp.cpp.

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

1249  {
1252  "BasisType is not a boundary interior form");
1255  "BasisType is not a boundary interior form");
1258  "BasisType is not a boundary interior form");
1259 
1260  ASSERTL1((localVertexId>=0)&&(localVertexId<8),
1261  "local vertex id must be between 0 and 7");
1262 
1263  int p = 0;
1264  int q = 0;
1265  int r = 0;
1266 
1267  // Retrieve the number of modes in each dimension.
1268  int nummodes [3] = {m_base[0]->GetNumModes(),
1269  m_base[1]->GetNumModes(),
1270  m_base[2]->GetNumModes()};
1271 
1272  if(useCoeffPacking == true) // follow packing of coefficients i.e q,r,p
1273  {
1274  if(localVertexId > 3)
1275  {
1277  {
1278  r = nummodes[2]-1;
1279  }
1280  else
1281  {
1282  r = 1;
1283  }
1284  }
1285 
1286  switch(localVertexId % 4)
1287  {
1288  case 0:
1289  break;
1290  case 1:
1291  {
1293  {
1294  p = nummodes[0]-1;
1295  }
1296  else
1297  {
1298  p = 1;
1299  }
1300  }
1301  break;
1302  case 2:
1303  {
1305  {
1306  q = nummodes[1]-1;
1307  }
1308  else
1309  {
1310  q = 1;
1311  }
1312  }
1313  break;
1314  case 3:
1315  {
1317  {
1318  p = nummodes[0]-1;
1319  q = nummodes[1]-1;
1320  }
1321  else
1322  {
1323  p = 1;
1324  q = 1;
1325  }
1326  }
1327  break;
1328  }
1329  }
1330  else
1331  {
1332  // Right face (vertices 1,2,5,6)
1333  if( (localVertexId % 4) % 3 > 0 )
1334  {
1336  {
1337  p = nummodes[0]-1;
1338  }
1339  else
1340  {
1341  p = 1;
1342  }
1343  }
1344 
1345  // Back face (vertices 2,3,6,7)
1346  if( localVertexId % 4 > 1 )
1347  {
1349  {
1350  q = nummodes[1]-1;
1351  }
1352  else
1353  {
1354  q = 1;
1355  }
1356  }
1357 
1358  // Top face (vertices 4,5,6,7)
1359  if( localVertexId > 3)
1360  {
1362  {
1363  r = nummodes[2]-1;
1364  }
1365  else
1366  {
1367  r = 1;
1368  }
1369  }
1370  }
1371  // Compute the local number.
1372  return r*nummodes[0]*nummodes[1] + q*nummodes[0] + p;
1373  }
Principle Modified Functions .
Definition: BasisType.h:49
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:165
Lagrange for SEM basis .
Definition: BasisType.h:53
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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 2224 of file StdHexExp.cpp.

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

2228  {
2229  StdHexExp::v_HelmholtzMatrixOp_MatFree(inarray,outarray,mkey);
2230  }
virtual void v_HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
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 364 of file StdHexExp.cpp.

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

367  {
368  if(m_base[0]->Collocation() &&
369  m_base[1]->Collocation() &&
370  m_base[2]->Collocation())
371  {
372  MultiplyByQuadratureMetric(inarray,outarray);
373  }
374  else
375  {
376  StdHexExp::v_IProductWRTBase_SumFac(inarray,outarray);
377  }
378  }
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:902
Array< OneD, LibUtilities::BasisSharedPtr > m_base
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multbyweights=true)
Definition: StdHexExp.cpp:397
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 383 of file StdHexExp.cpp.

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

385  {
386  int nq = GetTotPoints();
387  StdMatrixKey iprodmatkey(eIProductWRTBase,DetShapeType(),*this);
388  DNekMatSharedPtr iprodmat = GetStdMatrix(iprodmatkey);
389 
390  Blas::Dgemv('N',m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
391  m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
392  }
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:454
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:684
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:141
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 397 of file StdHexExp.cpp.

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

Referenced by v_IProductWRTBase().

401  {
402  int nquad0 = m_base[0]->GetNumPoints();
403  int nquad1 = m_base[1]->GetNumPoints();
404  int nquad2 = m_base[2]->GetNumPoints();
405  int order0 = m_base[0]->GetNumModes();
406  int order1 = m_base[1]->GetNumModes();
407 
408  Array<OneD, NekDouble> wsp(nquad0*nquad1*(nquad2+order0) +
409  order0*order1*nquad2);
410 
411  if(multiplybyweights)
412  {
413  Array<OneD, NekDouble> tmp(inarray.num_elements());
414  MultiplyByQuadratureMetric(inarray,tmp);
415 
417  m_base[1]->GetBdata(),
418  m_base[2]->GetBdata(),
419  tmp,outarray,wsp,true,true,true);
420  }
421  else
422  {
424  m_base[1]->GetBdata(),
425  m_base[2]->GetBdata(),
426  inarray,outarray,wsp,true,true,true);
427  }
428  }
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:902
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)
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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 435 of file StdHexExp.cpp.

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

444  {
445  int nquad0 = m_base[0]->GetNumPoints();
446  int nquad1 = m_base[1]->GetNumPoints();
447  int nquad2 = m_base[2]->GetNumPoints();
448  int nmodes0 = m_base[0]->GetNumModes();
449  int nmodes1 = m_base[1]->GetNumModes();
450  int nmodes2 = m_base[2]->GetNumModes();
451 
452  bool colldir0 = doCheckCollDir0?(m_base[0]->Collocation()):false;
453  bool colldir1 = doCheckCollDir1?(m_base[1]->Collocation()):false;
454  bool colldir2 = doCheckCollDir2?(m_base[2]->Collocation()):false;
455 
456  if(colldir0 && colldir1 && colldir2)
457  {
458  Vmath::Vcopy(m_ncoeffs,inarray.get(),1,outarray.get(),1);
459  }
460  else
461  {
462  ASSERTL1(wsp.num_elements() >= nmodes0*nquad2*(nquad1+nmodes1),
463  "Insufficient workspace size");
464 
465  Array<OneD, NekDouble> tmp0 = wsp;
466  Array<OneD, NekDouble> tmp1 = wsp + nmodes0*nquad1*nquad2;
467 
468 
469  if(colldir0)
470  {
471  // reshuffle data for next operation.
472  for(int n = 0; n < nmodes0; ++n)
473  {
474  Vmath::Vcopy(nquad1*nquad2,inarray.get()+n,nquad0,
475  tmp0.get()+nquad1*nquad2*n,1);
476  }
477  }
478  else
479  {
480  Blas::Dgemm('T', 'N', nquad1*nquad2, nmodes0, nquad0,
481  1.0, inarray.get(), nquad0,
482  base0.get(), nquad0,
483  0.0, tmp0.get(), nquad1*nquad2);
484  }
485 
486  if(colldir1)
487  {
488  // reshuffle data for next operation.
489  for(int n = 0; n < nmodes1; ++n)
490  {
491  Vmath::Vcopy(nquad2*nmodes0,tmp0.get()+n,nquad1,
492  tmp1.get()+nquad2*nmodes0*n,1);
493  }
494  }
495  else
496  {
497  Blas::Dgemm('T', 'N', nquad2*nmodes0, nmodes1, nquad1,
498  1.0, tmp0.get(), nquad1,
499  base1.get(), nquad1,
500  0.0, tmp1.get(), nquad2*nmodes0);
501  }
502 
503  if(colldir2)
504  {
505  // reshuffle data for next operation.
506  for(int n = 0; n < nmodes2; ++n)
507  {
508  Vmath::Vcopy(nmodes0*nmodes1,tmp1.get()+n,nquad2,
509  outarray.get()+nmodes0*nmodes1*n,1);
510  }
511  }
512  else
513  {
514  Blas::Dgemm('T', 'N', nmodes0*nmodes1, nmodes2, nquad2,
515  1.0, tmp1.get(), nquad2,
516  base2.get(), nquad2,
517  0.0, outarray.get(), nmodes0*nmodes1);
518  }
519  }
520  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1038
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 522 of file StdHexExp.cpp.

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

525  {
526  StdHexExp::IProductWRTDerivBase_SumFac(dir,inarray,outarray);
527  }
void IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void Nektar::StdRegions::StdHexExp::v_IProductWRTDerivBase_MatOp ( const int  dir,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Definition at line 530 of file StdHexExp.cpp.

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

533  {
534  ASSERTL0((dir==0)||(dir==1)||(dir==2),"input dir is out of range");
535 
536  int nq = GetTotPoints();
537  MatrixType mtype;
538 
539  switch (dir)
540  {
541  case 0:
542  mtype = eIProductWRTDerivBase0;
543  break;
544  case 1:
545  mtype = eIProductWRTDerivBase1;
546  break;
547  case 2:
548  mtype = eIProductWRTDerivBase2;
549  break;
550  }
551 
552  StdMatrixKey iprodmatkey(mtype,DetShapeType(),*this);
553  DNekMatSharedPtr iprodmat = GetStdMatrix(iprodmatkey);
554 
555  Blas::Dgemv('N',m_ncoeffs,nq,1.0,iprodmat->GetPtr().get(),
556  m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
557  }
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:454
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:684
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:141
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 560 of file StdHexExp.cpp.

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

563  {
564  ASSERTL0((dir==0)||(dir==1)||(dir==2),"input dir is out of range");
565 
566  int nquad1 = m_base[1]->GetNumPoints();
567  int nquad2 = m_base[2]->GetNumPoints();
568  int order0 = m_base[0]->GetNumModes();
569  int order1 = m_base[1]->GetNumModes();
570 
571  // If outarray > inarray then no need for temporary storage.
572  Array<OneD, NekDouble> tmp = outarray;
573  if (outarray.num_elements() < inarray.num_elements())
574  {
575  tmp = Array<OneD, NekDouble>(inarray.num_elements());
576  }
577 
578  // Need workspace for sumfackernel though
579  Array<OneD, NekDouble> wsp(order0*nquad2*(nquad1+order1));
580 
581  // multiply by integration constants
582  MultiplyByQuadratureMetric(inarray,tmp);
583 
584  // perform sum-factorisation
585  switch (dir)
586  {
587  case 0:
588  IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(),
589  m_base[1]->GetBdata(),
590  m_base[2]->GetBdata(),
591  tmp,outarray,wsp,
592  false,true,true);
593  break;
594  case 1:
595  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
596  m_base[1]->GetDbdata(),
597  m_base[2]->GetBdata(),
598  tmp,outarray,wsp,
599  true,false,true);
600  break;
601  case 2:
602  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
603  m_base[1]->GetBdata(),
604  m_base[2]->GetDbdata(),
605  tmp,outarray,wsp,
606  true,true,false);
607  break;
608  }
609  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:902
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)
Array< OneD, LibUtilities::BasisSharedPtr > m_base
bool Nektar::StdRegions::StdHexExp::v_IsBoundaryInteriorExpansion ( )
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 83 of file StdHexExp.cpp.

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

84  {
85  return (m_base[0]->GetBasisType() == LibUtilities::eModified_A) &&
86  (m_base[1]->GetBasisType() == LibUtilities::eModified_A) &&
88  }
Principle Modified Functions .
Definition: BasisType.h:49
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:165
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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 2196 of file StdHexExp.cpp.

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

2200  {
2201  StdHexExp::v_LaplacianMatrixOp_MatFree(inarray,outarray,mkey);
2202  }
virtual void v_LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
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 2205 of file StdHexExp.cpp.

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

2209  {
2210  StdExpansion::LaplacianMatrixOp_MatFree(k1,k2,inarray,outarray,
2211  mkey);
2212  }
void LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
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 611 of file StdHexExp.cpp.

613  {
614  eta[0] = xi[0];
615  eta[1] = xi[1];
616  eta[2] = xi[2];
617  }
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 2187 of file StdHexExp.cpp.

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

2191  {
2192  StdExpansion::MassMatrixOp_MatFree(inarray,outarray,mkey);
2193  }
void MassMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
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 2256 of file StdHexExp.cpp.

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

2258  {
2259  int i;
2260  int nquad0 = m_base[0]->GetNumPoints();
2261  int nquad1 = m_base[1]->GetNumPoints();
2262  int nquad2 = m_base[2]->GetNumPoints();
2263  int nq01 = nquad0*nquad1;
2264  int nq12 = nquad1*nquad2;
2265 
2266  const Array<OneD, const NekDouble>& w0 = m_base[0]->GetW();
2267  const Array<OneD, const NekDouble>& w1 = m_base[1]->GetW();
2268  const Array<OneD, const NekDouble>& w2 = m_base[2]->GetW();
2269 
2270  for(i = 0; i < nq12; ++i)
2271  {
2272  Vmath::Vmul(nquad0, inarray.get()+i*nquad0, 1,
2273  w0.get(), 1, outarray.get()+i*nquad0,1);
2274  }
2275 
2276  for(i = 0; i < nq12; ++i)
2277  {
2278  Vmath::Smul(nquad0, w1[i%nquad1], outarray.get()+i*nquad0, 1,
2279  outarray.get()+i*nquad0, 1);
2280  }
2281 
2282  for(i = 0; i < nquad2; ++i)
2283  {
2284  Vmath::Smul(nq01, w2[i], outarray.get()+i*nq01, 1,
2285  outarray.get()+i*nq01, 1);
2286  }
2287  }
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:199
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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:169
int Nektar::StdRegions::StdHexExp::v_NumBndryCoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 697 of file StdHexExp.cpp.

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

698  {
701  "BasisType is not a boundary interior form");
704  "BasisType is not a boundary interior form");
707  "BasisType is not a boundary interior form");
708 
709  int nmodes0 = m_base[0]->GetNumModes();
710  int nmodes1 = m_base[1]->GetNumModes();
711  int nmodes2 = m_base[2]->GetNumModes();
712 
713  return ( 2*( nmodes0*nmodes1 + nmodes0*nmodes2
714  + nmodes1*nmodes2)
715  - 4*( nmodes0 + nmodes1 + nmodes2 ) + 8 );
716  }
Principle Modified Functions .
Definition: BasisType.h:49
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:165
Lagrange for SEM basis .
Definition: BasisType.h:53
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
Array< OneD, LibUtilities::BasisSharedPtr > m_base
int Nektar::StdRegions::StdHexExp::v_NumDGBndryCoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 718 of file StdHexExp.cpp.

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

719  {
722  "BasisType is not a boundary interior form");
725  "BasisType is not a boundary interior form");
728  "BasisType is not a boundary interior form");
729 
730  int nmodes0 = m_base[0]->GetNumModes();
731  int nmodes1 = m_base[1]->GetNumModes();
732  int nmodes2 = m_base[2]->GetNumModes();
733 
734  return 2*( nmodes0*nmodes1 + nmodes0*nmodes2
735  + nmodes1*nmodes2 );
736  }
Principle Modified Functions .
Definition: BasisType.h:49
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:165
Lagrange for SEM basis .
Definition: BasisType.h:53
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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 98 of file StdHexExp.cpp.

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

Referenced by v_StdPhysDeriv().

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

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

116  {
117  switch(dir)
118  {
119  case 0:
120  {
121  PhysDeriv(inarray, outarray, NullNekDouble1DArray,
123  }
124  break;
125  case 1:
126  {
127  PhysDeriv(inarray, NullNekDouble1DArray, outarray,
129  }
130  break;
131  case 2:
132  {
134  NullNekDouble1DArray, outarray);
135  }
136  break;
137  default:
138  {
139  ASSERTL1(false,"input dir is out of range");
140  }
141  break;
142  }
143  }
static Array< OneD, NekDouble > NullNekDouble1DArray
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)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
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 145 of file StdHexExp.cpp.

References v_PhysDeriv().

150  {
151  StdHexExp::v_PhysDeriv(inarray, out_d0, out_d1, out_d2);
152  }
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:98
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 155 of file StdHexExp.cpp.

References v_PhysDeriv().

158  {
159  StdHexExp::v_PhysDeriv(dir, inarray, outarray);
160  }
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:98
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 2289 of file StdHexExp.cpp.

References Nektar::StdRegions::StdExpansion::BwdTrans(), Nektar::StdRegions::eFactorSVVCutoffRatio, Nektar::StdRegions::eFactorSVVDiffCoeff, Nektar::LibUtilities::eOrtho_A, Nektar::StdRegions::StdExpansion::FwdTrans(), Nektar::StdRegions::StdMatrixKey::GetConstFactor(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::GetPointsType(), and Nektar::StdRegions::StdExpansion::m_base.

2291  {
2292  // Generate an orthonogal expansion
2293  int qa = m_base[0]->GetNumPoints();
2294  int qb = m_base[1]->GetNumPoints();
2295  int qc = m_base[2]->GetNumPoints();
2296  int nmodes_a = m_base[0]->GetNumModes();
2297  int nmodes_b = m_base[1]->GetNumModes();
2298  int nmodes_c = m_base[2]->GetNumModes();
2299  // Declare orthogonal basis.
2300  LibUtilities::PointsKey pa(qa,m_base[0]->GetPointsType());
2301  LibUtilities::PointsKey pb(qb,m_base[1]->GetPointsType());
2302  LibUtilities::PointsKey pc(qc,m_base[2]->GetPointsType());
2303 
2304  LibUtilities::BasisKey Ba(LibUtilities::eOrtho_A,nmodes_a,pa);
2305  LibUtilities::BasisKey Bb(LibUtilities::eOrtho_A,nmodes_b,pb);
2306  LibUtilities::BasisKey Bc(LibUtilities::eOrtho_A,nmodes_c,pc);
2307  StdHexExp OrthoExp(Ba,Bb,Bc);
2308 
2309  Array<OneD, NekDouble> orthocoeffs(OrthoExp.GetNcoeffs());
2310  int i,j,k;
2311 
2312  int cutoff = (int) (mkey.GetConstFactor(eFactorSVVCutoffRatio)*min(nmodes_a,nmodes_b));
2313  NekDouble SvvDiffCoeff = mkey.GetConstFactor(eFactorSVVDiffCoeff);
2314 
2315  // project onto modal space.
2316  OrthoExp.FwdTrans(array,orthocoeffs);
2317 
2318 
2319  // Filter just trilinear space
2320  int nmodes = max(nmodes_a,nmodes_b);
2321  nmodes = max(nmodes,nmodes_c);
2322 
2323  Array<OneD, NekDouble> fac(nmodes,1.0);
2324  for(j = cutoff; j < nmodes; ++j)
2325  {
2326  fac[j] = fabs((j-nmodes)/((NekDouble) (j-cutoff+1.0)));
2327  fac[j] *= fac[j]; //added this line to conform with equation
2328  }
2329 
2330  for(i = 0; i < nmodes_a; ++i)
2331  {
2332  for(j = 0; j < nmodes_b; ++j)
2333  {
2334  for(k = 0; k < nmodes_c; ++k)
2335  {
2336  if((i >= cutoff)||(j >= cutoff)||(k >= cutoff))
2337  {
2338  orthocoeffs[i*nmodes_a*nmodes_b + j*nmodes_c + k] *= (SvvDiffCoeff*exp( -(fac[i]+fac[j]+fac[k]) ));
2339  }
2340  else
2341  {
2342  orthocoeffs[i*nmodes_a*nmodes_b + j*nmodes_c + k] *= 0.0;
2343  }
2344  }
2345  }
2346  }
2347 
2348  // backward transform to physical space
2349  OrthoExp.BwdTrans(orthocoeffs,array);
2350  }
Principle Orthogonal Functions .
Definition: BasisType.h:46
double NekDouble
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
Definition: StdExpansion.h:216
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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 2215 of file StdHexExp.cpp.

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

2219  {
2220  StdExpansion::WeakDerivMatrixOp_MatFree(i,inarray,outarray,
2221  mkey);
2222  }
void WeakDerivMatrixOp_MatFree(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)