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

#include <SegExp.h>

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

Public Member Functions

 SegExp (const LibUtilities::BasisKey &Ba, const SpatialDomains::Geometry1DSharedPtr &geom)
 Constructor using BasisKey class for quadrature points and order definition. More...
 
 SegExp (const SegExp &S)
 Copy Constructor. More...
 
 ~SegExp ()
 
- Public Member Functions inherited from Nektar::StdRegions::StdSegExp
 StdSegExp ()
 Default constructor. More...
 
 StdSegExp (const LibUtilities::BasisKey &Ba)
 Constructor using BasisKey class for quadrature points and order definition. More...
 
 StdSegExp (const StdSegExp &T)
 Copy Constructor. More...
 
 ~StdSegExp ()
 
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion1D
 StdExpansion1D ()
 
 StdExpansion1D (int numcoeffs, const LibUtilities::BasisKey &Ba)
 
 StdExpansion1D (const StdExpansion1D &T)
 
virtual ~StdExpansion1D ()
 
void PhysTensorDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Evaluate the derivative \( d/d{\xi_1} \) at the physical quadrature points given by inarray and return in outarray. More...
 
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion
 StdExpansion ()
 Default Constructor. More...
 
 StdExpansion (const int numcoeffs, const int numbases, const LibUtilities::BasisKey &Ba=LibUtilities::NullBasisKey, const LibUtilities::BasisKey &Bb=LibUtilities::NullBasisKey, const LibUtilities::BasisKey &Bc=LibUtilities::NullBasisKey)
 Constructor. More...
 
 StdExpansion (const StdExpansion &T)
 Copy Constructor. More...
 
virtual ~StdExpansion ()
 Destructor. More...
 
int GetNumBases () const
 This function returns the number of 1D bases used in the expansion. More...
 
const Array< OneD, const LibUtilities::BasisSharedPtr > & GetBase () const
 This function gets the shared point to basis. More...
 
const LibUtilities::BasisSharedPtrGetBasis (int dir) const
 This function gets the shared point to basis in the dir direction. More...
 
int GetNcoeffs (void) const
 This function returns the total number of coefficients used in the expansion. More...
 
int GetTotPoints () const
 This function returns the total number of quadrature points used in the element. More...
 
LibUtilities::BasisType GetBasisType (const int dir) const
 This function returns the type of basis used in the dir direction. More...
 
int GetBasisNumModes (const int dir) const
 This function returns the number of expansion modes in the dir direction. More...
 
int EvalBasisNumModesMax (void) const
 This function returns the maximum number of expansion modes over all local directions. More...
 
LibUtilities::PointsType GetPointsType (const int dir) const
 This function returns the type of quadrature points used in the dir direction. More...
 
int GetNumPoints (const int dir) const
 This function returns the number of quadrature points in the dir direction. More...
 
const Array< OneD, const NekDouble > & GetPoints (const int dir) const
 This function returns a pointer to the array containing the quadrature points in dir direction. More...
 
int GetNverts () const
 This function returns the number of vertices of the expansion domain. More...
 
int GetNedges () const
 This function returns the number of edges of the expansion domain. More...
 
int GetEdgeNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge. More...
 
int GetTotalEdgeIntNcoeffs () const
 
int GetEdgeNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th edge. More...
 
int DetCartesianDirOfEdge (const int edge)
 
const LibUtilities::BasisKey DetEdgeBasisKey (const int i) const
 
const LibUtilities::BasisKey DetFaceBasisKey (const int i, const int k) const
 
int GetFaceNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th face. More...
 
int GetFaceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th face. More...
 
int GetFaceIntNcoeffs (const int i) const
 
int GetTotalFaceIntNcoeffs () const
 
int GetTraceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge/face. More...
 
LibUtilities::PointsKey GetFacePointsKey (const int i, const int j) const
 
int NumBndryCoeffs (void) const
 
int NumDGBndryCoeffs (void) const
 
LibUtilities::BasisType GetEdgeBasisType (const int i) const
 This function returns the type of expansion basis on the i-th edge. More...
 
const LibUtilities::PointsKey GetNodalPointsKey () const
 This function returns the type of expansion Nodal point type if defined. More...
 
int GetNfaces () const
 This function returns the number of faces of the expansion domain. More...
 
int GetNtrace () const
 Returns the number of trace elements connected to this element. More...
 
LibUtilities::ShapeType DetShapeType () const
 This function returns the shape of the expansion domain. More...
 
std::shared_ptr< StdExpansionGetStdExp (void) const
 
std::shared_ptr< StdExpansionGetLinStdExp (void) const
 
int GetShapeDimension () const
 
bool IsBoundaryInteriorExpansion ()
 
bool IsNodalNonTensorialExp ()
 
void BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Backward transformation from coefficient space to physical space. More...
 
void FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Forward transformation from physical space to coefficient space. More...
 
void FwdTrans_BndConstrained (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
NekDouble Integral (const Array< OneD, const NekDouble > &inarray)
 This function integrates the specified function over the domain. More...
 
void FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 This function fills the array outarray with the mode-th mode of the expansion. More...
 
void IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 this function calculates the inner product of a given function f with the different modes of the expansion More...
 
void IProductWRTBase (const Array< OneD, const NekDouble > &base, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int coll_check)
 
void IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDirectionalDerivBase (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
int GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
void SetElmtId (const int id)
 Set the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
void GetCoords (Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2=NullNekDouble1DArray, Array< OneD, NekDouble > &coords_3=NullNekDouble1DArray)
 this function returns the physical coordinates of the quadrature points of the expansion More...
 
void GetCoord (const Array< OneD, const NekDouble > &Lcoord, Array< OneD, NekDouble > &coord)
 given the coordinates of a point of the element in the local collapsed coordinate system, this function calculates the physical coordinates of the point More...
 
DNekMatSharedPtr GetStdMatrix (const StdMatrixKey &mkey)
 
DNekBlkMatSharedPtr GetStdStaticCondMatrix (const StdMatrixKey &mkey)
 
IndexMapValuesSharedPtr GetIndexMap (const IndexMapKey &ikey)
 
const Array< OneD, const NekDouble > & GetPhysNormals (void)
 
void SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
virtual void SetUpPhysNormals (const int edge)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray)
 
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
void DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
StdRegions::Orientation GetForient (int face)
 
StdRegions::Orientation GetEorient (int edge)
 
void SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
 
void SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
int CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
NekDouble StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
 
int GetCoordim ()
 
void GetBoundaryMap (Array< OneD, unsigned int > &outarray)
 
void GetInteriorMap (Array< OneD, unsigned int > &outarray)
 
int GetVertexMap (const int localVertexId, bool useCoeffPacking=false)
 
void GetEdgeInteriorMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
void GetFaceNumModes (const int fid, const Orientation faceOrient, int &numModes0, int &numModes1)
 
void GetFaceInteriorMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
void GetEdgeToElementMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int P=-1)
 
void GetFaceToElementMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int nummodesA=-1, int nummodesB=-1)
 
void GetEdgePhysVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Extract the physical values along edge edge from inarray into outarray following the local edge orientation and point distribution defined by defined in EdgeExp. More...
 
void GetEdgePhysVals (const int edge, const std::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetTracePhysVals (const int edge, const std::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetVertexPhysVals (const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
 
void GetEdgeInterpVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetEdgeQFactors (const int edge, Array< OneD, NekDouble > &outarray)
 Extract the metric factors to compute the contravariant fluxes along edge edge and stores them into outarray following the local edge orientation (i.e. anticlockwise convention). More...
 
void GetFacePhysVals (const int face, const std::shared_ptr< StdExpansion > &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=eNoOrientation)
 
void GetEdgePhysMap (const int edge, Array< OneD, int > &outarray)
 
void GetFacePhysMap (const int face, Array< OneD, int > &outarray)
 
void MultiplyByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
DNekMatSharedPtr CreateGeneralMatrix (const StdMatrixKey &mkey)
 this function generates the mass matrix \(\mathbf{M}[i][j] = \int \phi_i(\mathbf{x}) \phi_j(\mathbf{x}) d\mathbf{x}\) More...
 
void GeneralMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
 
void ExponentialFilter (Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
 
void LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionDiffusionReactionMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
void HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
DNekMatSharedPtr GenMatrix (const StdMatrixKey &mkey)
 
void PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
void PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void PhysDeriv_s (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
 
void PhysDeriv_n (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
 
void PhysDirectionalDeriv (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &outarray)
 
void StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
void StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void AddRobinMassMatrix (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
 
void AddRobinEdgeContribution (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, Array< OneD, NekDouble > &coeffs)
 
NekDouble PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
void LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 Convert local cartesian coordinate xi into local collapsed coordinates eta. More...
 
virtual int v_GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
virtual void v_SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
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, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
virtual StdRegions::Orientation v_GetForient (int face)
 
virtual StdRegions::Orientation v_GetEorient (int edge)
 
NekDouble Linf (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( L_\infty\) error \( |\epsilon|_\infty = \max |u - u_{exact}|\) where \( u_{exact}\) is given by the array sol. More...
 
NekDouble L2 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( L_2\) error, \( | \epsilon |_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 dx \right]^{1/2} d\xi_1 \) where \( u_{exact}\) is given by the array sol. More...
 
NekDouble H1 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete \( H^1\) error, \( | \epsilon |^1_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 + \nabla(u - u_{exact})\cdot\nabla(u - u_{exact})\cdot dx \right]^{1/2} d\xi_1 \) where \( u_{exact}\) is given by the array sol. More...
 
const NormalVectorGetEdgeNormal (const int edge) const
 
void ComputeEdgeNormal (const int edge)
 
void NegateEdgeNormal (const int edge)
 
bool EdgeNormalNegated (const int edge)
 
void ComputeFaceNormal (const int face)
 
void NegateFaceNormal (const int face)
 
bool FaceNormalNegated (const int face)
 
void ComputeVertexNormal (const int vertex)
 
void NegateVertexNormal (const int vertex)
 
bool VertexNormalNegated (const int vertex)
 
const NormalVectorGetFaceNormal (const int face) const
 
const NormalVectorGetVertexNormal (const int vertex) const
 
const NormalVectorGetSurfaceNormal (const int id) const
 
const LibUtilities::PointsKeyVector GetPointsKeys () const
 
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap (int eid)
 
Array< OneD, unsigned int > GetFaceInverseBoundaryMap (int fid, StdRegions::Orientation faceOrient=eNoOrientation, int P1=-1, int P2=-1)
 
void GetInverseBoundaryMaps (Array< OneD, unsigned int > &vmap, Array< OneD, Array< OneD, unsigned int > > &emap, Array< OneD, Array< OneD, unsigned int > > &fmap)
 
DNekMatSharedPtr BuildInverseTransformationMatrix (const DNekScalMatSharedPtr &m_transformationmatrix)
 
void PhysInterpToSimplexEquiSpaced (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int npset=-1)
 This function performs an interpolation from the physical space points provided at input into an array of equispaced points which are not the collapsed coordinate. So for a tetrahedron you will only get a tetrahedral number of values. More...
 
void GetSimplexEquiSpacedConnectivity (Array< OneD, int > &conn, bool standard=true)
 This function provides the connectivity of local simplices (triangles or tets) to connect the equispaced data points provided by PhysInterpToSimplexEquiSpaced. More...
 
void EquiSpacedToCoeffs (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs a projection/interpolation from the equispaced points sometimes used in post-processing onto the coefficient space. More...
 
template<class T >
std::shared_ptr< T > as ()
 
void IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
 
- Public Member Functions inherited from Nektar::LocalRegions::Expansion1D
 Expansion1D (SpatialDomains::Geometry1DSharedPtr pGeom)
 
virtual ~Expansion1D ()
 
void AddNormTraceInt (const int dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
Expansion2DSharedPtr GetLeftAdjacentElementExp () const
 
Expansion2DSharedPtr GetRightAdjacentElementExp () const
 
int GetLeftAdjacentElementEdge () const
 
int GetRightAdjacentElementEdge () const
 
void SetAdjacentElementExp (int edge, Expansion2DSharedPtr &e)
 
void AddHDGHelmholtzTraceTerms (const NekDouble tau, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
SpatialDomains::Geometry1DSharedPtr GetGeom1D () const
 
- Public Member Functions inherited from Nektar::LocalRegions::Expansion
 Expansion (SpatialDomains::GeometrySharedPtr pGeom)
 
 Expansion (const Expansion &pSrc)
 
virtual ~Expansion ()
 
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 ()
 
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)
 

Protected Member Functions

virtual NekDouble v_Integral (const Array< OneD, const NekDouble > &inarray)
 Integrate the physical point list inarray over 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=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 Evaluate the derivative \( d/d{\xi_1} \) at the physical quadrature points given by inarray and return in outarray. More...
 
virtual void v_PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Calculate the derivative of the physical points in a given direction. More...
 
virtual void v_PhysDeriv_s (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
 Evaluate the derivative along a line: \( d/ds=\frac{spacedim}{||tangent||}d/d{\xi} \). The derivative is calculated performing the product \( du/d{s}=\nabla u \cdot tangent \). More...
 
virtual void v_PhysDeriv_n (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
 Evaluate the derivative normal to a line: \( d/dn=\frac{spacedim}{||normal||}d/d{\xi} \). The derivative is calculated performing the product \( du/d{s}=\nabla u \cdot normal \). 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 outarray. More...
 
virtual void v_FwdTrans_BndConstrained (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Inner product of inarray over region with respect to the expansion basis (this)->_Base[0] and return in outarray. More...
 
virtual void v_IProductWRTBase (const Array< OneD, const NekDouble > &base, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int coll_check)
 Inner product of inarray over region with respect to expansion basis base and return in outarray. More...
 
virtual void v_IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, 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 Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray)
 
virtual NekDouble v_StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
 
virtual NekDouble v_PhysEvaluate (const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals)
 
virtual void v_GetCoord (const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
 
virtual void v_GetCoords (Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
 
virtual void v_GetVertexPhysVals (const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
 
virtual void v_GetTracePhysVals (const int edge, const StdRegions::StdExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
 
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp (void) const
 
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp (void) const
 
virtual int v_GetCoordim ()
 
virtual void v_SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
 
virtual void v_SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual int v_GetNumPoints (const int dir) const
 
virtual int v_GetNcoeffs (void) const
 
virtual const LibUtilities::BasisSharedPtrv_GetBasis (int dir) const
 
virtual int v_NumBndryCoeffs () const
 
virtual int v_NumDGBndryCoeffs () const
 
virtual void v_ComputeVertexNormal (const int vertex)
 
virtual SpatialDomains::GeomType v_MetricInfoType ()
 
virtual void v_ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
 Unpack data from input file assuming it comes from. More...
 
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals (void)
 
virtual void v_LaplacianMatrixOp (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 DNekMatSharedPtr v_GenMatrix (const StdRegions::StdMatrixKey &mkey)
 
DNekScalMatSharedPtr CreateMatrix (const MatrixKey &mkey)
 
virtual DNekMatSharedPtr v_CreateStdMatrix (const StdRegions::StdMatrixKey &mkey)
 
DNekScalBlkMatSharedPtr CreateStaticCondMatrix (const MatrixKey &mkey)
 
virtual DNekScalMatSharedPtr v_GetLocMatrix (const MatrixKey &mkey)
 
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const MatrixKey &mkey)
 
void v_DropLocStaticCondMatrix (const MatrixKey &mkey)
 
- Protected Member Functions inherited from Nektar::StdRegions::StdSegExp
virtual void v_StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
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)
 Backward transform from coefficient space given in inarray and evaluate at the physical quadrature points outarray. More...
 
virtual void v_BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
 
virtual void v_SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
 
virtual void v_ExponentialFilter (Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
 
virtual void v_MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
virtual void v_FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 
virtual void v_GetBoundaryMap (Array< OneD, unsigned int > &outarray)
 
virtual void v_GetInteriorMap (Array< OneD, unsigned int > &outarray)
 
virtual int v_GetVertexMap (int localVertexId, bool useCoeffPacking=false)
 
virtual int v_GetNverts () const
 
virtual bool v_IsBoundaryInteriorExpansion ()
 
virtual int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
virtual LibUtilities::ShapeType v_DetShapeType () const
 Return Shape of region, using ShapeType enum list. i.e. Segment. More...
 
virtual void v_GetSimplexEquiSpacedConnectivity (Array< OneD, int > &conn, bool standard=true)
 
virtual void v_ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion
DNekMatSharedPtr CreateStdMatrix (const StdMatrixKey &mkey)
 
DNekBlkMatSharedPtr CreateStdStaticCondMatrix (const StdMatrixKey &mkey)
 Create the static condensation of a matrix when using a boundary interior decomposition. More...
 
IndexMapValuesSharedPtr CreateIndexMap (const IndexMapKey &ikey)
 Create an IndexMap which contains mapping information linking any specific element shape with either its boundaries, edges, faces, verteces, etc. More...
 
void BwdTrans_MatOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void IProductWRTDirectionalDerivBase_SumFac (const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GeneralMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
 
void LaplacianMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp_MatFree (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp_MatFree (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionDiffusionReactionMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
void HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void HelmholtzMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
- Protected Member Functions inherited from Nektar::LocalRegions::Expansion1D
virtual void v_AddRobinMassMatrix (const int vert, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
 
virtual void v_AddRobinEdgeContribution (const int vert, const Array< OneD, const NekDouble > &primCoeffs, Array< OneD, NekDouble > &coeffs)
 
virtual NekDouble v_VectorFlux (const Array< OneD, Array< OneD, NekDouble > > &vec)
 
virtual void v_NegateVertexNormal (const int vertex)
 
virtual bool v_VertexNormalNegated (const int vertex)
 
- 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_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 DNekMatSharedPtr v_BuildTransformationMatrix (const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
 
virtual DNekMatSharedPtr v_BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd)
 
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 void v_DGDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &coeffs, Array< OneD, NekDouble > &outarray)
 

Private Member Functions

 SegExp ()
 
void ReverseCoeffsAndSign (const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Reverse the coefficients in a boundary interior expansion this routine is of use when we need the segment coefficients corresponding to a expansion in the reverse coordinate direction. More...
 
void MultiplyByElmtInvMass (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 

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::StdExpansion1D
std::map< int, NormalVectorm_vertexNormals
 
- Protected Attributes inherited from Nektar::StdRegions::StdExpansion
Array< OneD, LibUtilities::BasisSharedPtrm_base
 
int m_elmt_id
 
int m_ncoeffs
 
LibUtilities::NekManager< StdMatrixKey, DNekMat, StdMatrixKey::opLessm_stdMatrixManager
 
LibUtilities::NekManager< StdMatrixKey, DNekBlkMat, StdMatrixKey::opLessm_stdStaticCondMatrixManager
 
LibUtilities::NekManager< IndexMapKey, IndexMapValues, IndexMapKey::opLessm_IndexMapManager
 
- Protected Attributes inherited from Nektar::LocalRegions::Expansion1D
std::map< int, bool > m_negatedNormals
 
- Protected Attributes inherited from Nektar::LocalRegions::Expansion
SpatialDomains::GeometrySharedPtr m_geom
 
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
 
MetricMap m_metrics
 

Detailed Description

Defines a Segment local expansion.

Definition at line 51 of file SegExp.h.

Constructor & Destructor Documentation

◆ SegExp() [1/3]

Nektar::LocalRegions::SegExp::SegExp ( const LibUtilities::BasisKey Ba,
const SpatialDomains::Geometry1DSharedPtr geom 
)

Constructor using BasisKey class for quadrature points and order definition.

Parameters
BaBasis key of segment expansion.
geomDescription of geometry.

Definition at line 59 of file SegExp.cpp.

60  :
61  StdExpansion(Ba.GetNumModes(), 1, Ba),
62  StdExpansion1D(Ba.GetNumModes(), Ba),
63  StdRegions::StdSegExp(Ba),
64  Expansion(geom),
65  Expansion1D(geom),
67  std::bind(&SegExp::CreateMatrix, this, std::placeholders::_1),
68  std::string("SegExpMatrix")),
70  std::bind(&SegExp::CreateStaticCondMatrix, this, std::placeholders::_1),
71  std::string("SegExpStaticCondMatrix"))
72  {
73  }
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: SegExp.h:249
Expansion(SpatialDomains::GeometrySharedPtr pGeom)
Definition: Expansion.cpp:47
Expansion1D(SpatialDomains::Geometry1DSharedPtr pGeom)
Definition: Expansion1D.h:60
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1451
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1217
StdExpansion()
Default Constructor.
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: SegExp.h:247

◆ SegExp() [2/3]

Nektar::LocalRegions::SegExp::SegExp ( const SegExp S)

Copy Constructor.

Parameters
SExisting segment to duplicate.

Definition at line 80 of file SegExp.cpp.

80  :
81  StdExpansion(S),
82  StdExpansion1D(S),
83  StdRegions::StdSegExp(S),
84  Expansion(S),
85  Expansion1D(S),
86  m_matrixManager(S.m_matrixManager),
87  m_staticCondMatrixManager(S.m_staticCondMatrixManager)
88  {
89  }
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: SegExp.h:249
Expansion(SpatialDomains::GeometrySharedPtr pGeom)
Definition: Expansion.cpp:47
Expansion1D(SpatialDomains::Geometry1DSharedPtr pGeom)
Definition: Expansion1D.h:60
StdExpansion()
Default Constructor.
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: SegExp.h:247

◆ ~SegExp()

Nektar::LocalRegions::SegExp::~SegExp ( )

Definition at line 95 of file SegExp.cpp.

96  {
97  }

◆ SegExp() [3/3]

Nektar::LocalRegions::SegExp::SegExp ( )
private

Member Function Documentation

◆ CreateMatrix()

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

Definition at line 1217 of file SegExp.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL1, ASSERTL2, Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::eFactorGaussVertex, Nektar::StdRegions::eFactorLambda, Nektar::ErrorUtil::efatal, Nektar::StdRegions::eHelmholtz, Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::StdRegions::eHybridDGHelmholtz, Nektar::StdRegions::eHybridDGLamToQ0, Nektar::StdRegions::eHybridDGLamToU, Nektar::StdRegions::eInterpGauss, Nektar::StdRegions::eInvHybridDGHelmholtz, Nektar::StdRegions::eInvMass, Nektar::StdRegions::eLaplacian, Nektar::StdRegions::eMass, Nektar::SpatialDomains::eNoGeomType, Nektar::StdRegions::eWeakDeriv0, Nektar::StdRegions::eWeakDeriv1, Nektar::StdRegions::eWeakDeriv2, Nektar::StdRegions::StdExpansion::GenMatrix(), Nektar::StdRegions::StdMatrixKey::GetConstFactor(), Nektar::StdRegions::StdMatrixKey::GetConstFactors(), Nektar::StdRegions::StdMatrixKey::GetMatrixType(), Nektar::StdRegions::StdMatrixKey::GetNVarCoeff(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdMatrixKey::GetShapeType(), Nektar::StdRegions::StdExpansion::GetStdMatrix(), Nektar::StdRegions::StdMatrixKey::GetVarCoeffs(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_geom, m_matrixManager, Nektar::LocalRegions::Expansion::m_metricinfo, and NEKERROR.

1218  {
1219  DNekScalMatSharedPtr returnval;
1220  NekDouble fac;
1222 
1223  ASSERTL2(m_metricinfo->GetGtype() !=
1225  "Geometric information is not set up");
1226 
1227  switch (mkey.GetMatrixType())
1228  {
1229  case StdRegions::eMass:
1230  {
1231  if ((m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1232  || (mkey.GetNVarCoeff()))
1233  {
1234  fac = 1.0;
1235  goto UseLocRegionsMatrix;
1236  }
1237  else
1238  {
1239  fac = (m_metricinfo->GetJac(ptsKeys))[0];
1240  goto UseStdRegionsMatrix;
1241  }
1242  }
1243  break;
1244  case StdRegions::eInvMass:
1245  {
1246  if ((m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1247  || (mkey.GetNVarCoeff()))
1248  {
1249  NekDouble one = 1.0;
1250  StdRegions::StdMatrixKey masskey(
1251  StdRegions::eMass,DetShapeType(), *this);
1252  DNekMatSharedPtr mat = GenMatrix(masskey);
1253  mat->Invert();
1254 
1255  returnval = MemoryManager<DNekScalMat>::
1256  AllocateSharedPtr(one,mat);
1257  }
1258  else
1259  {
1260  fac = 1.0/(m_metricinfo->GetJac(ptsKeys))[0];
1261  goto UseStdRegionsMatrix;
1262  }
1263  }
1264  break;
1268  {
1269  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed ||
1270  mkey.GetNVarCoeff())
1271  {
1272  fac = 1.0;
1273  goto UseLocRegionsMatrix;
1274  }
1275  else
1276  {
1277  int dir = 0;
1278  switch(mkey.GetMatrixType())
1279  {
1281  dir = 0;
1282  break;
1284  ASSERTL1(m_geom->GetCoordim() >= 2,
1285  "Cannot call eWeakDeriv2 in a "
1286  "coordinate system which is not at "
1287  "least two-dimensional");
1288  dir = 1;
1289  break;
1291  ASSERTL1(m_geom->GetCoordim() == 3,
1292  "Cannot call eWeakDeriv2 in a "
1293  "coordinate system which is not "
1294  "three-dimensional");
1295  dir = 2;
1296  break;
1297  default:
1298  break;
1299  }
1300 
1301  MatrixKey deriv0key(StdRegions::eWeakDeriv0,
1302  mkey.GetShapeType(), *this);
1303 
1304  DNekMatSharedPtr WeakDerivStd = GetStdMatrix(deriv0key);
1305  fac = m_metricinfo->GetDerivFactors(ptsKeys)[dir][0]*
1306  m_metricinfo->GetJac(ptsKeys)[0];
1307 
1308  returnval = MemoryManager<DNekScalMat>::
1309  AllocateSharedPtr(fac,WeakDerivStd);
1310  }
1311  }
1312  break;
1314  {
1315  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1316  {
1317  fac = 1.0;
1318  goto UseLocRegionsMatrix;
1319  }
1320  else
1321  {
1322  int coordim = m_geom->GetCoordim();
1323  fac = 0.0;
1324  for (int i = 0; i < coordim; ++i)
1325  {
1326  fac += m_metricinfo->GetDerivFactors(ptsKeys)[i][0]*
1327  m_metricinfo->GetDerivFactors(ptsKeys)[i][0];
1328  }
1329  fac *= m_metricinfo->GetJac(ptsKeys)[0];
1330  goto UseStdRegionsMatrix;
1331  }
1332  }
1333  break;
1335  {
1336  NekDouble factor =
1337  mkey.GetConstFactor(StdRegions::eFactorLambda);
1338  MatrixKey masskey(StdRegions::eMass,
1339  mkey.GetShapeType(), *this);
1340  DNekScalMat &MassMat = *(this->m_matrixManager[masskey]);
1341  MatrixKey lapkey(StdRegions::eLaplacian, mkey.GetShapeType(),
1342  *this, mkey.GetConstFactors(),
1343  mkey.GetVarCoeffs());
1344  DNekScalMat &LapMat = *(this->m_matrixManager[lapkey]);
1345 
1346  int rows = LapMat.GetRows();
1347  int cols = LapMat.GetColumns();
1348 
1349  DNekMatSharedPtr helm =
1351 
1352  NekDouble one = 1.0;
1353  (*helm) = LapMat + factor*MassMat;
1354 
1355  returnval =
1357  }
1358  break;
1363  {
1364  NekDouble one = 1.0;
1365 
1366  DNekMatSharedPtr mat = GenMatrix(mkey);
1367  returnval =
1369  }
1370  break;
1372  {
1373  NekDouble one = 1.0;
1374 
1375 // StdRegions::StdMatrixKey hkey(StdRegions::eHybridDGHelmholtz,
1376 // DetShapeType(),*this,
1377 // mkey.GetConstant(0),
1378 // mkey.GetConstant(1));
1379  MatrixKey hkey(StdRegions::eHybridDGHelmholtz,
1380  DetShapeType(),
1381  *this, mkey.GetConstFactors(),
1382  mkey.GetVarCoeffs());
1383  DNekMatSharedPtr mat = GenMatrix(hkey);
1384 
1385  mat->Invert();
1386  returnval =
1388  }
1389  break;
1391  {
1392  DNekMatSharedPtr m_Ix;
1393  Array<OneD, NekDouble> coords(1, 0.0);
1394  StdRegions::ConstFactorMap factors = mkey.GetConstFactors();
1395  int vertex = (int)factors[StdRegions::eFactorGaussVertex];
1396 
1397  coords[0] = (vertex == 0) ? -1.0 : 1.0;
1398 
1399  m_Ix = m_base[0]->GetI(coords);
1400  returnval =
1402  }
1403  break;
1404 
1405  UseLocRegionsMatrix:
1406  {
1407  DNekMatSharedPtr mat = GenMatrix(mkey);
1408  returnval =
1410  }
1411  break;
1412  UseStdRegionsMatrix:
1413  {
1414  DNekMatSharedPtr mat = GetStdMatrix(mkey);
1415  returnval =
1417  }
1418  break;
1419  default:
1420  NEKERROR(ErrorUtil::efatal, "Matrix creation not defined");
1421  break;
1422  }
1423 
1424  return returnval;
1425  }
DNekMatSharedPtr GenMatrix(const StdMatrixKey &mkey)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:209
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:246
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:469
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:128
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:294
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:127
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:714
const LibUtilities::PointsKeyVector GetPointsKeys() const
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
double NekDouble
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:274
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
Array< OneD, LibUtilities::BasisSharedPtr > m_base
Geometry is curved or has non-constant factors.
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: SegExp.h:247

◆ CreateStaticCondMatrix()

DNekScalBlkMatSharedPtr Nektar::LocalRegions::SegExp::CreateStaticCondMatrix ( const MatrixKey mkey)
protected
Todo:
Really need a constructor which takes Arrays

Definition at line 1451 of file SegExp.cpp.

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

1453  {
1454  DNekScalBlkMatSharedPtr returnval;
1455 
1456  ASSERTL2(m_metricinfo->GetGtype() !=
1458  "Geometric information is not set up");
1459 
1460  // set up block matrix system
1461  int nbdry = NumBndryCoeffs();
1462  int nint = m_ncoeffs - nbdry;
1463  Array<OneD, unsigned int> exp_size(2);
1464  exp_size[0] = nbdry;
1465  exp_size[1] = nint;
1466 
1467  /// \todo Really need a constructor which takes Arrays
1469  AllocateSharedPtr(exp_size,exp_size);
1470  NekDouble factor = 1.0;
1471 
1472  switch (mkey.GetMatrixType())
1473  {
1475  case StdRegions::eHelmholtz: // special case since Helmholtz
1476  // not defined in StdRegions
1477 
1478  // use Deformed case for both regular and deformed geometries
1479  factor = 1.0;
1480  goto UseLocRegionsMatrix;
1481  break;
1482  default:
1483  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1484  {
1485  factor = 1.0;
1486  goto UseLocRegionsMatrix;
1487  }
1488  else
1489  {
1490  DNekScalMatSharedPtr mat = GetLocMatrix(mkey);
1491  factor = mat->Scale();
1492  goto UseStdRegionsMatrix;
1493  }
1494  break;
1495  UseStdRegionsMatrix:
1496  {
1497  NekDouble invfactor = 1.0/factor;
1498  NekDouble one = 1.0;
1500  DNekScalMatSharedPtr Atmp;
1501  DNekMatSharedPtr Asubmat;
1502 
1503  returnval->SetBlock(0,0,Atmp =
1505  factor,Asubmat = mat->GetBlock(0,0)));
1506  returnval->SetBlock(0,1,Atmp =
1508  one,Asubmat = mat->GetBlock(0,1)));
1509  returnval->SetBlock(1,0,Atmp =
1511  factor,Asubmat = mat->GetBlock(1,0)));
1512  returnval->SetBlock(1,1,Atmp =
1514  invfactor,Asubmat = mat->GetBlock(1,1)));
1515  }
1516  break;
1517  UseLocRegionsMatrix:
1518  {
1519  int i,j;
1520  NekDouble invfactor = 1.0/factor;
1521  NekDouble one = 1.0;
1522  DNekScalMat &mat = *GetLocMatrix(mkey);
1525  DNekMatSharedPtr B =
1527  DNekMatSharedPtr C =
1529  DNekMatSharedPtr D =
1531 
1532  Array<OneD,unsigned int> bmap(nbdry);
1533  Array<OneD,unsigned int> imap(nint);
1534  GetBoundaryMap(bmap);
1535  GetInteriorMap(imap);
1536 
1537  for (i = 0; i < nbdry; ++i)
1538  {
1539  for (j = 0; j < nbdry; ++j)
1540  {
1541  (*A)(i,j) = mat(bmap[i],bmap[j]);
1542  }
1543 
1544  for (j = 0; j < nint; ++j)
1545  {
1546  (*B)(i,j) = mat(bmap[i],imap[j]);
1547  }
1548  }
1549 
1550  for (i = 0; i < nint; ++i)
1551  {
1552  for (j = 0; j < nbdry; ++j)
1553  {
1554  (*C)(i,j) = mat(imap[i],bmap[j]);
1555  }
1556 
1557  for (j = 0; j < nint; ++j)
1558  {
1559  (*D)(i,j) = mat(imap[i],imap[j]);
1560  }
1561  }
1562 
1563  // Calculate static condensed system
1564  if (nint)
1565  {
1566  D->Invert();
1567  (*B) = (*B)*(*D);
1568  (*A) = (*A) - (*B)*(*C);
1569  }
1570 
1571  DNekScalMatSharedPtr Atmp;
1572 
1573  returnval->SetBlock(0,0,Atmp = MemoryManager<DNekScalMat>::
1574  AllocateSharedPtr(factor,A));
1575  returnval->SetBlock(0,1,Atmp = MemoryManager<DNekScalMat>::
1576  AllocateSharedPtr(one,B));
1577  returnval->SetBlock(1,0,Atmp = MemoryManager<DNekScalMat>::
1578  AllocateSharedPtr(factor,C));
1579  returnval->SetBlock(1,1,Atmp = MemoryManager<DNekScalMat>::
1580  AllocateSharedPtr(invfactor,D));
1581  }
1582  }
1583 
1584 
1585  return returnval;
1586  }
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:73
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:128
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
std::shared_ptr< DNekBlkMat > DNekBlkMatSharedPtr
Definition: NekTypeDefs.hpp:71
DNekBlkMatSharedPtr GetStdStaticCondMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:719
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
void GetInteriorMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:817
double NekDouble
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition: Expansion.cpp:85
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:274
Geometry is curved or has non-constant factors.
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:812

◆ MultiplyByElmtInvMass()

void Nektar::LocalRegions::SegExp::MultiplyByElmtInvMass ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
private
Todo:
Same method exists in ExpList and everyone references ExpList::MultiplyByElmtInvMass. Remove this one?

Definition at line 1640 of file SegExp.cpp.

References Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::eCopy, Nektar::StdRegions::eInvMass, Nektar::eWrapper, m_matrixManager, and Nektar::StdRegions::StdExpansion::m_ncoeffs.

1643  {
1644  // get Mass matrix inverse
1645  MatrixKey masskey(StdRegions::eInvMass,
1646  DetShapeType(),*this);
1647  DNekScalMatSharedPtr matsys = m_matrixManager[masskey];
1648 
1649  NekVector<NekDouble> in(m_ncoeffs,inarray,eCopy);
1650  NekVector<NekDouble> out(m_ncoeffs,outarray,eWrapper);
1651 
1652  out = (*matsys)*in;
1653  }
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:469
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: SegExp.h:247

◆ ReverseCoeffsAndSign()

void Nektar::LocalRegions::SegExp::ReverseCoeffsAndSign ( const Array< OneD, NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
private

Reverse the coefficients in a boundary interior expansion this routine is of use when we need the segment coefficients corresponding to a expansion in the reverse coordinate direction.

Definition at line 1598 of file SegExp.cpp.

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

Referenced by v_SetCoeffsToOrientation().

1601  {
1602 
1603  int m;
1604  NekDouble sgn = 1;
1605 
1606  ASSERTL1(&inarray[0] != &outarray[0],
1607  "inarray and outarray can not be the same");
1608  switch(GetBasisType(0))
1609  {
1611  //Swap vertices
1612  outarray[0] = inarray[1];
1613  outarray[1] = inarray[0];
1614  // negate odd modes
1615  for(m = 2; m < m_ncoeffs; ++m)
1616  {
1617  outarray[m] = sgn*inarray[m];
1618  sgn = -sgn;
1619  }
1620  break;
1623  for(m = 0; m < m_ncoeffs; ++m)
1624  {
1625  outarray[m_ncoeffs-1-m] = inarray[m];
1626  }
1627  break;
1628  default:
1629  ASSERTL0(false,"This basis is not allowed in this method");
1630  break;
1631  }
1632  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
Principle Modified Functions .
Definition: BasisType.h:48
Lagrange Polynomials using the Gauss points .
Definition: BasisType.h:55
double NekDouble
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164
Lagrange for SEM basis .
Definition: BasisType.h:54
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250

◆ v_ComputeVertexNormal()

void Nektar::LocalRegions::SegExp::v_ComputeVertexNormal ( const int  vertex)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 902 of file SegExp.cpp.

References ASSERTL0, Nektar::SpatialDomains::eMovingRegular, Nektar::SpatialDomains::eRegular, Vmath::Fill(), Nektar::StdRegions::StdExpansion::GetCoordim(), Nektar::LocalRegions::Expansion::GetGeom(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion1D::m_vertexNormals, and Vmath::Smul().

903  {
904  int i;
905  const SpatialDomains::GeomFactorsSharedPtr &geomFactors =
906  GetGeom()->GetMetricInfo();
907  SpatialDomains::GeomType type = geomFactors->GetGtype();
908  const Array<TwoD, const NekDouble> &gmat =
909  geomFactors->GetDerivFactors(GetPointsKeys());
910  int nqe = 1;
911  int vCoordDim = GetCoordim();
912 
913  m_vertexNormals[vertex] =
914  Array<OneD, Array<OneD, NekDouble> >(vCoordDim);
915  Array<OneD, Array<OneD, NekDouble> > &normal =
916  m_vertexNormals[vertex];
917  for (i = 0; i < vCoordDim; ++i)
918  {
919  normal[i] = Array<OneD, NekDouble>(nqe);
920  }
921 
922  // Regular geometry case
923  if ((type == SpatialDomains::eRegular) ||
925  {
926  NekDouble vert;
927  // Set up normals
928  switch (vertex)
929  {
930  case 0:
931  for(i = 0; i < vCoordDim; ++i)
932  {
933  Vmath::Fill(nqe, -gmat[i][0], normal[i], 1);
934  }
935  break;
936  case 1:
937  for(i = 0; i < vCoordDim; ++i)
938  {
939  Vmath::Fill(nqe, gmat[i][0], normal[i], 1);
940  }
941  break;
942  default:
943  ASSERTL0(false,
944  "point is out of range (point < 2)");
945  }
946 
947  // normalise
948  vert = 0.0;
949  for (i =0 ; i < vCoordDim; ++i)
950  {
951  vert += normal[i][0]*normal[i][0];
952  }
953  vert = 1.0/sqrt(vert);
954  for (i = 0; i < vCoordDim; ++i)
955  {
956  Vmath::Smul(nqe, vert, normal[i], 1, normal[i], 1);
957  }
958  }
959  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
std::map< int, NormalVector > m_vertexNormals
SpatialDomains::GeometrySharedPtr GetGeom() const
Definition: Expansion.cpp:167
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition: GeomFactors.h:62
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:45
const LibUtilities::PointsKeyVector GetPointsKeys() const
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
double NekDouble
Geometry is straight-sided with constant geometric factors.
GeomType
Indicates the type of element geometry.

◆ v_CreateStdMatrix()

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

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 1206 of file SegExp.cpp.

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

1208  {
1209  LibUtilities::BasisKey bkey = m_base[0]->GetBasisKey();
1212 
1213  return tmp->GetStdMatrix(mkey);
1214  }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< StdSegExp > StdSegExpSharedPtr
Definition: StdSegExp.h:46
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_DropLocStaticCondMatrix()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1195 of file SegExp.cpp.

References m_staticCondMatrixManager.

1196  {
1197  m_staticCondMatrixManager.DeleteObject(mkey);
1198  }
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: SegExp.h:249

◆ v_ExtractDataToCoeffs()

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

Unpack data from input file assuming it comes from.

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 849 of file SegExp.cpp.

References ASSERTL0, Nektar::LibUtilities::eGauss_Lagrange, Nektar::LibUtilities::eGaussGaussLegendre, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eModified_A, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::LibUtilities::Interp1D(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, Vmath::Vcopy(), and Vmath::Zero().

855  {
856  boost::ignore_unused(fromType);
857 
858  switch(m_base[0]->GetBasisType())
859  {
861  {
862  int fillorder = min((int) nummodes[mode_offset],m_ncoeffs);
863 
864  Vmath::Zero(m_ncoeffs,coeffs,1);
865  Vmath::Vcopy(fillorder,&data[0],1,&coeffs[0],1);
866  }
867  break;
869  {
870  // Assume that input is also Gll_Lagrange
871  // but no way to check;
872  LibUtilities::PointsKey f0(
873  nummodes[mode_offset],
875  LibUtilities::PointsKey t0(
876  m_base[0]->GetNumModes(),
879  f0,data, t0, coeffs);
880  }
881  break;
883  {
884  // Assume that input is also Gauss_Lagrange
885  // but no way to check;
886  LibUtilities::PointsKey f0(
887  nummodes[mode_offset],
889  LibUtilities::PointsKey t0(
890  m_base[0]->GetNumModes(),
893  f0,data, t0, coeffs);
894  }
895  break;
896  default:
897  ASSERTL0(false,
898  "basis is either not set up or not hierarchicial");
899  }
900  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
Principle Modified Functions .
Definition: BasisType.h:48
Lagrange Polynomials using the Gauss points .
Definition: BasisType.h:55
1D Gauss-Gauss-Legendre quadrature points
Definition: PointsType.h:48
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164
void Interp1D(const BasisKey &fbasis0, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, Array< OneD, NekDouble > &to)
this function interpolates a 1D function evaluated at the quadrature points of the basis fbasis0 to ...
Definition: Interp.cpp:53
Lagrange for SEM basis .
Definition: BasisType.h:54
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:376
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:51

◆ v_FwdTrans()

void Nektar::LocalRegions::SegExp::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 outarray.

Perform a forward transform using a Galerkin projection by taking the inner product of the physical points and multiplying by the inverse of the mass matrix using the Solve method of the standard matrix container holding the local mass matrix, i.e. \( {\bf \hat{u}} = {\bf M}^{-1} {\bf I} \) where \( {\bf I}[p] = \int^1_{-1} \phi_p(\xi_1) u(\xi_1) d\xi_1 \)

Inputs:

  • inarray: array of physical quadrature points to be transformed

Outputs:

  • outarray: updated array of expansion coefficients.

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 377 of file SegExp.cpp.

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

Referenced by v_FwdTrans_BndConstrained().

380  {
381  if (m_base[0]->Collocation())
382  {
383  Vmath::Vcopy(m_ncoeffs, inarray, 1, outarray, 1);
384  }
385  else
386  {
387  v_IProductWRTBase(inarray,outarray);
388 
389  // get Mass matrix inverse
390  MatrixKey masskey(StdRegions::eInvMass, DetShapeType(), *this);
391  DNekScalMatSharedPtr matsys = m_matrixManager[masskey];
392 
393  // copy inarray in case inarray == outarray
394  NekVector<NekDouble> in(m_ncoeffs,outarray,eCopy);
395  NekVector<NekDouble> out(m_ncoeffs,outarray,eWrapper);
396 
397  out = (*matsys)*in;
398  }
399  }
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:469
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the expansion basis (this)->_Base[0] and return ...
Definition: SegExp.cpp:506
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: SegExp.h:247

◆ v_FwdTrans_BndConstrained()

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

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 401 of file SegExp.cpp.

References ASSERTL0, ASSERTL1, Nektar::StdRegions::StdExpansion::DetShapeType(), Blas::Dgemv(), Nektar::LibUtilities::eGauss_Lagrange, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGLL_Lagrange, Nektar::StdRegions::eMass, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, Nektar::LibUtilities::ePolyEvenlySpaced, Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::StdRegions::StdExpansion::GetVertexMap(), Nektar::StdRegions::StdExpansion::m_base, Nektar::StdRegions::StdExpansion::m_ncoeffs, m_staticCondMatrixManager, Nektar::StdRegions::StdExpansion::MassMatrixOp(), v_FwdTrans(), v_IProductWRTBase(), Vmath::Vcopy(), and Vmath::Vsub().

404  {
405  if(m_base[0]->Collocation())
406  {
407  Vmath::Vcopy(m_ncoeffs, inarray, 1, outarray, 1);
408  }
409  else
410  {
411  int nInteriorDofs = m_ncoeffs-2;
412  int offset = 0;
413 
414  switch (m_base[0]->GetBasisType())
415  {
417  {
418  offset = 1;
419  }
420  break;
422  {
423  nInteriorDofs = m_ncoeffs;
424  offset = 0;
425  }
426  break;
429  {
432  "Cannot use FwdTrans_BndConstrained with these points.");
433  offset = 2;
434  }
435  break;
436  default:
437  ASSERTL0(false,"This type of FwdTrans is not defined"
438  "for this expansion type");
439  }
440 
441  fill(outarray.get(), outarray.get()+m_ncoeffs, 0.0 );
442 
444  {
445 
446  outarray[GetVertexMap(0)] = inarray[0];
447  outarray[GetVertexMap(1)] =
448  inarray[m_base[0]->GetNumPoints()-1];
449 
450  if (m_ncoeffs>2)
451  {
452  // ideally, we would like to have tmp0 to be replaced
453  // by outarray (currently MassMatrixOp does not allow
454  // aliasing)
455  Array<OneD, NekDouble> tmp0(m_ncoeffs);
456  Array<OneD, NekDouble> tmp1(m_ncoeffs);
457 
458  StdRegions::StdMatrixKey stdmasskey(
460  MassMatrixOp(outarray,tmp0,stdmasskey);
461  v_IProductWRTBase(inarray,tmp1);
462 
463  Vmath::Vsub(m_ncoeffs, tmp1, 1, tmp0, 1, tmp1, 1);
464 
465  // get Mass matrix inverse (only of interior DOF)
466  MatrixKey masskey(
468  DNekScalMatSharedPtr matsys =
469  (m_staticCondMatrixManager[masskey])->GetBlock(1,1);
470 
471  Blas::Dgemv('N',nInteriorDofs,nInteriorDofs,
472  matsys->Scale(),
473  &((matsys->GetOwnedMatrix())->GetPtr())[0],
474  nInteriorDofs,tmp1.get()+offset,1,0.0,
475  outarray.get()+offset,1);
476  }
477  }
478  else
479  {
480  SegExp::v_FwdTrans(inarray, outarray);
481 
482  }
483  }
484  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
void MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:974
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:469
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: SegExp.h:249
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
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 coeffic...
Definition: SegExp.cpp:377
Principle Modified Functions .
Definition: BasisType.h:48
Lagrange Polynomials using the Gauss points .
Definition: BasisType.h:55
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the expansion basis (this)->_Base[0] and return ...
Definition: SegExp.cpp:506
1D Evenly-spaced points using Lagrange polynomial
Definition: PointsType.h:64
int GetVertexMap(const int localVertexId, bool useCoeffPacking=false)
Definition: StdExpansion.h:822
Principle Modified Functions .
Definition: BasisType.h:49
static void Dgemv(const char &trans, const int &m, const int &n, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
BLAS level 2: Matrix vector multiply y = A x where A[m x n].
Definition: Blas.hpp:168
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.cpp:346
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
Definition: StdExpansion.h:215
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164
Lagrange for SEM basis .
Definition: BasisType.h:54
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:51

◆ v_GenMatrix()

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

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 1427 of file SegExp.cpp.

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

1429  {
1430  DNekMatSharedPtr returnval;
1431 
1432  switch (mkey.GetMatrixType())
1433  {
1440  returnval = Expansion1D::v_GenMatrix(mkey);
1441  break;
1442  default:
1443  returnval = StdSegExp::v_GenMatrix(mkey);
1444  break;
1445  }
1446 
1447  return returnval;
1448  }
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: Expansion1D.cpp:61
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69

◆ v_GetBasis()

const LibUtilities::BasisSharedPtr & Nektar::LocalRegions::SegExp::v_GetBasis ( int  dir) const
protectedvirtual

Definition at line 829 of file SegExp.cpp.

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

830  {
831  return GetBasis(dir);
832  }
const LibUtilities::BasisSharedPtr & GetBasis(int dir) const
This function gets the shared point to basis in the dir direction.
Definition: StdExpansion.h:117

◆ v_GetCoord()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 682 of file SegExp.cpp.

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

685  {
686  int i;
687 
688  ASSERTL1(Lcoords[0] >= -1.0&& Lcoords[0] <= 1.0,
689  "Local coordinates are not in region [-1,1]");
690 
691  m_geom->FillGeom();
692  for(i = 0; i < m_geom->GetCoordim(); ++i)
693  {
694  coords[i] = m_geom->GetCoord(i,Lcoords);
695  }
696  }
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:127
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250

◆ v_GetCoordim()

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

Reimplemented from Nektar::StdRegions::StdExpansion1D.

Definition at line 803 of file SegExp.cpp.

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

804  {
805  return m_geom->GetCoordim();
806  }
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:127

◆ v_GetCoords()

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

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 698 of file SegExp.cpp.

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

702  {
703  Expansion::v_GetCoords(coords_0, coords_1, coords_2);
704  }
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: Expansion.cpp:231

◆ v_GetLinStdExp()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 794 of file SegExp.cpp.

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

795  {
796  LibUtilities::BasisKey bkey0(m_base[0]->GetBasisType(),
797  2, m_base[0]->GetPointsKey());
798 
800  ::AllocateSharedPtr( bkey0);
801  }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:164
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_GetLocMatrix()

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1200 of file SegExp.cpp.

References m_matrixManager.

1201  {
1202  return m_matrixManager[mkey];
1203  }
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: SegExp.h:247

◆ v_GetLocStaticCondMatrix()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1189 of file SegExp.cpp.

References m_staticCondMatrixManager.

1191  {
1192  return m_staticCondMatrixManager[mkey];
1193  }
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: SegExp.h:249

◆ v_GetNcoeffs()

int Nektar::LocalRegions::SegExp::v_GetNcoeffs ( void  ) const
protectedvirtual

Definition at line 824 of file SegExp.cpp.

References Nektar::StdRegions::StdExpansion::m_ncoeffs.

825  {
826  return m_ncoeffs;
827  }

◆ v_GetNumPoints()

int Nektar::LocalRegions::SegExp::v_GetNumPoints ( const int  dir) const
protectedvirtual

Definition at line 819 of file SegExp.cpp.

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

820  {
821  return GetNumPoints(dir);
822  }
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:228

◆ v_GetPhysNormals()

const Array< OneD, const NekDouble > & Nektar::LocalRegions::SegExp::v_GetPhysNormals ( void  )
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 808 of file SegExp.cpp.

References Nektar::ErrorUtil::efatal, NEKERROR, and Nektar::NullNekDouble1DArray.

809  {
810  NEKERROR(ErrorUtil::efatal, "Got to SegExp");
811  return NullNekDouble1DArray;
812  }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:209
static Array< OneD, NekDouble > NullNekDouble1DArray

◆ v_GetStdExp()

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 788 of file SegExp.cpp.

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

789  {
791  ::AllocateSharedPtr(m_base[0]->GetBasisKey());
792  }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_GetTracePhysVals()

void Nektar::LocalRegions::SegExp::v_GetTracePhysVals ( const int  edge,
const StdRegions::StdExpansionSharedPtr EdgeExp,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
StdRegions::Orientation  orient 
)
protectedvirtual

Definition at line 743 of file SegExp.cpp.

References v_GetVertexPhysVals().

749  {
750  boost::ignore_unused(EdgeExp, orient);
751 
752  NekDouble result;
753  v_GetVertexPhysVals(edge, inarray, result);
754  outarray[0] = result;
755  }
double NekDouble
virtual void v_GetVertexPhysVals(const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
Definition: SegExp.cpp:707

◆ v_GetVertexPhysVals()

void Nektar::LocalRegions::SegExp::v_GetVertexPhysVals ( const int  vertex,
const Array< OneD, const NekDouble > &  inarray,
NekDouble outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 707 of file SegExp.cpp.

References Blas::Ddot(), Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::eFactorGaussVertex, Nektar::LibUtilities::eGaussGaussLegendre, Nektar::StdRegions::eInterpGauss, Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::StdRegions::StdExpansion::m_base, and m_matrixManager.

Referenced by v_GetTracePhysVals().

711  {
712  int nquad = m_base[0]->GetNumPoints();
713 
715  {
716  switch (vertex)
717  {
718  case 0:
719  outarray = inarray[0];
720  break;
721  case 1:
722  outarray = inarray[nquad - 1];
723  break;
724  }
725  }
726  else
727  {
729  factors[StdRegions::eFactorGaussVertex] = vertex;
730 
731  StdRegions::StdMatrixKey key(
733  DetShapeType(),*this,factors);
734 
735  DNekScalMatSharedPtr mat_gauss = m_matrixManager[key];
736 
737  outarray = Blas::Ddot(nquad, mat_gauss->GetOwnedMatrix()
738  ->GetPtr().get(), 1, &inarray[0], 1);
739  }
740  }
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:469
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:294
1D Gauss-Gauss-Legendre quadrature points
Definition: PointsType.h:48
static double Ddot(const int &n, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: output = .
Definition: Blas.hpp:140
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
Definition: StdExpansion.h:215
Array< OneD, LibUtilities::BasisSharedPtr > m_base
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: SegExp.h:247

◆ v_HelmholtzMatrixOp()

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

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 1074 of file SegExp.cpp.

References ASSERTL0, Nektar::StdRegions::StdExpansion::BwdTrans(), Blas::Daxpy(), Blas::Dscal(), Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::eFactorLambda, Nektar::StdRegions::StdMatrixKey::GetConstFactor(), Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_geom, Nektar::LocalRegions::Expansion::m_metricinfo, Nektar::StdRegions::StdExpansion::m_ncoeffs, Nektar::StdRegions::StdExpansion::PhysDeriv(), v_IProductWRTBase(), Vmath::Vmul(), and Vmath::Vvtvp().

1078  {
1079  int nquad = m_base[0]->GetNumPoints();
1080  const Array<TwoD, const NekDouble>& gmat =
1081  m_metricinfo->GetDerivFactors(GetPointsKeys());
1082  const NekDouble lambda =
1083  mkey.GetConstFactor(StdRegions::eFactorLambda);
1084 
1085  Array<OneD,NekDouble> physValues(nquad);
1086  Array<OneD,NekDouble> dPhysValuesdx(nquad);
1087  Array<OneD,NekDouble> wsp(m_ncoeffs);
1088 
1089  BwdTrans(inarray, physValues);
1090 
1091  // mass matrix operation
1092  v_IProductWRTBase((m_base[0]->GetBdata()),physValues,wsp,1);
1093 
1094  // Laplacian matrix operation
1095  switch (m_geom->GetCoordim())
1096  {
1097  case 1:
1098  {
1099  PhysDeriv(physValues,dPhysValuesdx);
1100 
1101  // multiply with the proper geometric factors
1102  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1103  {
1104  Vmath::Vmul(nquad,
1105  &gmat[0][0],1,dPhysValuesdx.get(),1,
1106  dPhysValuesdx.get(),1);
1107  }
1108  else
1109  {
1110  Blas::Dscal(nquad, gmat[0][0], dPhysValuesdx.get(), 1);
1111  }
1112  }
1113  break;
1114  case 2:
1115  {
1116  Array<OneD,NekDouble> dPhysValuesdy(nquad);
1117 
1118  PhysDeriv(physValues, dPhysValuesdx, dPhysValuesdy);
1119 
1120  // multiply with the proper geometric factors
1121  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1122  {
1123  Vmath::Vmul (nquad,
1124  &gmat[0][0], 1, dPhysValuesdx.get(), 1,
1125  dPhysValuesdx.get(), 1);
1126  Vmath::Vvtvp(nquad,
1127  &gmat[1][0], 1, dPhysValuesdy.get(), 1,
1128  dPhysValuesdx.get(), 1,
1129  dPhysValuesdx.get(), 1);
1130  }
1131  else
1132  {
1133  Blas::Dscal(nquad, gmat[0][0], dPhysValuesdx.get(), 1);
1134  Blas::Daxpy(nquad,
1135  gmat[1][0], dPhysValuesdy.get(), 1,
1136  dPhysValuesdx.get(), 1);
1137  }
1138  }
1139  break;
1140  case 3:
1141  {
1142  Array<OneD,NekDouble> dPhysValuesdy(nquad);
1143  Array<OneD,NekDouble> dPhysValuesdz(nquad);
1144 
1145  PhysDeriv(physValues, dPhysValuesdx,
1146  dPhysValuesdy, dPhysValuesdz);
1147 
1148  // multiply with the proper geometric factors
1149  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1150  {
1151  Vmath::Vmul (nquad,
1152  &gmat[0][0], 1, dPhysValuesdx.get(), 1,
1153  dPhysValuesdx.get(), 1);
1154  Vmath::Vvtvp(nquad,
1155  &gmat[1][0], 1, dPhysValuesdy.get(), 1,
1156  dPhysValuesdx.get(), 1,
1157  dPhysValuesdx.get(), 1);
1158  Vmath::Vvtvp(nquad,
1159  &gmat[2][0], 1, dPhysValuesdz.get(), 1,
1160  dPhysValuesdx.get(), 1,
1161  dPhysValuesdx.get(), 1);
1162  }
1163  else
1164  {
1165  Blas::Dscal(nquad, gmat[0][0], dPhysValuesdx.get(), 1);
1166  Blas::Daxpy(nquad,
1167  gmat[1][0], dPhysValuesdy.get(), 1,
1168  dPhysValuesdx.get(), 1);
1169  Blas::Daxpy(nquad,
1170  gmat[2][0], dPhysValuesdz.get(),
1171  1, dPhysValuesdx.get(), 1);
1172  }
1173  }
1174  break;
1175  default:
1176  ASSERTL0(false,"Wrong number of dimensions");
1177  break;
1178  }
1179 
1180  v_IProductWRTBase(m_base[0]->GetDbdata(),dPhysValuesdx,outarray,1);
1181  Blas::Daxpy(m_ncoeffs, lambda, wsp.get(), 1, outarray.get(), 1);
1182  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
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:445
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:128
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:127
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the expansion basis (this)->_Base[0] and return ...
Definition: SegExp.cpp:506
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)
const LibUtilities::PointsKeyVector GetPointsKeys() const
double NekDouble
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
Definition: Blas.hpp:125
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Backward transformation from coefficient space to physical space...
Definition: StdExpansion.h:530
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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:110
Geometry is curved or has non-constant factors.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ v_Integral()

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

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

Inputs:

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

Outputs:

  • returns \(\int^1_{-1} u(\xi_1)d \xi_1 \) where \(inarray[i] = u(\xi_{1i}) \)

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 118 of file SegExp.cpp.

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

120  {
121  int nquad0 = m_base[0]->GetNumPoints();
122  Array<OneD, const NekDouble> jac = m_metricinfo->GetJac(GetPointsKeys());
123  NekDouble ival;
124  Array<OneD,NekDouble> tmp(nquad0);
125 
126  // multiply inarray with Jacobian
127  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
128  {
129  Vmath::Vmul(nquad0, jac, 1, inarray, 1, tmp,1);
130  }
131  else
132  {
133  Vmath::Smul(nquad0, jac[0], inarray, 1, tmp, 1);
134  }
135 
136  // call StdSegExp version;
137  ival = StdSegExp::v_Integral(tmp);
138  //ival = StdSegExp::Integral(tmp);
139  return ival;
140  }
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:128
const LibUtilities::PointsKeyVector GetPointsKeys() const
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
double NekDouble
Array< OneD, LibUtilities::BasisSharedPtr > m_base
Geometry is curved or has non-constant factors.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ v_IProductWRTBase() [1/2]

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

Inner product of inarray over region with respect to the expansion basis (this)->_Base[0] and return in outarray.

Wrapper call to SegExp::IProduct_WRT_B

Input:

  • inarray: array of function evaluated at the physical collocation points

Output:

  • outarray: array of inner product with respect to each basis over region

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 506 of file SegExp.cpp.

References Nektar::StdRegions::StdExpansion::m_base.

Referenced by v_FwdTrans(), v_FwdTrans_BndConstrained(), v_HelmholtzMatrixOp(), v_IProductWRTDerivBase(), v_LaplacianMatrixOp(), and v_NormVectorIProductWRTBase().

509  {
510  v_IProductWRTBase(m_base[0]->GetBdata(),inarray,outarray,1);
511  }
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the expansion basis (this)->_Base[0] and return ...
Definition: SegExp.cpp:506
Array< OneD, LibUtilities::BasisSharedPtr > m_base

◆ v_IProductWRTBase() [2/2]

void Nektar::LocalRegions::SegExp::v_IProductWRTBase ( const Array< OneD, const NekDouble > &  base,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray,
int  coll_check 
)
protectedvirtual

Inner product of inarray over region with respect to expansion basis base and return in outarray.

Calculate \( I[p] = \int^{1}_{-1} \phi_p(\xi_1) u(\xi_1) d\xi_1 = \sum_{i=0}^{nq-1} \phi_p(\xi_{1i}) u(\xi_{1i}) w_i \) where \( outarray[p] = I[p], inarray[i] = u(\xi_{1i}), base[p*nq+i] = \phi_p(\xi_{1i}) \).

Inputs:

  • base: an array definiing the local basis for the inner product usually passed from Basis->get_bdata() or Basis->get_Dbdata()
  • inarray: physical point array of function to be integrated \( u(\xi_1) \)
  • coll_check: Flag to identify when a Basis->collocation() call should be performed to see if this is a GLL_Lagrange basis with a collocation property. (should be set to 0 if taking the inner product with respect to the derivative of basis)

Output:

  • outarray: array of coefficients representing the inner product of function with ever mode in the exapnsion

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 541 of file SegExp.cpp.

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

546  {
547  int nquad0 = m_base[0]->GetNumPoints();
548  Array<OneD, const NekDouble> jac = m_metricinfo->GetJac(GetPointsKeys());
549  Array<OneD,NekDouble> tmp(nquad0);
550 
551 
552  // multiply inarray with Jacobian
553  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
554  {
555  Vmath::Vmul(nquad0, jac, 1, inarray, 1, tmp, 1);
556  }
557  else
558  {
559  Vmath::Smul(nquad0, jac[0], inarray, 1, tmp, 1);
560  }
561  StdSegExp::v_IProductWRTBase(base,tmp,outarray,coll_check);
562  }
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:128
const LibUtilities::PointsKeyVector GetPointsKeys() const
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
Array< OneD, LibUtilities::BasisSharedPtr > m_base
Geometry is curved or has non-constant factors.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ v_IProductWRTDerivBase()

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

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 565 of file SegExp.cpp.

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

569  {
570  int nquad = m_base[0]->GetNumPoints();
571  const Array<TwoD, const NekDouble>& gmat =
572  m_metricinfo->GetDerivFactors(GetPointsKeys());
573 
574  Array<OneD, NekDouble> tmp1(nquad);
575 
576  switch(dir)
577  {
578  case 0:
579  {
580  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
581  {
582  Vmath::Vmul(nquad,gmat[0],1,inarray,1,tmp1,1);
583  }
584  else
585  {
586  Vmath::Smul(nquad, gmat[0][0], inarray, 1, tmp1, 1);
587  }
588  }
589  break;
590  case 1:
591  {
592  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
593  {
594  Vmath::Vmul(nquad,gmat[1],1,inarray,1,tmp1,1);
595  }
596  else
597  {
598  Vmath::Smul(nquad, gmat[1][0], inarray, 1, tmp1, 1);
599  }
600  }
601  break;
602  case 2:
603  {
604  ASSERTL1(m_geom->GetCoordim() == 3,"input dir is out of range");
605  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
606  {
607  Vmath::Vmul(nquad,gmat[2],1,inarray,1,tmp1,1);
608  }
609  else
610  {
611  Vmath::Smul(nquad, gmat[2][0], inarray, 1, tmp1, 1);
612  }
613  }
614  break;
615  default:
616  {
617  ASSERTL1(false,"input dir is out of range");
618  }
619  break;
620  }
621  v_IProductWRTBase(m_base[0]->GetDbdata(),tmp1,outarray,1);
622  }
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:128
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:127
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the expansion basis (this)->_Base[0] and return ...
Definition: SegExp.cpp:506
const LibUtilities::PointsKeyVector GetPointsKeys() const
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
Array< OneD, LibUtilities::BasisSharedPtr > m_base
Geometry is curved or has non-constant factors.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ v_LaplacianMatrixOp()

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

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 966 of file SegExp.cpp.

References ASSERTL0, Nektar::StdRegions::StdExpansion::BwdTrans(), Blas::Daxpy(), Blas::Dscal(), Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_geom, Nektar::LocalRegions::Expansion::m_metricinfo, Nektar::StdRegions::StdExpansion::PhysDeriv(), v_IProductWRTBase(), Vmath::Vmul(), and Vmath::Vvtvp().

970  {
971  boost::ignore_unused(mkey);
972 
973  int nquad = m_base[0]->GetNumPoints();
974  const Array<TwoD, const NekDouble>& gmat =
975  m_metricinfo->GetDerivFactors(GetPointsKeys());
976 
977  Array<OneD,NekDouble> physValues(nquad);
978  Array<OneD,NekDouble> dPhysValuesdx(nquad);
979 
980  BwdTrans(inarray,physValues);
981 
982  // Laplacian matrix operation
983  switch (m_geom->GetCoordim())
984  {
985  case 1:
986  {
987  PhysDeriv(physValues,dPhysValuesdx);
988 
989  // multiply with the proper geometric factors
990  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
991  {
992  Vmath::Vmul(nquad,
993  &gmat[0][0],1,dPhysValuesdx.get(),1,
994  dPhysValuesdx.get(),1);
995  }
996  else
997  {
998  Blas::Dscal(nquad,
999  gmat[0][0], dPhysValuesdx.get(), 1);
1000  }
1001  }
1002  break;
1003  case 2:
1004  {
1005  Array<OneD,NekDouble> dPhysValuesdy(nquad);
1006 
1007  PhysDeriv(physValues,dPhysValuesdx,dPhysValuesdy);
1008 
1009  // multiply with the proper geometric factors
1010  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1011  {
1012  Vmath::Vmul (nquad,
1013  &gmat[0][0],1,dPhysValuesdx.get(),1,
1014  dPhysValuesdx.get(),1);
1015  Vmath::Vvtvp(nquad,
1016  &gmat[1][0],1,dPhysValuesdy.get(),1,
1017  dPhysValuesdx.get(),1,
1018  dPhysValuesdx.get(),1);
1019  }
1020  else
1021  {
1022  Blas::Dscal(nquad,
1023  gmat[0][0], dPhysValuesdx.get(), 1);
1024  Blas::Daxpy(nquad,
1025  gmat[1][0], dPhysValuesdy.get(), 1,
1026  dPhysValuesdx.get(), 1);
1027  }
1028  }
1029  break;
1030  case 3:
1031  {
1032  Array<OneD,NekDouble> dPhysValuesdy(nquad);
1033  Array<OneD,NekDouble> dPhysValuesdz(nquad);
1034 
1035  PhysDeriv(physValues,dPhysValuesdx,
1036  dPhysValuesdy,dPhysValuesdz);
1037 
1038  // multiply with the proper geometric factors
1039  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
1040  {
1041  Vmath::Vmul (nquad,
1042  &gmat[0][0], 1, dPhysValuesdx.get(), 1,
1043  dPhysValuesdx.get(),1);
1044  Vmath::Vvtvp(nquad,
1045  &gmat[1][0], 1, dPhysValuesdy.get(), 1,
1046  dPhysValuesdx.get(),1,
1047  dPhysValuesdx.get(),1);
1048  Vmath::Vvtvp(nquad,
1049  &gmat[2][0], 1, dPhysValuesdz.get(), 1,
1050  dPhysValuesdx.get(),1,
1051  dPhysValuesdx.get(),1);
1052  }
1053  else
1054  {
1055  Blas::Dscal(nquad, gmat[0][0], dPhysValuesdx.get(), 1);
1056  Blas::Daxpy(nquad,
1057  gmat[1][0], dPhysValuesdy.get(), 1,
1058  dPhysValuesdx.get(), 1);
1059  Blas::Daxpy(nquad,
1060  gmat[2][0], dPhysValuesdz.get(), 1,
1061  dPhysValuesdx.get(), 1);
1062  }
1063  }
1064  break;
1065  default:
1066  ASSERTL0(false,"Wrong number of dimensions");
1067  break;
1068  }
1069 
1070  v_IProductWRTBase(m_base[0]->GetDbdata(),dPhysValuesdx,outarray,1);
1071  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
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:445
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:128
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:127
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the expansion basis (this)->_Base[0] and return ...
Definition: SegExp.cpp:506
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)
const LibUtilities::PointsKeyVector GetPointsKeys() const
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
Definition: Blas.hpp:125
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Backward transformation from coefficient space to physical space...
Definition: StdExpansion.h:530
Array< OneD, LibUtilities::BasisSharedPtr > m_base
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:110
Geometry is curved or has non-constant factors.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ v_MetricInfoType()

SpatialDomains::GeomType Nektar::LocalRegions::SegExp::v_MetricInfoType ( )
protectedvirtual

Definition at line 814 of file SegExp.cpp.

References Nektar::LocalRegions::Expansion::m_metricinfo.

815  {
816  return m_metricinfo->GetGtype();
817  }
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:128

◆ v_NormVectorIProductWRTBase() [1/2]

void Nektar::LocalRegions::SegExp::v_NormVectorIProductWRTBase ( const Array< OneD, const NekDouble > &  Fx,
const Array< OneD, const NekDouble > &  Fy,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 624 of file SegExp.cpp.

References Nektar::StdRegions::StdExpansion::GetEdgeNormal(), Nektar::LocalRegions::Expansion1D::GetLeftAdjacentElementEdge(), Nektar::LocalRegions::Expansion1D::GetLeftAdjacentElementExp(), Nektar::StdRegions::StdExpansion::m_base, v_IProductWRTBase(), Vmath::Vmul(), and Vmath::Vvtvp().

628  {
629  int nq = m_base[0]->GetNumPoints();
630  Array<OneD, NekDouble > Fn(nq);
631 // cout << "I am segment " << GetGeom()->GetGlobalID() << endl;
632 // cout << "I want edge " << GetLeftAdjacentElementEdge() << endl;
633 // @TODO: This routine no longer makes sense as a normal is not unique to an edge
634  const Array<OneD, const Array<OneD, NekDouble> >
635  &normals =
638  Vmath::Vmul (nq, &Fx[0], 1, &normals[0][0], 1, &Fn[0], 1);
639  Vmath::Vvtvp(nq, &Fy[0], 1, &normals[1][0], 1, &Fn[0], 1, &Fn[0], 1);
640 
641  v_IProductWRTBase(Fn,outarray);
642  }
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:445
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the expansion basis (this)->_Base[0] and return ...
Definition: SegExp.cpp:506
const NormalVector & GetEdgeNormal(const int edge) const
Expansion2DSharedPtr GetLeftAdjacentElementExp() const
Definition: Expansion1D.h:127
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:186

◆ v_NormVectorIProductWRTBase() [2/2]

void Nektar::LocalRegions::SegExp::v_NormVectorIProductWRTBase ( const Array< OneD, const Array< OneD, NekDouble > > &  Fvec,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 644 of file SegExp.cpp.

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

647  {
648  NormVectorIProductWRTBase(Fvec[0], Fvec[1], outarray);
649  }
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:741

◆ v_NumBndryCoeffs()

int Nektar::LocalRegions::SegExp::v_NumBndryCoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 835 of file SegExp.cpp.

836  {
837  return 2;
838  }

◆ v_NumDGBndryCoeffs()

int Nektar::LocalRegions::SegExp::v_NumDGBndryCoeffs ( ) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 841 of file SegExp.cpp.

842  {
843  return 2;
844  }

◆ v_PhysDeriv() [1/2]

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

Evaluate the derivative \( d/d{\xi_1} \) at the physical quadrature points given by inarray and return in outarray.

This is a wrapper around StdExpansion1D::Tensor_Deriv

Input:

  • n: number of derivatives to be evaluated where \( n \leq dim\)
  • inarray: array of function evaluated at the quadrature points

Output:

  • outarray: array of the derivatives \( du/d_{\xi_1}|_{\xi_{1i}} d\xi_1/dx, du/d_{\xi_1}|_{\xi_{1i}} d\xi_1/dy, du/d_{\xi_1}|_{\xi_{1i}} d\xi_1/dz, \) depending on value of dim

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 166 of file SegExp.cpp.

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

Referenced by v_PhysDeriv_n().

171  {
172  int nquad0 = m_base[0]->GetNumPoints();
173  Array<TwoD, const NekDouble> gmat =
174  m_metricinfo->GetDerivFactors(GetPointsKeys());
175  Array<OneD,NekDouble> diff(nquad0);
176 
177  //StdExpansion1D::PhysTensorDeriv(inarray,diff);
178  PhysTensorDeriv(inarray,diff);
179  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
180  {
181  if(out_d0.num_elements())
182  {
183  Vmath::Vmul(nquad0,&gmat[0][0],1,&diff[0],1,
184  &out_d0[0],1);
185  }
186 
187  if(out_d1.num_elements())
188  {
189  Vmath::Vmul(nquad0,&gmat[1][0],1,&diff[0],1,
190  &out_d1[0],1);
191  }
192 
193  if(out_d2.num_elements())
194  {
195  Vmath::Vmul(nquad0,&gmat[2][0],1,&diff[0],1,
196  &out_d2[0],1);
197  }
198  }
199  else
200  {
201  if(out_d0.num_elements())
202  {
203  Vmath::Smul(nquad0, gmat[0][0], diff, 1,
204  out_d0, 1);
205  }
206 
207  if(out_d1.num_elements())
208  {
209  Vmath::Smul(nquad0, gmat[1][0], diff, 1,
210  out_d1, 1);
211  }
212 
213  if(out_d2.num_elements())
214  {
215  Vmath::Smul(nquad0, gmat[2][0], diff, 1,
216  out_d2, 1);
217  }
218  }
219  }
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:128
const LibUtilities::PointsKeyVector GetPointsKeys() const
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
void PhysTensorDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Evaluate the derivative at the physical quadrature points given by inarray and return in outarray...
Array< OneD, LibUtilities::BasisSharedPtr > m_base
Geometry is curved or has non-constant factors.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ v_PhysDeriv() [2/2]

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

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

See also
StdRegions::StdExpansion::PhysDeriv

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 319 of file SegExp.cpp.

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

322  {
323  switch(dir)
324  {
325  case 0:
326  {
327  PhysDeriv(inarray, outarray, NullNekDouble1DArray,
329  }
330  break;
331  case 1:
332  {
333  PhysDeriv(inarray, NullNekDouble1DArray, outarray,
335  }
336  break;
337  case 2:
338  {
340  NullNekDouble1DArray, outarray);
341  }
342  break;
343  default:
344  {
345  ASSERTL1(false,"input dir is out of range");
346  }
347  break;
348  }
349  }
static Array< OneD, NekDouble > NullNekDouble1DArray
void PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250

◆ v_PhysDeriv_n()

void Nektar::LocalRegions::SegExp::v_PhysDeriv_n ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_dn 
)
protectedvirtual

Evaluate the derivative normal to a line: \( d/dn=\frac{spacedim}{||normal||}d/d{\xi} \). The derivative is calculated performing the product \( du/d{s}=\nabla u \cdot normal \).

Parameters
inarrayfunction to derive
out_dnresult of the derivative operation

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 269 of file SegExp.cpp.

References ASSERTL0, Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_geom, Nektar::LocalRegions::Expansion::m_metricinfo, Nektar::NullNekDoubleArrayofArray, v_PhysDeriv(), Vmath::Vadd(), Vmath::Vmul(), and Vmath::Zero().

272  {
273  int nquad0 = m_base[0]->GetNumPoints();
274  Array<TwoD, const NekDouble> gmat =
275  m_metricinfo->GetDerivFactors(GetPointsKeys());
276  int coordim = m_geom->GetCoordim();
277  Array<OneD, NekDouble> out_dn_tmp(nquad0,0.0);
278  switch(coordim)
279  {
280  case 2:
281 
282  Array<OneD, NekDouble> inarray_d0(nquad0);
283  Array<OneD, NekDouble> inarray_d1(nquad0);
284 
285  v_PhysDeriv(inarray,inarray_d0,inarray_d1);
286  Array<OneD, Array<OneD, NekDouble> > normals;
287  normals = Array<OneD, Array<OneD, NekDouble> >(coordim);
288  cout<<"der_n"<<endl;
289  for(int k=0; k<coordim; ++k)
290  {
291  normals[k]= Array<OneD, NekDouble>(nquad0);
292  }
293 // @TODO: this routine no longer makes sense, since normals are not unique on
294 // an edge
295 // normals = GetMetricInfo()->GetNormal();
296  for(int i=0; i<nquad0; i++)
297  {
298 cout<<"nx= "<<normals[0][i]<<" ny="<<normals[1][i]<<endl;
299  }
301  "normal vectors do not exist: check if a"
302  "boundary region is defined as I ");
303  // \nabla u \cdot normal
304  Vmath::Vmul(nquad0,normals[0],1,inarray_d0,1,out_dn_tmp,1);
305  Vmath::Vadd(nquad0,out_dn_tmp,1,out_dn,1,out_dn,1);
306  Vmath::Zero(nquad0,out_dn_tmp,1);
307  Vmath::Vmul(nquad0,normals[1],1,inarray_d1,1,out_dn_tmp,1);
308  Vmath::Vadd(nquad0,out_dn_tmp,1,out_dn,1,out_dn,1);
309 
310  for(int i=0; i<nquad0; i++)
311  {
312 cout<<"deps/dx ="<<inarray_d0[i]<<" deps/dy="<<inarray_d1[i]<<endl;
313  }
314 
315 
316  }
317 
318  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:128
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:127
const LibUtilities::PointsKeyVector GetPointsKeys() const
virtual void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
Evaluate the derivative at the physical quadrature points given by inarray and return in outarray...
Definition: SegExp.cpp:166
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayofArray
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:376
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ v_PhysDeriv_s()

void Nektar::LocalRegions::SegExp::v_PhysDeriv_s ( const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  out_ds 
)
protectedvirtual

Evaluate the derivative along a line: \( d/ds=\frac{spacedim}{||tangent||}d/d{\xi} \). The derivative is calculated performing the product \( du/d{s}=\nabla u \cdot tangent \).

Parameters
inarrayfunction to derive
out_dsresult of the derivative operation

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 229 of file SegExp.cpp.

References Nektar::SpatialDomains::eDeformed, Nektar::StdRegions::StdExpansion::GetPointsKeys(), Nektar::StdRegions::StdExpansion::m_base, Nektar::LocalRegions::Expansion::m_geom, Nektar::LocalRegions::Expansion::m_metricinfo, Nektar::StdRegions::StdExpansion1D::PhysTensorDeriv(), Vmath::Smul(), Vmath::Vdiv(), and Vmath::Zero().

232  {
233  int nquad0 = m_base[0]->GetNumPoints();
234  int coordim = m_geom->GetCoordim();
235  Array<OneD, NekDouble> diff (nquad0);
236  //this operation is needed if you put out_ds==inarray
237  Vmath::Zero(nquad0,out_ds,1);
238  switch(coordim)
239  {
240  case 2:
241  //diff= dU/de
242  Array<OneD,NekDouble> diff(nquad0);
243 
244  PhysTensorDeriv(inarray,diff);
245 
246  //get dS/de= (Jac)^-1
247  Array<OneD, NekDouble> Jac = m_metricinfo->GetJac(GetPointsKeys());
248  if(m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
249  {
250  //calculate the derivative as (dU/de)*(Jac)^-1
251  Vmath::Vdiv(nquad0,diff,1,Jac ,1,out_ds,1);
252  }
253  else
254  {
255  NekDouble invJac = 1/Jac[0];
256  Vmath::Smul(nquad0, invJac,diff,1,out_ds,1);
257  }
258  }
259  }
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:128
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:244
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:127
const LibUtilities::PointsKeyVector GetPointsKeys() const
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
double NekDouble
void PhysTensorDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Evaluate the derivative at the physical quadrature points given by inarray and return in outarray...
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:376
Array< OneD, LibUtilities::BasisSharedPtr > m_base
Geometry is curved or has non-constant factors.

◆ v_PhysEvaluate()

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

Reimplemented from Nektar::StdRegions::StdSegExp.

Definition at line 669 of file SegExp.cpp.

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

672  {
673  Array<OneD,NekDouble> Lcoord = Array<OneD,NekDouble>(1);
674 
675  ASSERTL0(m_geom,"m_geom not defined");
676  m_geom->GetLocCoords(coord,Lcoord);
677 
678  return StdSegExp::v_PhysEvaluate(Lcoord, physvals);
679  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:127

◆ v_SetCoeffsToOrientation() [1/2]

void Nektar::LocalRegions::SegExp::v_SetCoeffsToOrientation ( Array< OneD, NekDouble > &  coeffs,
StdRegions::Orientation  dir 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 761 of file SegExp.cpp.

764  {
765  v_SetCoeffsToOrientation(dir,coeffs,coeffs);
766  }
virtual void v_SetCoeffsToOrientation(Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
Definition: SegExp.cpp:761

◆ v_SetCoeffsToOrientation() [2/2]

void Nektar::LocalRegions::SegExp::v_SetCoeffsToOrientation ( StdRegions::Orientation  dir,
Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 768 of file SegExp.cpp.

References Nektar::StdRegions::eBackwards, and ReverseCoeffsAndSign().

772  {
773 
774  if (dir == StdRegions::eBackwards)
775  {
776  if (&inarray[0] != &outarray[0])
777  {
778  Array<OneD,NekDouble> intmp (inarray);
779  ReverseCoeffsAndSign(intmp,outarray);
780  }
781  else
782  {
783  ReverseCoeffsAndSign(inarray,outarray);
784  }
785  }
786  }
void ReverseCoeffsAndSign(const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Reverse the coefficients in a boundary interior expansion this routine is of use when we need the seg...
Definition: SegExp.cpp:1598

◆ v_StdPhysEvaluate()

NekDouble Nektar::LocalRegions::SegExp::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 661 of file SegExp.cpp.

664  {
665  // Evaluate point in local (eta) coordinates.
666  return StdSegExp::v_PhysEvaluate(Lcoord,physvals);
667  }

Member Data Documentation

◆ m_matrixManager

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

◆ m_staticCondMatrixManager

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