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

#include <PrismExp.h>

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

Public Member Functions

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

Protected Member Functions

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

Private Member Functions

virtual void v_LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
 Calculate the Laplacian multiplication in a matrix-free manner. More...
 

Private Attributes

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

Additional Inherited Members

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

Detailed Description

Definition at line 49 of file PrismExp.h.

Constructor & Destructor Documentation

◆ PrismExp() [1/2]

Nektar::LocalRegions::PrismExp::PrismExp ( const LibUtilities::BasisKey Ba,
const LibUtilities::BasisKey Bb,
const LibUtilities::BasisKey Bc,
const SpatialDomains::PrismGeomSharedPtr geom 
)

Constructor using BasisKey class for quadrature points and order definition.

Definition at line 49 of file PrismExp.cpp.

52  :
54  Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
55  3, Ba, Bb, Bc),
57  Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
58  Ba, Bb, Bc),
59  StdPrismExp (Ba, Bb, Bc),
60  Expansion (geom),
61  Expansion3D (geom),
63  std::bind(&PrismExp::CreateMatrix, this, std::placeholders::_1),
64  std::string("PrismExpMatrix")),
66  std::bind(&PrismExp::CreateStaticCondMatrix, this, std::placeholders::_1),
67  std::string("PrismExpStaticCondMatrix"))
68  {
69  }
Expansion3D(SpatialDomains::Geometry3DSharedPtr pGeom)
Definition: Expansion3D.h:61
Expansion(SpatialDomains::GeometrySharedPtr pGeom)
Definition: Expansion.cpp:47
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: PrismExp.h:215
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1164
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1455
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: PrismExp.h:213
StdExpansion()
Default Constructor.
int getNumberOfCoefficients(int Na, int Nb, int Nc)
Definition: ShapeType.hpp:287

◆ PrismExp() [2/2]

Nektar::LocalRegions::PrismExp::PrismExp ( const PrismExp T)

Definition at line 71 of file PrismExp.cpp.

71  :
72  StdExpansion(T),
73  StdExpansion3D(T),
74  StdPrismExp(T),
75  Expansion(T),
76  Expansion3D(T),
77  m_matrixManager(T.m_matrixManager),
78  m_staticCondMatrixManager(T.m_staticCondMatrixManager)
79  {
80  }

◆ ~PrismExp()

Nektar::LocalRegions::PrismExp::~PrismExp ( )

Definition at line 82 of file PrismExp.cpp.

83  {
84  }

Member Function Documentation

◆ CreateMatrix()

DNekScalMatSharedPtr Nektar::LocalRegions::PrismExp::CreateMatrix ( const MatrixKey mkey)
protected

Definition at line 1164 of file PrismExp.cpp.

1165  {
1166  DNekScalMatSharedPtr returnval;
1168 
1170  "Geometric information is not set up");
1171 
1172  switch(mkey.GetMatrixType())
1173  {
1174  case StdRegions::eMass:
1175  {
1176  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1177  {
1178  NekDouble one = 1.0;
1179  DNekMatSharedPtr mat = GenMatrix(mkey);
1180  returnval = MemoryManager<DNekScalMat>::AllocateSharedPtr(one,mat);
1181  }
1182  else
1183  {
1184  NekDouble jac = (m_metricinfo->GetJac(ptsKeys))[0];
1185  DNekMatSharedPtr mat = GetStdMatrix(mkey);
1186  returnval = MemoryManager<DNekScalMat>::AllocateSharedPtr(jac,mat);
1187  }
1188  break;
1189  }
1190 
1191  case StdRegions::eInvMass:
1192  {
1193  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1194  {
1195  NekDouble one = 1.0;
1196  StdRegions::StdMatrixKey masskey(StdRegions::eMass,DetShapeType(),*this);
1197  DNekMatSharedPtr mat = GenMatrix(masskey);
1198  mat->Invert();
1199 
1200  returnval = MemoryManager<DNekScalMat>::AllocateSharedPtr(one,mat);
1201  }
1202  else
1203  {
1204  NekDouble fac = 1.0/(m_metricinfo->GetJac(ptsKeys))[0];
1205  DNekMatSharedPtr mat = GetStdMatrix(mkey);
1206  returnval = MemoryManager<DNekScalMat>::AllocateSharedPtr(fac,mat);
1207  }
1208  break;
1209  }
1210 
1214  {
1215  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1216  {
1217  NekDouble one = 1.0;
1218  DNekMatSharedPtr mat = GenMatrix(mkey);
1219 
1220  returnval = MemoryManager<DNekScalMat>::AllocateSharedPtr(one,mat);
1221  }
1222  else
1223  {
1224  NekDouble jac = (m_metricinfo->GetJac(ptsKeys))[0];
1225  Array<TwoD, const NekDouble> df =
1226  m_metricinfo->GetDerivFactors(ptsKeys);
1227  int dir = 0;
1228 
1229  switch(mkey.GetMatrixType())
1230  {
1232  dir = 0;
1233  break;
1235  dir = 1;
1236  break;
1238  dir = 2;
1239  break;
1240  default:
1241  break;
1242  }
1243 
1244  MatrixKey deriv0key(StdRegions::eWeakDeriv0,
1245  mkey.GetShapeType(), *this);
1246  MatrixKey deriv1key(StdRegions::eWeakDeriv1,
1247  mkey.GetShapeType(), *this);
1248  MatrixKey deriv2key(StdRegions::eWeakDeriv2,
1249  mkey.GetShapeType(), *this);
1250 
1251  DNekMat &deriv0 = *GetStdMatrix(deriv0key);
1252  DNekMat &deriv1 = *GetStdMatrix(deriv1key);
1253  DNekMat &deriv2 = *GetStdMatrix(deriv2key);
1254 
1255  int rows = deriv0.GetRows();
1256  int cols = deriv1.GetColumns();
1257 
1259  ::AllocateSharedPtr(rows,cols);
1260 
1261  (*WeakDeriv) = df[3*dir ][0]*deriv0
1262  + df[3*dir+1][0]*deriv1
1263  + df[3*dir+2][0]*deriv2;
1264 
1265  returnval = MemoryManager<DNekScalMat>
1266  ::AllocateSharedPtr(jac,WeakDeriv);
1267  }
1268  break;
1269  }
1270 
1272  {
1273  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed ||
1274  mkey.GetNVarCoeff() > 0 ||
1275  mkey.ConstFactorExists(
1277  {
1278  NekDouble one = 1.0;
1279  DNekMatSharedPtr mat = GenMatrix(mkey);
1280  returnval = MemoryManager<DNekScalMat>::AllocateSharedPtr(one,mat);
1281  }
1282  else
1283  {
1284  MatrixKey lap00key(StdRegions::eLaplacian00,
1285  mkey.GetShapeType(), *this);
1286  MatrixKey lap01key(StdRegions::eLaplacian01,
1287  mkey.GetShapeType(), *this);
1288  MatrixKey lap02key(StdRegions::eLaplacian02,
1289  mkey.GetShapeType(), *this);
1290  MatrixKey lap11key(StdRegions::eLaplacian11,
1291  mkey.GetShapeType(), *this);
1292  MatrixKey lap12key(StdRegions::eLaplacian12,
1293  mkey.GetShapeType(), *this);
1294  MatrixKey lap22key(StdRegions::eLaplacian22,
1295  mkey.GetShapeType(), *this);
1296 
1297  DNekMat &lap00 = *GetStdMatrix(lap00key);
1298  DNekMat &lap01 = *GetStdMatrix(lap01key);
1299  DNekMat &lap02 = *GetStdMatrix(lap02key);
1300  DNekMat &lap11 = *GetStdMatrix(lap11key);
1301  DNekMat &lap12 = *GetStdMatrix(lap12key);
1302  DNekMat &lap22 = *GetStdMatrix(lap22key);
1303 
1304  NekDouble jac = (m_metricinfo->GetJac(ptsKeys))[0];
1305  Array<TwoD, const NekDouble> gmat
1306  = m_metricinfo->GetGmat(ptsKeys);
1307 
1308  int rows = lap00.GetRows();
1309  int cols = lap00.GetColumns();
1310 
1312  ::AllocateSharedPtr(rows,cols);
1313 
1314  (*lap) = gmat[0][0]*lap00
1315  + gmat[4][0]*lap11
1316  + gmat[8][0]*lap22
1317  + gmat[3][0]*(lap01 + Transpose(lap01))
1318  + gmat[6][0]*(lap02 + Transpose(lap02))
1319  + gmat[7][0]*(lap12 + Transpose(lap12));
1320 
1321  returnval = MemoryManager<DNekScalMat>
1322  ::AllocateSharedPtr(jac,lap);
1323  }
1324  break;
1325  }
1326 
1328  {
1329  NekDouble factor = mkey.GetConstFactor(StdRegions::eFactorLambda);
1330  MatrixKey masskey(StdRegions::eMass,
1331  mkey.GetShapeType(), *this);
1332  DNekScalMat &MassMat = *(this->m_matrixManager[masskey]);
1333  MatrixKey lapkey(StdRegions::eLaplacian,
1334  mkey.GetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
1335  DNekScalMat &LapMat = *(this->m_matrixManager[lapkey]);
1336 
1337  int rows = LapMat.GetRows();
1338  int cols = LapMat.GetColumns();
1339 
1341 
1342  NekDouble one = 1.0;
1343  (*helm) = LapMat + factor*MassMat;
1344 
1345  returnval = MemoryManager<DNekScalMat>::AllocateSharedPtr(one,helm);
1346  break;
1347  }
1354  {
1355  NekDouble one = 1.0;
1356 
1357  DNekMatSharedPtr mat = GenMatrix(mkey);
1358  returnval = MemoryManager<DNekScalMat>::AllocateSharedPtr(one,mat);
1359 
1360  break;
1361  }
1362 
1364  {
1365  NekDouble one = 1.0;
1366 
1367  MatrixKey hkey(StdRegions::eHybridDGHelmholtz, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
1368 // StdRegions::StdMatrixKey hkey(StdRegions::eHybridDGHelmholtz,
1369 // DetExpansionType(),*this,
1370 // mkey.GetConstant(0),
1371 // mkey.GetConstant(1));
1372  DNekMatSharedPtr mat = GenMatrix(hkey);
1373 
1374  mat->Invert();
1375  returnval = MemoryManager<DNekScalMat>::AllocateSharedPtr(one,mat);
1376  break;
1377  }
1378 
1380  {
1381  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1382  {
1383  NekDouble one = 1.0;
1384  DNekMatSharedPtr mat = GenMatrix(mkey);
1385  returnval = MemoryManager<DNekScalMat>::AllocateSharedPtr(one,mat);
1386  }
1387  else
1388  {
1389  NekDouble jac = (m_metricinfo->GetJac(ptsKeys))[0];
1390  DNekMatSharedPtr mat = GetStdMatrix(mkey);
1391  returnval = MemoryManager<DNekScalMat>::AllocateSharedPtr(jac,mat);
1392  }
1393  break;
1394  }
1396  {
1397  NekDouble one = 1.0;
1398  MatrixKey helmkey(StdRegions::eHelmholtz, mkey.GetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
1399  DNekScalBlkMatSharedPtr helmStatCond = GetLocStaticCondMatrix(helmkey);
1400  DNekScalMatSharedPtr A =helmStatCond->GetBlock(0,0);
1402 
1404  }
1405  break;
1407  {
1408  NekDouble one = 1.0;
1409  MatrixKey masskey(StdRegions::eMass, mkey.GetShapeType(), *this);
1410  DNekScalBlkMatSharedPtr massStatCond = GetLocStaticCondMatrix(masskey);
1411  DNekScalMatSharedPtr A =massStatCond->GetBlock(0,0);
1413 
1415  }
1416  break;
1417  case StdRegions::ePreconR:
1418  {
1419  NekDouble one = 1.0;
1420  MatrixKey helmkey(StdRegions::eHelmholtz, mkey.GetShapeType(), *this,mkey.GetConstFactors(), mkey.GetVarCoeffs());
1421  DNekScalBlkMatSharedPtr helmStatCond = GetLocStaticCondMatrix(helmkey);
1422  DNekScalMatSharedPtr A =helmStatCond->GetBlock(0,0);
1423 
1424  DNekScalMatSharedPtr Atmp;
1425  DNekMatSharedPtr R=BuildTransformationMatrix(A,mkey.GetMatrixType());
1426 
1428  }
1429  break;
1431  {
1432  NekDouble one = 1.0;
1433  MatrixKey masskey(StdRegions::eMass, mkey.GetShapeType(), *this);
1434  DNekScalBlkMatSharedPtr massStatCond = GetLocStaticCondMatrix(masskey);
1435  DNekScalMatSharedPtr A =massStatCond->GetBlock(0,0);
1436 
1437  DNekScalMatSharedPtr Atmp;
1438  DNekMatSharedPtr R=BuildTransformationMatrix(A,mkey.GetMatrixType());
1439 
1441  }
1442  break;
1443  default:
1444  {
1445  NekDouble one = 1.0;
1446  DNekMatSharedPtr mat = GenMatrix(mkey);
1447 
1448  returnval = MemoryManager<DNekScalMat>::AllocateSharedPtr(one,mat);
1449  }
1450  }
1451 
1452  return returnval;
1453  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
Definition: ErrorUtil.hpp:274
DNekMatSharedPtr BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
Definition: Expansion.cpp:103
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:273
DNekMatSharedPtr BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
Definition: Expansion.cpp:95
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:617
const LibUtilities::PointsKeyVector GetPointsKeys() const
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
Definition: StdExpansion.h:660
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:376
DNekMatSharedPtr GenMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:850
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:246
@ eNoGeomType
No type defined.
@ eDeformed
Geometry is curved or has non-constant factors.
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
NekMatrix< NekDouble, StandardMatrixTag > DNekMat
Definition: NekTypeDefs.hpp:51
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:73
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
double NekDouble

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL2, Nektar::LocalRegions::Expansion::BuildTransformationMatrix(), Nektar::LocalRegions::Expansion::BuildVertexMatrix(), Nektar::StdRegions::StdMatrixKey::ConstFactorExists(), Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::eFactorLambda, Nektar::StdRegions::eFactorSVVCutoffRatio, Nektar::StdRegions::eHelmholtz, Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::StdRegions::eHybridDGHelmholtz, Nektar::StdRegions::eHybridDGLamToQ0, Nektar::StdRegions::eHybridDGLamToQ1, Nektar::StdRegions::eHybridDGLamToU, Nektar::StdRegions::eInvHybridDGHelmholtz, Nektar::StdRegions::eInvLaplacianWithUnityMean, Nektar::StdRegions::eInvMass, Nektar::StdRegions::eIProductWRTBase, Nektar::StdRegions::eLaplacian, Nektar::StdRegions::eLaplacian00, Nektar::StdRegions::eLaplacian01, Nektar::StdRegions::eLaplacian02, Nektar::StdRegions::eLaplacian11, Nektar::StdRegions::eLaplacian12, Nektar::StdRegions::eLaplacian22, Nektar::StdRegions::eMass, Nektar::SpatialDomains::eNoGeomType, Nektar::StdRegions::ePreconLinearSpace, Nektar::StdRegions::ePreconLinearSpaceMass, Nektar::StdRegions::ePreconR, Nektar::StdRegions::ePreconRMass, Nektar::StdRegions::eWeakDeriv0, Nektar::StdRegions::eWeakDeriv1, Nektar::StdRegions::eWeakDeriv2, Nektar::StdRegions::StdExpansion::GenMatrix(), Nektar::StdRegions::StdMatrixKey::GetConstFactor(), Nektar::StdRegions::StdMatrixKey::GetConstFactors(), Nektar::StdRegions::StdExpansion::GetLocStaticCondMatrix(), Nektar::StdRegions::StdMatrixKey::GetMatrixType(), Nektar::StdRegions::StdMatrixKey::GetNVarCoeff(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdMatrixKey::GetShapeType(), Nektar::StdRegions::StdExpansion::GetStdMatrix(), Nektar::StdRegions::StdMatrixKey::GetVarCoeffs(), m_matrixManager, Nektar::LocalRegions::Expansion::m_metricinfo, and Nektar::Transpose().

◆ CreateStaticCondMatrix()

DNekScalBlkMatSharedPtr Nektar::LocalRegions::PrismExp::CreateStaticCondMatrix ( const MatrixKey mkey)
protected

Definition at line 1455 of file PrismExp.cpp.

1456  {
1457  DNekScalBlkMatSharedPtr returnval;
1458 
1459  ASSERTL2(m_metricinfo->GetGtype() != SpatialDomains::eNoGeomType,"Geometric information is not set up");
1460 
1461  // set up block matrix system
1462  unsigned int nbdry = NumBndryCoeffs();
1463  unsigned int nint = (unsigned int)(m_ncoeffs - nbdry);
1464  unsigned int exp_size[] = {nbdry, nint};
1465  unsigned int nblks=2;
1466  returnval = MemoryManager<DNekScalBlkMat>::AllocateSharedPtr(nblks, nblks, exp_size, exp_size);
1467  NekDouble factor = 1.0;
1468 
1469  switch(mkey.GetMatrixType())
1470  {
1472  case StdRegions::eHelmholtz: // special case since Helmholtz not defined in StdRegions
1473  // use Deformed case for both regular and deformed geometries
1474  factor = 1.0;
1475  goto UseLocRegionsMatrix;
1476  break;
1477  default:
1478  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1479  {
1480  factor = 1.0;
1481  goto UseLocRegionsMatrix;
1482  }
1483  else
1484  {
1485  DNekScalMatSharedPtr mat = GetLocMatrix(mkey);
1486  factor = mat->Scale();
1487  goto UseStdRegionsMatrix;
1488  }
1489  break;
1490  UseStdRegionsMatrix:
1491  {
1492  NekDouble invfactor = 1.0/factor;
1493  NekDouble one = 1.0;
1495  DNekScalMatSharedPtr Atmp;
1496  DNekMatSharedPtr Asubmat;
1497 
1498  //TODO: check below
1499  returnval->SetBlock(0,0,Atmp = MemoryManager<DNekScalMat>::AllocateSharedPtr(factor,Asubmat = mat->GetBlock(0,0)));
1500  returnval->SetBlock(0,1,Atmp = MemoryManager<DNekScalMat>::AllocateSharedPtr(one,Asubmat = mat->GetBlock(0,1)));
1501  returnval->SetBlock(1,0,Atmp = MemoryManager<DNekScalMat>::AllocateSharedPtr(factor,Asubmat = mat->GetBlock(1,0)));
1502  returnval->SetBlock(1,1,Atmp = MemoryManager<DNekScalMat>::AllocateSharedPtr(invfactor,Asubmat = mat->GetBlock(1,1)));
1503  }
1504  break;
1505  UseLocRegionsMatrix:
1506  {
1507  int i,j;
1508  NekDouble invfactor = 1.0/factor;
1509  NekDouble one = 1.0;
1510  DNekScalMat &mat = *GetLocMatrix(mkey);
1515 
1516  Array<OneD,unsigned int> bmap(nbdry);
1517  Array<OneD,unsigned int> imap(nint);
1518  GetBoundaryMap(bmap);
1519  GetInteriorMap(imap);
1520 
1521  for(i = 0; i < nbdry; ++i)
1522  {
1523  for(j = 0; j < nbdry; ++j)
1524  {
1525  (*A)(i,j) = mat(bmap[i],bmap[j]);
1526  }
1527 
1528  for(j = 0; j < nint; ++j)
1529  {
1530  (*B)(i,j) = mat(bmap[i],imap[j]);
1531  }
1532  }
1533 
1534  for(i = 0; i < nint; ++i)
1535  {
1536  for(j = 0; j < nbdry; ++j)
1537  {
1538  (*C)(i,j) = mat(imap[i],bmap[j]);
1539  }
1540 
1541  for(j = 0; j < nint; ++j)
1542  {
1543  (*D)(i,j) = mat(imap[i],imap[j]);
1544  }
1545  }
1546 
1547  // Calculate static condensed system
1548  if(nint)
1549  {
1550  D->Invert();
1551  (*B) = (*B)*(*D);
1552  (*A) = (*A) - (*B)*(*C);
1553  }
1554 
1555  DNekScalMatSharedPtr Atmp;
1556 
1557  returnval->SetBlock(0,0,Atmp = MemoryManager<DNekScalMat>::AllocateSharedPtr(factor,A));
1558  returnval->SetBlock(0,1,Atmp = MemoryManager<DNekScalMat>::AllocateSharedPtr(one,B));
1559  returnval->SetBlock(1,0,Atmp = MemoryManager<DNekScalMat>::AllocateSharedPtr(factor,C));
1560  returnval->SetBlock(1,1,Atmp = MemoryManager<DNekScalMat>::AllocateSharedPtr(invfactor,D));
1561 
1562  }
1563  break;
1564  }
1565  return returnval;
1566  }
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition: Expansion.cpp:90
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:687
DNekBlkMatSharedPtr GetStdStaticCondMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:622
void GetInteriorMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:692
std::shared_ptr< DNekBlkMat > DNekBlkMatSharedPtr
Definition: NekTypeDefs.hpp:71

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL2, Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::eHelmholtz, Nektar::StdRegions::eLaplacian, Nektar::SpatialDomains::eNoGeomType, Nektar::StdRegions::StdExpansion::GetBoundaryMap(), Nektar::StdRegions::StdExpansion::GetInteriorMap(), Nektar::LocalRegions::Expansion::GetLocMatrix(), Nektar::StdRegions::StdMatrixKey::GetMatrixType(), Nektar::StdRegions::StdExpansion::GetStdStaticCondMatrix(), Nektar::LocalRegions::Expansion::m_metricinfo, Nektar::StdRegions::StdExpansion::m_ncoeffs, and Nektar::StdRegions::StdExpansion::NumBndryCoeffs().

◆ v_AlignVectorToCollapsedDir()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 403 of file PrismExp.cpp.

407  {
408  const int nquad0 = m_base[0]->GetNumPoints();
409  const int nquad1 = m_base[1]->GetNumPoints();
410  const int nquad2 = m_base[2]->GetNumPoints();
411  const int order0 = m_base[0]->GetNumModes ();
412  const int order1 = m_base[1]->GetNumModes ();
413  const int nqtot = nquad0*nquad1*nquad2;
414 
415  const Array<OneD, const NekDouble> &z0 = m_base[0]->GetZ();
416  const Array<OneD, const NekDouble> &z2 = m_base[2]->GetZ();
417 
418  Array<OneD, NekDouble> gfac0(nquad0 );
419  Array<OneD, NekDouble> gfac2(nquad2 );
420  Array<OneD, NekDouble> tmp1 (nqtot );
421  Array<OneD, NekDouble> tmp5 (nqtot );
422  Array<OneD, NekDouble> tmp6 (m_ncoeffs);
423  Array<OneD, NekDouble> wsp (order0*nquad2*(nquad1+order1));
424 
425  Array<OneD, NekDouble> tmp2 = outarray[0];
426  Array<OneD, NekDouble> tmp3 = outarray[1];
427  Array<OneD, NekDouble> tmp4 = outarray[2];
428 
429 
430  const Array<TwoD, const NekDouble>& df =
431  m_metricinfo->GetDerivFactors(GetPointsKeys());
432 
433  Vmath::Vcopy(nqtot,inarray,1,tmp1,1); // Dir3 metric
434 
435  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
436  {
437  Vmath::Vmul(nqtot,&df[3*dir][0], 1,tmp1.get(),1,tmp2.get(),1);
438  Vmath::Vmul(nqtot,&df[3*dir+1][0],1,tmp1.get(),1,tmp3.get(),1);
439  Vmath::Vmul(nqtot,&df[3*dir+2][0],1,tmp1.get(),1,tmp4.get(),1);
440  }
441  else
442  {
443  Vmath::Smul(nqtot, df[3*dir][0], tmp1.get(),1,tmp2.get(), 1);
444  Vmath::Smul(nqtot, df[3*dir+1][0],tmp1.get(),1,tmp3.get(), 1);
445  Vmath::Smul(nqtot, df[3*dir+2][0],tmp1.get(),1,tmp4.get(), 1);
446  }
447 
448  // set up geometric factor: (1+z0)/2
449  for (int i = 0; i < nquad0; ++i)
450  {
451  gfac0[i] = 0.5*(1+z0[i]);
452  }
453 
454  // Set up geometric factor: 2/(1-z2)
455  for (int i = 0; i < nquad2; ++i)
456  {
457  gfac2[i] = 2.0/(1-z2[i]);
458  }
459 
460  const int nq01 = nquad0*nquad1;
461 
462  for (int i = 0; i < nquad2; ++i)
463  {
464  Vmath::Smul(nq01,gfac2[i],&tmp2[0]+i*nq01,1,&tmp2[0]+i*nq01,1);
465  Vmath::Smul(nq01,gfac2[i],&tmp4[0]+i*nq01,1,&tmp5[0]+i*nq01,1);
466  }
467 
468  for (int i = 0; i < nquad1*nquad2; ++i)
469  {
470  Vmath::Vmul(nquad0,&gfac0[0],1,&tmp5[0]+i*nquad0,1,
471  &tmp5[0]+i*nquad0,1);
472  }
473 
474  Vmath::Vadd(nqtot, &tmp2[0], 1, &tmp5[0], 1, &tmp2[0], 1);
475  }
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:192
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:322
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.cpp:225
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1199

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

Referenced by v_IProductWRTDerivBase_SumFac().

◆ v_ComputeTraceNormal()

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

Get the normals along specficied face Get the face normals interplated to a points0 x points 0 type distribution.

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 734 of file PrismExp.cpp.

735  {
736  const SpatialDomains::GeomFactorsSharedPtr &geomFactors =
737  GetGeom()->GetMetricInfo();
738 
740  for(int i = 0; i < ptsKeys.size(); ++i)
741  {
742  // Need at least 2 points for computing normals
743  if (ptsKeys[i].GetNumPoints() == 1)
744  {
745  LibUtilities::PointsKey pKey(2, ptsKeys[i].GetPointsType());
746  ptsKeys[i] = pKey;
747  }
748  }
749 
750  SpatialDomains::GeomType type = geomFactors->GetGtype();
751  const Array<TwoD, const NekDouble> &df = geomFactors->GetDerivFactors(ptsKeys);
752  const Array<OneD, const NekDouble> &jac = geomFactors->GetJac(ptsKeys);
753 
754  int nq0 = ptsKeys[0].GetNumPoints();
755  int nq1 = ptsKeys[1].GetNumPoints();
756  int nq2 = ptsKeys[2].GetNumPoints();
757  int nq01 = nq0*nq1;
758  int nqtot;
759 
760 
761  LibUtilities::BasisKey tobasis0 = GetTraceBasisKey(face,0);
762  LibUtilities::BasisKey tobasis1 = GetTraceBasisKey(face,1);
763 
764  // Number of quadrature points in face expansion.
765  int nq_face = tobasis0.GetNumPoints()*tobasis1.GetNumPoints();
766 
767  int vCoordDim = GetCoordim();
768  int i;
769 
770  m_faceNormals[face] = Array<OneD, Array<OneD, NekDouble> >(vCoordDim);
771  Array<OneD, Array<OneD, NekDouble> > &normal = m_faceNormals[face];
772  for (i = 0; i < vCoordDim; ++i)
773  {
774  normal[i] = Array<OneD, NekDouble>(nq_face);
775  }
776 
777  size_t nqb = nq_face;
778  size_t nbnd= face;
779  m_elmtBndNormDirElmtLen[nbnd] = Array<OneD, NekDouble> {nqb, 0.0};
780  Array<OneD, NekDouble> &length = m_elmtBndNormDirElmtLen[nbnd];
781 
782  // Regular geometry case
783  if (type == SpatialDomains::eRegular ||
785  {
786  NekDouble fac;
787  // Set up normals
788  switch(face)
789  {
790  case 0:
791  {
792  for(i = 0; i < vCoordDim; ++i)
793  {
794  normal[i][0] = -df[3*i+2][0];;
795  }
796  break;
797  }
798  case 1:
799  {
800  for(i = 0; i < vCoordDim; ++i)
801  {
802  normal[i][0] = -df[3*i+1][0];
803  }
804  break;
805  }
806  case 2:
807  {
808  for(i = 0; i < vCoordDim; ++i)
809  {
810  normal[i][0] = df[3*i][0]+df[3*i+2][0];
811  }
812  break;
813  }
814  case 3:
815  {
816  for(i = 0; i < vCoordDim; ++i)
817  {
818  normal[i][0] = df[3*i+1][0];
819  }
820  break;
821  }
822  case 4:
823  {
824  for(i = 0; i < vCoordDim; ++i)
825  {
826  normal[i][0] = -df[3*i][0];
827  }
828  break;
829  }
830  default:
831  ASSERTL0(false,"face is out of range (face < 4)");
832  }
833 
834  // Normalise resulting vector.
835  fac = 0.0;
836  for(i = 0; i < vCoordDim; ++i)
837  {
838  fac += normal[i][0]*normal[i][0];
839  }
840  fac = 1.0/sqrt(fac);
841 
842  Vmath::Fill(nqb, fac, length, 1);
843 
844  for (i = 0; i < vCoordDim; ++i)
845  {
846  Vmath::Fill(nq_face,fac*normal[i][0],normal[i],1);
847  }
848  }
849  else
850  {
851  // Set up deformed normals.
852  int j, k;
853 
854  // Determine number of quadrature points on the face of 3D elmt
855  if (face == 0)
856  {
857  nqtot = nq0*nq1;
858  }
859  else if (face == 1 || face == 3)
860  {
861  nqtot = nq0*nq2;
862  }
863  else
864  {
865  nqtot = nq1*nq2;
866  }
867 
868  LibUtilities::PointsKey points0;
869  LibUtilities::PointsKey points1;
870 
871  Array<OneD, NekDouble> faceJac(nqtot);
872  Array<OneD, NekDouble> normals(vCoordDim*nqtot,0.0);
873 
874  // Extract Jacobian along face and recover local derivatives
875  // (dx/dr) for polynomial interpolation by multiplying m_gmat by
876  // jacobian
877  switch(face)
878  {
879  case 0:
880  {
881  for(j = 0; j < nq01; ++j)
882  {
883  normals[j] = -df[2][j]*jac[j];
884  normals[nqtot+j] = -df[5][j]*jac[j];
885  normals[2*nqtot+j] = -df[8][j]*jac[j];
886  faceJac[j] = jac[j];
887  }
888 
889  points0 = ptsKeys[0];
890  points1 = ptsKeys[1];
891  break;
892  }
893 
894  case 1:
895  {
896  for (j = 0; j < nq0; ++j)
897  {
898  for(k = 0; k < nq2; ++k)
899  {
900  int tmp = j+nq01*k;
901  normals[j+k*nq0] =
902  -df[1][tmp]*jac[tmp];
903  normals[nqtot+j+k*nq0] =
904  -df[4][tmp]*jac[tmp];
905  normals[2*nqtot+j+k*nq0] =
906  -df[7][tmp]*jac[tmp];
907  faceJac[j+k*nq0] = jac[tmp];
908  }
909  }
910 
911  points0 = ptsKeys[0];
912  points1 = ptsKeys[2];
913  break;
914  }
915 
916  case 2:
917  {
918  for (j = 0; j < nq1; ++j)
919  {
920  for(k = 0; k < nq2; ++k)
921  {
922  int tmp = nq0-1+nq0*j+nq01*k;
923  normals[j+k*nq1] =
924  (df[0][tmp]+df[2][tmp])*jac[tmp];
925  normals[nqtot+j+k*nq1] =
926  (df[3][tmp]+df[5][tmp])*jac[tmp];
927  normals[2*nqtot+j+k*nq1] =
928  (df[6][tmp]+df[8][tmp])*jac[tmp];
929  faceJac[j+k*nq1] = jac[tmp];
930  }
931  }
932 
933  points0 = ptsKeys[1];
934  points1 = ptsKeys[2];
935  break;
936  }
937 
938  case 3:
939  {
940  for (j = 0; j < nq0; ++j)
941  {
942  for(k = 0; k < nq2; ++k)
943  {
944  int tmp = nq0*(nq1-1) + j + nq01*k;
945  normals[j+k*nq0] =
946  df[1][tmp]*jac[tmp];
947  normals[nqtot+j+k*nq0] =
948  df[4][tmp]*jac[tmp];
949  normals[2*nqtot+j+k*nq0] =
950  df[7][tmp]*jac[tmp];
951  faceJac[j+k*nq0] = jac[tmp];
952  }
953  }
954 
955  points0 = ptsKeys[0];
956  points1 = ptsKeys[2];
957  break;
958  }
959 
960  case 4:
961  {
962  for (j = 0; j < nq1; ++j)
963  {
964  for(k = 0; k < nq2; ++k)
965  {
966  int tmp = j*nq0+nq01*k;
967  normals[j+k*nq1] =
968  -df[0][tmp]*jac[tmp];
969  normals[nqtot+j+k*nq1] =
970  -df[3][tmp]*jac[tmp];
971  normals[2*nqtot+j+k*nq1] =
972  -df[6][tmp]*jac[tmp];
973  faceJac[j+k*nq1] = jac[tmp];
974  }
975  }
976 
977  points0 = ptsKeys[1];
978  points1 = ptsKeys[2];
979  break;
980  }
981 
982  default:
983  ASSERTL0(false,"face is out of range (face < 4)");
984  }
985 
986 
987  Array<OneD, NekDouble> work (nq_face, 0.0);
988  // Interpolate Jacobian and invert
989  LibUtilities::Interp2D(points0, points1, faceJac,
990  tobasis0.GetPointsKey(),
991  tobasis1.GetPointsKey(),
992  work);
993  Vmath::Sdiv(nq_face, 1.0, &work[0], 1, &work[0], 1);
994 
995  // Interpolate normal and multiply by inverse Jacobian.
996  for(i = 0; i < vCoordDim; ++i)
997  {
998  LibUtilities::Interp2D(points0, points1,
999  &normals[i*nqtot],
1000  tobasis0.GetPointsKey(),
1001  tobasis1.GetPointsKey(),
1002  &normal[i][0]);
1003  Vmath::Vmul(nq_face,work,1,normal[i],1,normal[i],1);
1004  }
1005 
1006  // Normalise to obtain unit normals.
1007  Vmath::Zero(nq_face,work,1);
1008  for(i = 0; i < GetCoordim(); ++i)
1009  {
1010  Vmath::Vvtvp(nq_face,normal[i],1,normal[i],1,work,1,work,1);
1011  }
1012 
1013  Vmath::Vsqrt(nq_face,work,1,work,1);
1014  Vmath::Sdiv (nq_face,1.0,work,1,work,1);
1015 
1016  Vmath::Vcopy(nqb, work, 1, length, 1);
1017 
1018  for(i = 0; i < GetCoordim(); ++i)
1019  {
1020  Vmath::Vmul(nq_face,normal[i],1,work,1,normal[i],1);
1021  }
1022  }
1023  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
std::map< int, NormalVector > m_faceNormals
Definition: Expansion3D.h:123
std::map< int, Array< OneD, NekDouble > > m_elmtBndNormDirElmtLen
the element length in each element boundary(Vertex, edge or face) normal direction calculated based o...
Definition: Expansion.h:284
SpatialDomains::GeometrySharedPtr GetGeom() const
Definition: Expansion.cpp:172
const LibUtilities::BasisKey GetTraceBasisKey(const int i, int k=-1) const
This function returns the basis key belonging to the i-th trace.
Definition: StdExpansion.h:304
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
Definition: StdExpansion.h:208
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:221
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis,...
Definition: Interp.cpp:115
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition: GeomFactors.h:62
GeomType
Indicates the type of element geometry.
@ eRegular
Geometry is straight-sided with constant geometric factors.
@ eMovingRegular
Currently unused.
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
Definition: Vmath.cpp:475
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:513
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/y.
Definition: Vmath.cpp:291
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:436
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:45
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:267

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

◆ v_CreateStdMatrix()

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

Reimplemented from Nektar::StdRegions::StdPrismExp.

Definition at line 1138 of file PrismExp.cpp.

1139  {
1140  LibUtilities::BasisKey bkey0 = m_base[0]->GetBasisKey();
1141  LibUtilities::BasisKey bkey1 = m_base[1]->GetBasisKey();
1142  LibUtilities::BasisKey bkey2 = m_base[2]->GetBasisKey();
1144  MemoryManager<StdPrismExp>::AllocateSharedPtr(bkey0, bkey1, bkey2);
1145 
1146  return tmp->GetStdMatrix(mkey);
1147  }
std::shared_ptr< StdPrismExp > StdPrismExpSharedPtr
Definition: StdPrismExp.h:263

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

◆ v_DropLocStaticCondMatrix()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1159 of file PrismExp.cpp.

1160  {
1161  m_staticCondMatrixManager.DeleteObject(mkey);
1162  }

References m_staticCondMatrixManager.

◆ v_ExtractDataToCoeffs()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 567 of file PrismExp.cpp.

573  {
574  boost::ignore_unused(fromType);
575 
576  int data_order0 = nummodes[mode_offset];
577  int fillorder0 = min(m_base[0]->GetNumModes(),data_order0);
578  int data_order1 = nummodes[mode_offset+1];
579  int order1 = m_base[1]->GetNumModes();
580  int fillorder1 = min(order1,data_order1);
581  int data_order2 = nummodes[mode_offset+2];
582  int order2 = m_base[2]->GetNumModes();
583  int fillorder2 = min(order2,data_order2);
584 
585  switch(m_base[0]->GetBasisType())
586  {
588  {
589  int i,j;
590  int cnt = 0;
591  int cnt1 = 0;
592 
593  ASSERTL1(m_base[1]->GetBasisType() ==
595  "Extraction routine not set up for this basis");
596  ASSERTL1(m_base[2]->GetBasisType() ==
598  "Extraction routine not set up for this basis");
599 
600  Vmath::Zero(m_ncoeffs,coeffs,1);
601  for(j = 0; j < fillorder0; ++j)
602  {
603  for(i = 0; i < fillorder1; ++i)
604  {
605  Vmath::Vcopy(fillorder2-j, &data[cnt], 1,
606  &coeffs[cnt1], 1);
607  cnt += data_order2-j;
608  cnt1 += order2-j;
609  }
610 
611  // count out data for j iteration
612  for(i = fillorder1; i < data_order1; ++i)
613  {
614  cnt += data_order2-j;
615  }
616 
617  for(i = fillorder1; i < order1; ++i)
618  {
619  cnt1 += order2-j;
620  }
621  }
622  }
623  break;
624  default:
625  ASSERTL0(false, "basis is either not set up or not "
626  "hierarchicial");
627  }
628  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:250
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:158
@ eModified_B
Principle Modified Functions .
Definition: BasisType.h:49
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:48

References ASSERTL0, ASSERTL1, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, Vmath::Vcopy(), and Vmath::Zero().

◆ v_FwdTrans()

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

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

Inputs:

  • inarray: array of physical quadrature points to be transformed

Outputs:

  • (this)->_coeffs: updated array of expansion coefficients.

Reimplemented from Nektar::StdRegions::StdPrismExp.

Definition at line 217 of file PrismExp.cpp.

219  {
220  if(m_base[0]->Collocation() &&
221  m_base[1]->Collocation() &&
222  m_base[2]->Collocation())
223  {
224  Vmath::Vcopy(GetNcoeffs(),&inarray[0],1,&outarray[0],1);
225  }
226  else
227  {
228  v_IProductWRTBase(inarray, outarray);
229 
230  // get Mass matrix inverse
231  MatrixKey masskey(StdRegions::eInvMass,
232  DetShapeType(),*this);
233  DNekScalMatSharedPtr matsys = m_matrixManager[masskey];
234 
235  // copy inarray in case inarray == outarray
236  DNekVec in (m_ncoeffs,outarray);
237  DNekVec out(m_ncoeffs,outarray,eWrapper);
238 
239  out = (*matsys)*in;
240  }
241  }
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculate the inner product of inarray with respect to the basis B=base0*base1*base2 and put into out...
Definition: PrismExp.cpp:272
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:124
NekVector< NekDouble > DNekVec
Definition: NekTypeDefs.hpp:48

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

◆ v_GeneralMatrixOp_MatOp()

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

Definition at line 1059 of file PrismExp.cpp.

1063  {
1064  DNekScalMatSharedPtr mat = GetLocMatrix(mkey);
1065 
1066  if(inarray.get() == outarray.get())
1067  {
1068  Array<OneD,NekDouble> tmp(m_ncoeffs);
1069  Vmath::Vcopy(m_ncoeffs,inarray.get(),1,tmp.get(),1);
1070 
1071  Blas::Dgemv('N',m_ncoeffs,m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1072  m_ncoeffs, tmp.get(), 1, 0.0, outarray.get(), 1);
1073  }
1074  else
1075  {
1076  Blas::Dgemv('N',m_ncoeffs,m_ncoeffs,mat->Scale(),(mat->GetOwnedMatrix())->GetPtr().get(),
1077  m_ncoeffs, inarray.get(), 1, 0.0, outarray.get(), 1);
1078  }
1079  }
static void Dgemv(const char &trans, const int &m, const int &n, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
BLAS level 2: Matrix vector multiply y = A x where A[m x n].
Definition: Blas.hpp:265

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

◆ v_GenMatrix()

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

Reimplemented from Nektar::StdRegions::StdPrismExp.

Definition at line 1115 of file PrismExp.cpp.

1116  {
1117  DNekMatSharedPtr returnval;
1118 
1119  switch(mkey.GetMatrixType())
1120  {
1128  returnval = Expansion3D::v_GenMatrix(mkey);
1129  break;
1130  default:
1131  returnval = StdPrismExp::v_GenMatrix(mkey);
1132  break;
1133  }
1134 
1135  return returnval;
1136  }
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)

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

◆ v_GetCoord()

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

Get the coordinates #coords at the local coordinates #Lcoords.

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 506 of file PrismExp.cpp.

508  {
509  int i;
510 
511  ASSERTL1(Lcoords[0] <= -1.0 && Lcoords[0] >= 1.0 &&
512  Lcoords[1] <= -1.0 && Lcoords[1] >= 1.0 &&
513  Lcoords[2] <= -1.0 && Lcoords[2] >= 1.0,
514  "Local coordinates are not in region [-1,1]");
515 
516  m_geom->FillGeom();
517 
518  for(i = 0; i < m_geom->GetCoordim(); ++i)
519  {
520  coords[i] = m_geom->GetCoord(i,Lcoords);
521  }
522  }
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:272

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

◆ v_GetCoordim()

int Nektar::LocalRegions::PrismExp::v_GetCoordim ( void  )
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion3D.

Definition at line 562 of file PrismExp.cpp.

563  {
564  return m_geom->GetCoordim();
565  }

References Nektar::LocalRegions::Expansion::m_geom.

◆ v_GetCoords()

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

Reimplemented from Nektar::StdRegions::StdPrismExp.

Definition at line 524 of file PrismExp.cpp.

528  {
529  Expansion::v_GetCoords(coords_0, coords_1, coords_2);
530  }
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: Expansion.cpp:318

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

◆ v_GetLinStdExp()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 489 of file PrismExp.cpp.

490  {
491  LibUtilities::BasisKey bkey0(m_base[0]->GetBasisType(),
492  2, m_base[0]->GetPointsKey());
493  LibUtilities::BasisKey bkey1(m_base[1]->GetBasisType(),
494  2, m_base[1]->GetPointsKey());
495  LibUtilities::BasisKey bkey2(m_base[2]->GetBasisType(),
496  2, m_base[2]->GetPointsKey());
497 
499  ::AllocateSharedPtr( bkey0, bkey1, bkey2);
500  }

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

◆ v_GetLocMatrix()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1149 of file PrismExp.cpp.

1150  {
1151  return m_matrixManager[mkey];
1152  }

References m_matrixManager.

◆ v_GetLocStaticCondMatrix()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1154 of file PrismExp.cpp.

1155  {
1156  return m_staticCondMatrixManager[mkey];
1157  }

References m_staticCondMatrixManager.

◆ v_GetSimplexEquiSpacedConnectivity()

void Nektar::LocalRegions::PrismExp::v_GetSimplexEquiSpacedConnectivity ( Array< OneD, int > &  conn,
bool  standard = true 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1743 of file PrismExp.cpp.

1746  {
1747  boost::ignore_unused(oldstandard);
1748 
1749  int np0 = m_base[0]->GetNumPoints();
1750  int np1 = m_base[1]->GetNumPoints();
1751  int np2 = m_base[2]->GetNumPoints();
1752  int np = max(np0,max(np1,np2));
1753  Array<OneD, int> prismpt(6);
1754  bool standard = true;
1755 
1756  int vid0 = m_geom->GetVid(0);
1757  int vid1 = m_geom->GetVid(1);
1758  int vid2 = m_geom->GetVid(4);
1759  int rotate = 0;
1760 
1761  // sort out prism rotation according to
1762  if((vid2 < vid1)&&(vid2 < vid0)) // top triangle vertex is lowest id
1763  {
1764  rotate = 0;
1765  if(vid0 > vid1)
1766  {
1767  standard = false;// reverse base direction
1768  }
1769  }
1770  else if((vid1 < vid2)&&(vid1 < vid0))
1771  {
1772  rotate = 1;
1773  if(vid2 > vid0)
1774  {
1775  standard = false;// reverse base direction
1776  }
1777  }
1778  else if ((vid0 < vid2)&&(vid0 < vid1))
1779  {
1780  rotate = 2;
1781  if(vid1 > vid2)
1782  {
1783  standard = false; // reverse base direction
1784  }
1785  }
1786 
1787  conn = Array<OneD, int>(12*(np-1)*(np-1)*(np-1));
1788 
1789  int row = 0;
1790  int rowp1 = 0;
1791  int plane = 0;
1792  int row1 = 0;
1793  int row1p1 = 0;
1794  int planep1 = 0;
1795  int cnt = 0;
1796 
1797 
1798  Array<OneD, int> rot(3);
1799 
1800  rot[0] = (0+rotate)%3;
1801  rot[1] = (1+rotate)%3;
1802  rot[2] = (2+rotate)%3;
1803 
1804  // lower diagonal along 1-3 on base
1805  for(int i = 0; i < np-1; ++i)
1806  {
1807  planep1 += (np-i)*np;
1808  row = 0; // current plane row offset
1809  rowp1 = 0; // current plane row plus one offset
1810  row1 = 0; // next plane row offset
1811  row1p1 = 0; // nex plane row plus one offset
1812  if(standard == false)
1813  {
1814  for(int j = 0; j < np-1; ++j)
1815  {
1816  rowp1 += np-i;
1817  row1p1 += np-i-1;
1818  for(int k = 0; k < np-i-2; ++k)
1819  {
1820  // bottom prism block
1821  prismpt[rot[0]] = plane + row + k;
1822  prismpt[rot[1]] = plane + row + k+1;
1823  prismpt[rot[2]] = planep1 + row1 + k;
1824 
1825  prismpt[3+rot[0]] = plane + rowp1 + k;
1826  prismpt[3+rot[1]] = plane + rowp1 + k+1;
1827  prismpt[3+rot[2]] = planep1 + row1p1 + k;
1828 
1829  conn[cnt++] = prismpt[0];
1830  conn[cnt++] = prismpt[1];
1831  conn[cnt++] = prismpt[3];
1832  conn[cnt++] = prismpt[2];
1833 
1834  conn[cnt++] = prismpt[5];
1835  conn[cnt++] = prismpt[2];
1836  conn[cnt++] = prismpt[3];
1837  conn[cnt++] = prismpt[4];
1838 
1839  conn[cnt++] = prismpt[3];
1840  conn[cnt++] = prismpt[1];
1841  conn[cnt++] = prismpt[4];
1842  conn[cnt++] = prismpt[2];
1843 
1844  // upper prism block.
1845  prismpt[rot[0]] = planep1 + row1 + k+1;
1846  prismpt[rot[1]] = planep1 + row1 + k;
1847  prismpt[rot[2]] = plane + row + k+1;
1848 
1849  prismpt[3+rot[0]] = planep1 + row1p1 + k+1;
1850  prismpt[3+rot[1]] = planep1 + row1p1 + k;
1851  prismpt[3+rot[2]] = plane + rowp1 + k+1;
1852 
1853 
1854  conn[cnt++] = prismpt[0];
1855  conn[cnt++] = prismpt[1];
1856  conn[cnt++] = prismpt[2];
1857  conn[cnt++] = prismpt[5];
1858 
1859  conn[cnt++] = prismpt[5];
1860  conn[cnt++] = prismpt[0];
1861  conn[cnt++] = prismpt[4];
1862  conn[cnt++] = prismpt[1];
1863 
1864  conn[cnt++] = prismpt[3];
1865  conn[cnt++] = prismpt[4];
1866  conn[cnt++] = prismpt[0];
1867  conn[cnt++] = prismpt[5];
1868 
1869  }
1870 
1871  // bottom prism block
1872  prismpt[rot[0]] = plane + row + np-i-2;
1873  prismpt[rot[1]] = plane + row + np-i-1;
1874  prismpt[rot[2]] = planep1 + row1 + np-i-2;
1875 
1876  prismpt[3+rot[0]] = plane + rowp1 + np-i-2;
1877  prismpt[3+rot[1]] = plane + rowp1 + np-i-1;
1878  prismpt[3+rot[2]] = planep1 + row1p1 + np-i-2;
1879 
1880  conn[cnt++] = prismpt[0];
1881  conn[cnt++] = prismpt[1];
1882  conn[cnt++] = prismpt[3];
1883  conn[cnt++] = prismpt[2];
1884 
1885  conn[cnt++] = prismpt[5];
1886  conn[cnt++] = prismpt[2];
1887  conn[cnt++] = prismpt[3];
1888  conn[cnt++] = prismpt[4];
1889 
1890  conn[cnt++] = prismpt[3];
1891  conn[cnt++] = prismpt[1];
1892  conn[cnt++] = prismpt[4];
1893  conn[cnt++] = prismpt[2];
1894 
1895  row += np-i;
1896  row1 += np-i-1;
1897  }
1898 
1899  }
1900  else
1901  { // lower diagonal along 0-4 on base
1902  for(int j = 0; j < np-1; ++j)
1903  {
1904  rowp1 += np-i;
1905  row1p1 += np-i-1;
1906  for(int k = 0; k < np-i-2; ++k)
1907  {
1908  // bottom prism block
1909  prismpt[rot[0]] = plane + row + k;
1910  prismpt[rot[1]] = plane + row + k+1;
1911  prismpt[rot[2]] = planep1 + row1 + k;
1912 
1913  prismpt[3+rot[0]] = plane + rowp1 + k;
1914  prismpt[3+rot[1]] = plane + rowp1 + k+1;
1915  prismpt[3+rot[2]] = planep1 + row1p1 + k;
1916 
1917  conn[cnt++] = prismpt[0];
1918  conn[cnt++] = prismpt[1];
1919  conn[cnt++] = prismpt[4];
1920  conn[cnt++] = prismpt[2];
1921 
1922  conn[cnt++] = prismpt[4];
1923  conn[cnt++] = prismpt[3];
1924  conn[cnt++] = prismpt[0];
1925  conn[cnt++] = prismpt[2];
1926 
1927  conn[cnt++] = prismpt[3];
1928  conn[cnt++] = prismpt[4];
1929  conn[cnt++] = prismpt[5];
1930  conn[cnt++] = prismpt[2];
1931 
1932  // upper prism block.
1933  prismpt[rot[0]] = planep1 + row1 + k+1;
1934  prismpt[rot[1]] = planep1 + row1 + k;
1935  prismpt[rot[2]] = plane + row + k+1;
1936 
1937  prismpt[3+rot[0]] = planep1 + row1p1 + k+1;
1938  prismpt[3+rot[1]] = planep1 + row1p1 + k;
1939  prismpt[3+rot[2]] = plane + rowp1 + k+1;
1940 
1941  conn[cnt++] = prismpt[0];
1942  conn[cnt++] = prismpt[2];
1943  conn[cnt++] = prismpt[1];
1944  conn[cnt++] = prismpt[5];
1945 
1946  conn[cnt++] = prismpt[3];
1947  conn[cnt++] = prismpt[5];
1948  conn[cnt++] = prismpt[0];
1949  conn[cnt++] = prismpt[1];
1950 
1951  conn[cnt++] = prismpt[5];
1952  conn[cnt++] = prismpt[3];
1953  conn[cnt++] = prismpt[4];
1954  conn[cnt++] = prismpt[1];
1955  }
1956 
1957  // bottom prism block
1958  prismpt[rot[0]] = plane + row + np-i-2;
1959  prismpt[rot[1]] = plane + row + np-i-1;
1960  prismpt[rot[2]] = planep1 + row1 + np-i-2;
1961 
1962  prismpt[3+rot[0]] = plane + rowp1 + np-i-2;
1963  prismpt[3+rot[1]] = plane + rowp1 + np-i-1;
1964  prismpt[3+rot[2]] = planep1 + row1p1 + np-i-2;
1965 
1966  conn[cnt++] = prismpt[0];
1967  conn[cnt++] = prismpt[1];
1968  conn[cnt++] = prismpt[4];
1969  conn[cnt++] = prismpt[2];
1970 
1971  conn[cnt++] = prismpt[4];
1972  conn[cnt++] = prismpt[3];
1973  conn[cnt++] = prismpt[0];
1974  conn[cnt++] = prismpt[2];
1975 
1976  conn[cnt++] = prismpt[3];
1977  conn[cnt++] = prismpt[4];
1978  conn[cnt++] = prismpt[5];
1979  conn[cnt++] = prismpt[2];
1980 
1981  row += np-i;
1982  row1 += np-i-1;
1983  }
1984 
1985  }
1986  plane += (np-i)*np;
1987  }
1988  }

References Nektar::StdRegions::StdExpansion::m_base, and Nektar::LocalRegions::Expansion::m_geom.

◆ v_GetStdExp()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 481 of file PrismExp.cpp.

482  {
484  ::AllocateSharedPtr(m_base[0]->GetBasisKey(),
485  m_base[1]->GetBasisKey(),
486  m_base[2]->GetBasisKey());
487  }

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

◆ v_GetTracePhysMap()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 630 of file PrismExp.cpp.

632  {
633  int nquad0 = m_base[0]->GetNumPoints();
634  int nquad1 = m_base[1]->GetNumPoints();
635  int nquad2 = m_base[2]->GetNumPoints();
636  int nq0 = 0;
637  int nq1 = 0;
638 
639  switch(face)
640  {
641  case 0:
642  nq0 = nquad0;
643  nq1 = nquad1;
644  if(outarray.size()!=nq0*nq1)
645  {
646  outarray = Array<OneD, int>(nq0*nq1);
647  }
648 
649  //Directions A and B positive
650  for(int i = 0; i < nquad0*nquad1; ++i)
651  {
652  outarray[i] = i;
653  }
654  break;
655  case 1:
656 
657  nq0 = nquad0;
658  nq1 = nquad2;
659  if(outarray.size()!=nq0*nq1)
660  {
661  outarray = Array<OneD, int>(nq0*nq1);
662  }
663 
664  //Direction A and B positive
665  for (int k=0; k<nquad2; k++)
666  {
667  for(int i = 0; i < nquad0; ++i)
668  {
669  outarray[k*nquad0+i] = (nquad0*nquad1*k)+i;
670  }
671  }
672 
673  break;
674  case 2:
675 
676  nq0 = nquad1;
677  nq1 = nquad2;
678  if(outarray.size()!=nq0*nq1)
679  {
680  outarray = Array<OneD, int>(nq0*nq1);
681  }
682 
683  //Directions A and B positive
684  for(int j = 0; j < nquad1*nquad2; ++j)
685  {
686  outarray[j] = nquad0-1 + j*nquad0;
687 
688  }
689  break;
690  case 3:
691  nq0 = nquad0;
692  nq1 = nquad2;
693  if(outarray.size()!=nq0*nq1)
694  {
695  outarray = Array<OneD, int>(nq0*nq1);
696  }
697 
698  //Direction A and B positive
699  for (int k=0; k<nquad2; k++)
700  {
701  for(int i = 0; i < nquad0; ++i)
702  {
703  outarray[k*nquad0+i] = nquad0*(nquad1-1) + (nquad0*nquad1*k)+i;
704  }
705  }
706  break;
707  case 4:
708 
709  nq0 = nquad1;
710  nq1 = nquad2;
711  if(outarray.size()!=nq0*nq1)
712  {
713  outarray = Array<OneD, int>(nq0*nq1);
714  }
715 
716  //Directions A and B positive
717  for(int j = 0; j < nquad1*nquad2; ++j)
718  {
719  outarray[j] = j*nquad0;
720 
721  }
722  break;
723  default:
724  ASSERTL0(false,"face value (> 4) is out of range");
725  break;
726  }
727 
728  }

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

◆ v_HelmholtzMatrixOp()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1051 of file PrismExp.cpp.

1055  {
1056  PrismExp::v_HelmholtzMatrixOp_MatFree(inarray,outarray,mkey);
1057  }
virtual void v_HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)

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

◆ v_Integral()

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

Integrate the physical point list inarray over prismatic region and return the value.

Inputs:

  • inarray: definition of function to be returned at quadrature point of expansion.

Outputs:

  • returns \(\int^1_{-1}\int^1_{-1}\int^1_{-1} u(\bar \eta_1, \xi_2, \xi_3) J[i,j,k] d \bar \eta_1 d \xi_2 d \xi_3 \)
    \( = \sum_{i=0}^{Q_1 - 1} \sum_{j=0}^{Q_2 - 1} \sum_{k=0}^{Q_3 - 1} u(\bar \eta_{1i}^{0,0}, \xi_{2j}^{0,0},\xi_{3k}^{1,0})w_{i}^{0,0} w_{j}^{0,0} \hat w_{k}^{1,0} \)
    where \( inarray[i,j, k] = u(\bar \eta_{1i}^{0,0}, \xi_{2j}^{0,0},\xi_{3k}^{1,0}) \),
    \(\hat w_{i}^{1,0} = \frac {w_{j}^{1,0}} {2} \)
    and \( J[i,j,k] \) is the Jacobian evaluated at the quadrature point.

Reimplemented from Nektar::StdRegions::StdExpansion3D.

Definition at line 111 of file PrismExp.cpp.

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

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

◆ v_IProductWRTBase()

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

Calculate the inner product of inarray with respect to the basis B=base0*base1*base2 and put into outarray:

\( \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} (\bar \eta_{1i}) \psi_{q}^{a} (\xi_{2j}) \psi_{pr}^{b} (\xi_{3k}) w_i w_j w_k u(\bar \eta_{1,i} \xi_{2,j} \xi_{3,k}) J_{i,j,k}\\ & = & \sum_{i=0}^{nq_0} \psi_p^a(\bar \eta_{1,i}) \sum_{j=0}^{nq_1} \psi_{q}^a(\xi_{2,j}) \sum_{k=0}^{nq_2} \psi_{pr}^b u(\bar \eta_{1i},\xi_{2j},\xi_{3k}) J_{i,j,k} \end{array} \)
where

\( \phi_{pqr} (\xi_1 , \xi_2 , \xi_3) = \psi_p^a (\bar \eta_1) \psi_{q}^a (\xi_2) \psi_{pr}^b (\xi_3) \)
which can be implemented as
\(f_{pr} (\xi_{3k}) = \sum_{k=0}^{nq_3} \psi_{pr}^b u(\bar \eta_{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_{pr} (\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} \)

Reimplemented from Nektar::StdRegions::StdPrismExp.

Definition at line 272 of file PrismExp.cpp.

275  {
276  v_IProductWRTBase_SumFac(inarray, outarray);
277  }
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: PrismExp.cpp:279

References v_IProductWRTBase_SumFac().

Referenced by v_FwdTrans().

◆ v_IProductWRTBase_SumFac()

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

Reimplemented from Nektar::StdRegions::StdPrismExp.

Definition at line 279 of file PrismExp.cpp.

283  {
284  const int nquad0 = m_base[0]->GetNumPoints();
285  const int nquad1 = m_base[1]->GetNumPoints();
286  const int nquad2 = m_base[2]->GetNumPoints();
287  const int order0 = m_base[0]->GetNumModes();
288  const int order1 = m_base[1]->GetNumModes();
289 
290  Array<OneD, NekDouble> wsp(order0*nquad2*(nquad1+order1));
291 
292  if(multiplybyweights)
293  {
294  Array<OneD, NekDouble> tmp(nquad0*nquad1*nquad2);
295 
296  MultiplyByQuadratureMetric(inarray, tmp);
297 
298  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
299  m_base[1]->GetBdata(),
300  m_base[2]->GetBdata(),
301  tmp,outarray,wsp,
302  true,true,true);
303  }
304  else
305  {
306  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
307  m_base[1]->GetBdata(),
308  m_base[2]->GetBdata(),
309  inarray,outarray,wsp,
310  true,true,true);
311  }
312  }
void IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:733

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

Referenced by v_IProductWRTBase().

◆ v_IProductWRTDerivBase()

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

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

The derivative of the basis functions is performed using the chain rule in order to incorporate the geometric factors. Assuming that the basis functions are a tensor product \(\phi_{pqr}(\eta_1,\eta_2,\eta_3) = \phi_1(\eta_1)\phi_2(\eta_2)\phi_3(\eta_3)\), this yields the result

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

In the tetrahedral element, we must also incorporate a second set of geometric factors which incorporate the collapsed co-ordinate system, so that

\[ \frac{\partial\eta_j}{\partial x_i} = \sum_{k=1}^3 \frac{\partial\eta_j}{\partial\xi_k}\frac{\partial\xi_k}{\partial x_i} \]

These derivatives can be found on p152 of Sherwin & Karniadakis.

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

Reimplemented from Nektar::StdRegions::StdPrismExp.

Definition at line 344 of file PrismExp.cpp.

348  {
349  v_IProductWRTDerivBase_SumFac(dir, inarray, outarray);
350  }
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: PrismExp.cpp:352

References v_IProductWRTDerivBase_SumFac().

◆ v_IProductWRTDerivBase_SumFac()

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

Reimplemented from Nektar::StdRegions::StdPrismExp.

Definition at line 352 of file PrismExp.cpp.

356  {
357  const int nquad0 = m_base[0]->GetNumPoints();
358  const int nquad1 = m_base[1]->GetNumPoints();
359  const int nquad2 = m_base[2]->GetNumPoints();
360  const int order0 = m_base[0]->GetNumModes ();
361  const int order1 = m_base[1]->GetNumModes ();
362  const int nqtot = nquad0*nquad1*nquad2;
363 
364  Array<OneD, NekDouble> tmp1 (nqtot );
365  Array<OneD, NekDouble> tmp2 (nqtot );
366  Array<OneD, NekDouble> tmp3 (nqtot );
367  Array<OneD, NekDouble> tmp4 (nqtot );
368  Array<OneD, NekDouble> tmp6 (m_ncoeffs);
369  Array<OneD, NekDouble> wsp (order0*nquad2*(nquad1+order1));
370 
371  MultiplyByQuadratureMetric(inarray, tmp1);
372 
373  Array<OneD, Array<OneD, NekDouble>> tmp2D{3};
374  tmp2D[0] = tmp2;
375  tmp2D[1] = tmp3;
376  tmp2D[2] = tmp4;
377 
378  PrismExp::v_AlignVectorToCollapsedDir(dir, tmp1, tmp2D);
379 
380  IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(),
381  m_base[1]->GetBdata (),
382  m_base[2]->GetBdata (),
383  tmp2,outarray,wsp,
384  true,true,true);
385 
386  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata (),
387  m_base[1]->GetDbdata(),
388  m_base[2]->GetBdata (),
389  tmp3,tmp6,wsp,
390  true,true,true);
391 
392  Vmath::Vadd(m_ncoeffs, tmp6, 1, outarray, 1, outarray, 1);
393 
394  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata (),
395  m_base[1]->GetBdata (),
396  m_base[2]->GetDbdata(),
397  tmp4,tmp6,wsp,
398  true,true,true);
399 
400  Vmath::Vadd(m_ncoeffs, tmp6, 1, outarray, 1, outarray, 1);
401  }
virtual void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: PrismExp.cpp:403

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

Referenced by v_IProductWRTDerivBase().

◆ v_LaplacianMatrixOp() [1/2]

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1033 of file PrismExp.cpp.

1037  {
1038  PrismExp::LaplacianMatrixOp_MatFree(inarray,outarray,mkey);
1039  }
void LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)

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

◆ v_LaplacianMatrixOp() [2/2]

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1041 of file PrismExp.cpp.

1047  {
1048  StdExpansion::LaplacianMatrixOp_MatFree(k1,k2,inarray,outarray,mkey);
1049  }

◆ v_LaplacianMatrixOp_MatFree_Kernel()

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

Calculate the Laplacian multiplication in a matrix-free manner.

This function is the kernel of the Laplacian matrix-free operator, and is used in v_HelmholtzMatrixOp_MatFree to determine the effect of the Helmholtz operator in a similar fashion.

The majority of the calculation is precisely the same as in the hexahedral expansion; however the collapsed co-ordinate system must be taken into account when constructing the geometric factors. How this is done is detailed more exactly in the tetrahedral expansion. On entry to this function, the input #inarray must be in its backwards-transformed state (i.e. \(\mathbf{u} = \mathbf{B}\hat{\mathbf{u}}\)). The output is in coefficient space.

See also
TetExp::v_HelmholtzMatrixOp_MatFree

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1587 of file PrismExp.cpp.

1591  {
1592  int nquad0 = m_base[0]->GetNumPoints();
1593  int nquad1 = m_base[1]->GetNumPoints();
1594  int nquad2 = m_base[2]->GetNumPoints();
1595  int nqtot = nquad0*nquad1*nquad2;
1596  int i;
1597 
1598  // Set up temporary storage.
1599  Array<OneD,NekDouble> alloc(11*nqtot,0.0);
1600  Array<OneD,NekDouble> wsp1 (alloc ); // TensorDeriv 1
1601  Array<OneD,NekDouble> wsp2 (alloc+ 1*nqtot); // TensorDeriv 2
1602  Array<OneD,NekDouble> wsp3 (alloc+ 2*nqtot); // TensorDeriv 3
1603  Array<OneD,NekDouble> g0 (alloc+ 3*nqtot); // g0
1604  Array<OneD,NekDouble> g1 (alloc+ 4*nqtot); // g1
1605  Array<OneD,NekDouble> g2 (alloc+ 5*nqtot); // g2
1606  Array<OneD,NekDouble> g3 (alloc+ 6*nqtot); // g3
1607  Array<OneD,NekDouble> g4 (alloc+ 7*nqtot); // g4
1608  Array<OneD,NekDouble> g5 (alloc+ 8*nqtot); // g5
1609  Array<OneD,NekDouble> h0 (alloc+ 3*nqtot); // h0 == g0
1610  Array<OneD,NekDouble> h1 (alloc+ 6*nqtot); // h1 == g3
1611  Array<OneD,NekDouble> wsp4 (alloc+ 4*nqtot); // wsp4 == g1
1612  Array<OneD,NekDouble> wsp5 (alloc+ 5*nqtot); // wsp5 == g2
1613  Array<OneD,NekDouble> wsp6 (alloc+ 8*nqtot); // wsp6 == g5
1614  Array<OneD,NekDouble> wsp7 (alloc+ 3*nqtot); // wsp7 == g0
1615  Array<OneD,NekDouble> wsp8 (alloc+ 9*nqtot); // wsp8
1616  Array<OneD,NekDouble> wsp9 (alloc+10*nqtot); // wsp9
1617 
1618  const Array<OneD, const NekDouble>& base0 = m_base[0]->GetBdata();
1619  const Array<OneD, const NekDouble>& base1 = m_base[1]->GetBdata();
1620  const Array<OneD, const NekDouble>& base2 = m_base[2]->GetBdata();
1621  const Array<OneD, const NekDouble>& dbase0 = m_base[0]->GetDbdata();
1622  const Array<OneD, const NekDouble>& dbase1 = m_base[1]->GetDbdata();
1623  const Array<OneD, const NekDouble>& dbase2 = m_base[2]->GetDbdata();
1624 
1625  // Step 1. LAPLACIAN MATRIX OPERATION
1626  // wsp1 = du_dxi1 = D_xi1 * wsp0 = D_xi1 * u
1627  // wsp2 = du_dxi2 = D_xi2 * wsp0 = D_xi2 * u
1628  // wsp3 = du_dxi3 = D_xi3 * wsp0 = D_xi3 * u
1629  StdExpansion3D::PhysTensorDeriv(inarray,wsp1,wsp2,wsp3);
1630 
1631  const Array<TwoD, const NekDouble>& df =
1632  m_metricinfo->GetDerivFactors(GetPointsKeys());
1633  const Array<OneD, const NekDouble>& z0 = m_base[0]->GetZ();
1634  const Array<OneD, const NekDouble>& z2 = m_base[2]->GetZ();
1635 
1636  // Step 2. Calculate the metric terms of the collapsed
1637  // coordinate transformation (Spencer's book P152)
1638  for (i = 0; i < nquad2; ++i)
1639  {
1640  Vmath::Fill(nquad0*nquad1, 2.0/(1.0-z2[i]), &h0[0]+i*nquad0*nquad1,1);
1641  Vmath::Fill(nquad0*nquad1, 2.0/(1.0-z2[i]), &h1[0]+i*nquad0*nquad1,1);
1642  }
1643  for (i = 0; i < nquad0; i++)
1644  {
1645  Blas::Dscal(nquad1*nquad2, 0.5*(1+z0[i]), &h1[0]+i, nquad0);
1646  }
1647 
1648  // Step 3. Construct combined metric terms for physical space to
1649  // collapsed coordinate system. Order of construction optimised
1650  // to minimise temporary storage
1651  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1652  {
1653  // wsp4 = d eta_1/d x_1
1654  Vmath::Vvtvvtp(nqtot, &df[0][0], 1, &h0[0], 1, &df[2][0], 1, &h1[0], 1, &wsp4[0], 1);
1655  // wsp5 = d eta_2/d x_1
1656  Vmath::Vvtvvtp(nqtot, &df[3][0], 1, &h0[0], 1, &df[5][0], 1, &h1[0], 1, &wsp5[0], 1);
1657  // wsp6 = d eta_3/d x_1d
1658  Vmath::Vvtvvtp(nqtot, &df[6][0], 1, &h0[0], 1, &df[8][0], 1, &h1[0], 1, &wsp6[0], 1);
1659 
1660  // g0 (overwrites h0)
1661  Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0], 1, &g0[0], 1);
1662  Vmath::Vvtvp (nqtot, &wsp6[0], 1, &wsp6[0], 1, &g0[0], 1, &g0[0], 1);
1663 
1664  // g3 (overwrites h1)
1665  Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &wsp4[0], 1, &df[4][0], 1, &wsp5[0], 1, &g3[0], 1);
1666  Vmath::Vvtvp (nqtot, &df[7][0], 1, &wsp6[0], 1, &g3[0], 1, &g3[0], 1);
1667 
1668  // g4
1669  Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &wsp4[0], 1, &df[5][0], 1, &wsp5[0], 1, &g4[0], 1);
1670  Vmath::Vvtvp (nqtot, &df[8][0], 1, &wsp6[0], 1, &g4[0], 1, &g4[0], 1);
1671 
1672  // Overwrite wsp4/5/6 with g1/2/5
1673  // g1
1674  Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &df[1][0], 1, &df[4][0], 1, &df[4][0], 1, &g1[0], 1);
1675  Vmath::Vvtvp (nqtot, &df[7][0], 1, &df[7][0], 1, &g1[0], 1, &g1[0], 1);
1676 
1677  // g2
1678  Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &df[2][0], 1, &df[5][0], 1, &df[5][0], 1, &g2[0], 1);
1679  Vmath::Vvtvp (nqtot, &df[8][0], 1, &df[8][0], 1, &g2[0], 1, &g2[0], 1);
1680 
1681  // g5
1682  Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &df[2][0], 1, &df[4][0], 1, &df[5][0], 1, &g5[0], 1);
1683  Vmath::Vvtvp (nqtot, &df[7][0], 1, &df[8][0], 1, &g5[0], 1, &g5[0], 1);
1684  }
1685  else
1686  {
1687  // wsp4 = d eta_1/d x_1
1688  Vmath::Svtsvtp(nqtot, df[0][0], &h0[0], 1, df[2][0], &h1[0], 1, &wsp4[0], 1);
1689  // wsp5 = d eta_2/d x_1
1690  Vmath::Svtsvtp(nqtot, df[3][0], &h0[0], 1, df[5][0], &h1[0], 1, &wsp5[0], 1);
1691  // wsp6 = d eta_3/d x_1
1692  Vmath::Svtsvtp(nqtot, df[6][0], &h0[0], 1, df[8][0], &h1[0], 1, &wsp6[0], 1);
1693 
1694  // g0 (overwrites h0)
1695  Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0], 1, &g0[0], 1);
1696  Vmath::Vvtvp (nqtot, &wsp6[0], 1, &wsp6[0], 1, &g0[0], 1, &g0[0], 1);
1697 
1698  // g3 (overwrites h1)
1699  Vmath::Svtsvtp(nqtot, df[1][0], &wsp4[0], 1, df[4][0], &wsp5[0], 1, &g3[0], 1);
1700  Vmath::Svtvp (nqtot, df[7][0], &wsp6[0], 1, &g3[0], 1, &g3[0], 1);
1701 
1702  // g4
1703  Vmath::Svtsvtp(nqtot, df[2][0], &wsp4[0], 1, df[5][0], &wsp5[0], 1, &g4[0], 1);
1704  Vmath::Svtvp (nqtot, df[8][0], &wsp6[0], 1, &g4[0], 1, &g4[0], 1);
1705 
1706  // Overwrite wsp4/5/6 with g1/2/5
1707  // g1
1708  Vmath::Fill(nqtot, df[1][0]*df[1][0] + df[4][0]*df[4][0] + df[7][0]*df[7][0], &g1[0], 1);
1709 
1710  // g2
1711  Vmath::Fill(nqtot, df[2][0]*df[2][0] + df[5][0]*df[5][0] + df[8][0]*df[8][0], &g2[0], 1);
1712 
1713  // g5
1714  Vmath::Fill(nqtot, df[1][0]*df[2][0] + df[4][0]*df[5][0] + df[7][0]*df[8][0], &g5[0], 1);
1715  }
1716  // Compute component derivatives into wsp7, 8, 9 (wsp7 overwrites
1717  // g0).
1718  Vmath::Vvtvvtp(nqtot,&g0[0],1,&wsp1[0],1,&g3[0],1,&wsp2[0],1,&wsp7[0],1);
1719  Vmath::Vvtvp (nqtot,&g4[0],1,&wsp3[0],1,&wsp7[0],1,&wsp7[0],1);
1720  Vmath::Vvtvvtp(nqtot,&g1[0],1,&wsp2[0],1,&g3[0],1,&wsp1[0],1,&wsp8[0],1);
1721  Vmath::Vvtvp (nqtot,&g5[0],1,&wsp3[0],1,&wsp8[0],1,&wsp8[0],1);
1722  Vmath::Vvtvvtp(nqtot,&g2[0],1,&wsp3[0],1,&g4[0],1,&wsp1[0],1,&wsp9[0],1);
1723  Vmath::Vvtvp (nqtot,&g5[0],1,&wsp2[0],1,&wsp9[0],1,&wsp9[0],1);
1724 
1725  // Step 4.
1726  // Multiply by quadrature metric
1727  MultiplyByQuadratureMetric(wsp7,wsp7);
1728  MultiplyByQuadratureMetric(wsp8,wsp8);
1729  MultiplyByQuadratureMetric(wsp9,wsp9);
1730 
1731  // Perform inner product w.r.t derivative bases.
1732  IProductWRTBase_SumFacKernel(dbase0,base1,base2,wsp7,wsp1, wsp,false,true,true);
1733  IProductWRTBase_SumFacKernel(base0,dbase1,base2,wsp8,wsp2, wsp,true,false,true);
1734  IProductWRTBase_SumFacKernel(base0,base1,dbase2,wsp9,outarray,wsp,true,true,false);
1735 
1736  // Step 5.
1737  // Sum contributions from wsp1, wsp2 and outarray.
1738  Vmath::Vadd(m_ncoeffs,wsp1.get(),1,outarray.get(),1,outarray.get(),1);
1739  Vmath::Vadd(m_ncoeffs,wsp2.get(),1,outarray.get(),1,outarray.get(),1);
1740  }
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
Definition: Blas.hpp:182
void Svtsvtp(int n, const T alpha, const T *x, int incx, const T beta, const T *y, int incy, T *z, int incz)
vvtvvtp (scalar times vector plus scalar times vector):
Definition: Vmath.cpp:691
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
Definition: Vmath.cpp:565
void Vvtvvtp(int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtp (vector times vector plus vector times vector):
Definition: Vmath.cpp:625

References Blas::Dscal(), Nektar::SpatialDomains::eDeformed, Vmath::Fill(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion3D::IProductWRTBase_SumFacKernel(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_metricinfo, Nektar::StdRegions::StdExpansion::m_ncoeffs, Nektar::StdRegions::StdExpansion::MultiplyByQuadratureMetric(), Vmath::Svtsvtp(), Vmath::Svtvp(), Vmath::Vadd(), Vmath::Vvtvp(), and Vmath::Vvtvvtp().

◆ v_MassMatrixOp()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1025 of file PrismExp.cpp.

1029  {
1030  StdExpansion::MassMatrixOp_MatFree(inarray,outarray,mkey);
1031  }

◆ v_PhysDeriv()

void Nektar::LocalRegions::PrismExp::v_PhysDeriv ( const Array< OneD, const NekDouble > &  u_physical,
Array< OneD, NekDouble > &  out_dxi1,
Array< OneD, NekDouble > &  out_dxi2,
Array< OneD, NekDouble > &  out_dxi3 
)
protectedvirtual

Calculate the derivative of the physical points.

The derivative is evaluated at the nodal physical points. Derivatives with respect to the local Cartesian coordinates.

\(\begin{Bmatrix} \frac {\partial} {\partial \xi_1} \\ \frac {\partial} {\partial \xi_2} \\ \frac {\partial} {\partial \xi_3} \end{Bmatrix} = \begin{Bmatrix} \frac 2 {(1-\eta_3)} \frac \partial {\partial \bar \eta_1} \\ \frac {\partial} {\partial \xi_2} \ \ \frac {(1 + \bar \eta_1)} {(1 - \eta_3)} \frac \partial {\partial \bar \eta_1} + \frac {\partial} {\partial \eta_3} \end{Bmatrix}\)

Reimplemented from Nektar::StdRegions::StdPrismExp.

Definition at line 137 of file PrismExp.cpp.

141  {
142  int nqtot = GetTotPoints();
143 
144  Array<TwoD, const NekDouble> df =
145  m_metricinfo->GetDerivFactors(GetPointsKeys());
146  Array<OneD, NekDouble> diff0(nqtot);
147  Array<OneD, NekDouble> diff1(nqtot);
148  Array<OneD, NekDouble> diff2(nqtot);
149 
150  StdPrismExp::v_PhysDeriv(inarray, diff0, diff1, diff2);
151 
152  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
153  {
154  if(out_d0.size())
155  {
156  Vmath::Vmul (nqtot,&df[0][0],1,&diff0[0],1,&out_d0[0],1);
157  Vmath::Vvtvp (nqtot,&df[1][0],1,&diff1[0],1,&out_d0[0],1,&out_d0[0],1);
158  Vmath::Vvtvp (nqtot,&df[2][0],1,&diff2[0],1,&out_d0[0],1,&out_d0[0],1);
159  }
160 
161  if(out_d1.size())
162  {
163  Vmath::Vmul (nqtot,&df[3][0],1,&diff0[0],1,&out_d1[0],1);
164  Vmath::Vvtvp (nqtot,&df[4][0],1,&diff1[0],1,&out_d1[0],1,&out_d1[0],1);
165  Vmath::Vvtvp (nqtot,&df[5][0],1,&diff2[0],1,&out_d1[0],1,&out_d1[0],1);
166  }
167 
168  if(out_d2.size())
169  {
170  Vmath::Vmul (nqtot,&df[6][0],1,&diff0[0],1,&out_d2[0],1);
171  Vmath::Vvtvp (nqtot,&df[7][0],1,&diff1[0],1,&out_d2[0],1,&out_d2[0],1);
172  Vmath::Vvtvp (nqtot,&df[8][0],1,&diff2[0],1,&out_d2[0],1,&out_d2[0],1);
173  }
174  }
175  else // regular geometry
176  {
177  if(out_d0.size())
178  {
179  Vmath::Smul (nqtot,df[0][0],&diff0[0],1,&out_d0[0],1);
180  Blas::Daxpy (nqtot,df[1][0],&diff1[0],1,&out_d0[0],1);
181  Blas::Daxpy (nqtot,df[2][0],&diff2[0],1,&out_d0[0],1);
182  }
183 
184  if(out_d1.size())
185  {
186  Vmath::Smul (nqtot,df[3][0],&diff0[0],1,&out_d1[0],1);
187  Blas::Daxpy (nqtot,df[4][0],&diff1[0],1,&out_d1[0],1);
188  Blas::Daxpy (nqtot,df[5][0],&diff2[0],1,&out_d1[0],1);
189  }
190 
191  if(out_d2.size())
192  {
193  Vmath::Smul (nqtot,df[6][0],&diff0[0],1,&out_d2[0],1);
194  Blas::Daxpy (nqtot,df[7][0],&diff1[0],1,&out_d2[0],1);
195  Blas::Daxpy (nqtot,df[8][0],&diff2[0],1,&out_d2[0],1);
196  }
197  }
198  }
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:134
static void Daxpy(const int &n, const double &alpha, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: y = alpha x plus y.
Definition: Blas.hpp:167

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

◆ v_PhysEvaluate()

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

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

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

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

is evaluated using Lagrangian interpolants through the quadrature points:

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

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

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

Reimplemented from Nektar::StdRegions::StdExpansion3D.

Definition at line 545 of file PrismExp.cpp.

547  {
548  Array<OneD, NekDouble> Lcoord(3);
549 
550  ASSERTL0(m_geom,"m_geom not defined");
551 
552  m_geom->GetLocCoords(coord, Lcoord);
553 
554  return StdPrismExp::v_PhysEvaluate(Lcoord, physvals);
555  }

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

◆ v_StdPhysEvaluate()

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

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 537 of file PrismExp.cpp.

540  {
541  // Evaluate point in local (eta) coordinates.
542  return StdPrismExp::v_PhysEvaluate(Lcoord,physvals);
543  }

◆ v_SVVLaplacianFilter()

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

Reimplemented from Nektar::StdRegions::StdPrismExp.

Definition at line 1081 of file PrismExp.cpp.

1084  {
1085  int nq = GetTotPoints();
1086 
1087  // Calculate sqrt of the Jacobian
1088  Array<OneD, const NekDouble> jac =
1089  m_metricinfo->GetJac(GetPointsKeys());
1090  Array<OneD, NekDouble> sqrt_jac(nq);
1091  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1092  {
1093  Vmath::Vsqrt(nq,jac,1,sqrt_jac,1);
1094  }
1095  else
1096  {
1097  Vmath::Fill(nq,sqrt(jac[0]),sqrt_jac,1);
1098  }
1099 
1100  // Multiply array by sqrt(Jac)
1101  Vmath::Vmul(nq,sqrt_jac,1,array,1,array,1);
1102 
1103  // Apply std region filter
1104  StdPrismExp::v_SVVLaplacianFilter( array, mkey);
1105 
1106  // Divide by sqrt(Jac)
1107  Vmath::Vdiv(nq,array,1,sqrt_jac,1,array,1);
1108  }
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
Definition: Vmath.cpp:257

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

Member Data Documentation

◆ m_matrixManager

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

Definition at line 213 of file PrismExp.h.

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

◆ m_staticCondMatrixManager

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

Definition at line 215 of file PrismExp.h.

Referenced by v_DropLocStaticCondMatrix(), and v_GetLocStaticCondMatrix().