Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Nektar::LocalRegions::Expansion1D Class Reference

#include <Expansion1D.h>

Inheritance diagram for Nektar::LocalRegions::Expansion1D:
Inheritance graph
[legend]
Collaboration diagram for Nektar::LocalRegions::Expansion1D:
Collaboration graph
[legend]

Public Member Functions

 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
virtual const
SpatialDomains::GeomFactorsSharedPtr
v_GetMetricInfo () const
DNekMatSharedPtr BuildTransformationMatrix (const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
DNekMatSharedPtr BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd)
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion
 StdExpansion ()
 Default Constructor.
 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.
 StdExpansion (const StdExpansion &T)
 Copy Constructor.
virtual ~StdExpansion ()
 Destructor.
int GetNumBases () const
 This function returns the number of 1D bases used in the expansion.
const Array< OneD, const
LibUtilities::BasisSharedPtr > & 
GetBase () const
 This function gets the shared point to basis.
const
LibUtilities::BasisSharedPtr
GetBasis (int dir) const
 This function gets the shared point to basis in the dir direction.
int GetNcoeffs (void) const
 This function returns the total number of coefficients used in the expansion.
int GetTotPoints () const
 This function returns the total number of quadrature points used in the element.
LibUtilities::BasisType GetBasisType (const int dir) const
 This function returns the type of basis used in the dir direction.
int GetBasisNumModes (const int dir) const
 This function returns the number of expansion modes in the dir direction.
int EvalBasisNumModesMax (void) const
 This function returns the maximum number of expansion modes over all local directions.
LibUtilities::PointsType GetPointsType (const int dir) const
 This function returns the type of quadrature points used in the dir direction.
int GetNumPoints (const int dir) const
 This function returns the number of quadrature points in the dir direction.
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.
int GetNverts () const
 This function returns the number of vertices of the expansion domain.
int GetNedges () const
 This function returns the number of edges of the expansion domain.
int GetEdgeNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge.
int GetTotalEdgeIntNcoeffs () const
int GetEdgeNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th edge.
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.
int GetFaceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th face.
int GetFaceIntNcoeffs (const int i) const
int GetTotalFaceIntNcoeffs () const
LibUtilities::PointsKey GetFacePointsKey (const int i, const int j) const
int NumBndryCoeffs (void) const
int NumDGBndryCoeffs (void) const
LibUtilities::BasisType GetEdgeBasisType (const int i) const
 This function returns the type of expansion basis on the i-th edge.
int GetNfaces () const
 This function returns the number of faces of the expansion domain.
LibUtilities::ShapeType DetShapeType () const
 This function returns the shape of the expansion domain.
int GetShapeDimension () const
bool IsBoundaryInteriorExpansion ()
void BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Backward transformation from coefficient space to physical space.
void FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Forward transformation from physical space to coefficient space.
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.
void FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 This function fills the array outarray with the mode-th mode of the expansion.
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
void IProductWRTBase (const Array< OneD, const NekDouble > &base, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int coll_check)
void IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
int GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id.
void SetElmtId (const int id)
 Set the element id of this expansion when used in a list by returning value of m_elmt_id.
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
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
DNekMatSharedPtr GetStdMatrix (const StdMatrixKey &mkey)
DNekBlkMatSharedPtr GetStdStaticCondMatrix (const StdMatrixKey &mkey)
IndexMapValuesSharedPtr GetIndexMap (const IndexMapKey &ikey)
const Array< OneD, const
NekDouble > & 
GetPhysNormals (void)
void SetPhysNormals (Array< OneD, const NekDouble > &normal)
virtual void SetUpPhysNormals (const int edge)
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
void DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
StdRegions::Orientation GetFaceOrient (int face)
StdRegions::Orientation GetEorient (int edge)
StdRegions::Orientation GetPorient (int point)
StdRegions::Orientation GetCartesianEorient (int edge)
void SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
void SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
int CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
void ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs)
NekDouble StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
void AddEdgeNormBoundaryInt (const int edge, boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
void AddEdgeNormBoundaryInt (const int edge, boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
void AddEdgeNormBoundaryBiInt (const int edge, boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
void AddFaceNormBoundaryInt (const int face, boost::shared_ptr< StdExpansion > &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
int GetCoordim ()
void GetBoundaryMap (Array< OneD, unsigned int > &outarray)
void GetInteriorMap (Array< OneD, unsigned int > &outarray)
int GetVertexMap (const int localVertexId, bool useCoeffPacking=false)
void GetEdgeInteriorMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
void GetFaceInteriorMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
void GetEdgeToElementMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
void GetFaceToElementMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int nummodesA=-1, int nummodesB=-1)
void GetEdgePhysVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Extract the physical values along edge edge from inarray into outarray following the local edge orientation and point distribution defined by defined in EdgeExp.
void GetEdgePhysVals (const int edge, const boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void GetTracePhysVals (const int edge, const boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void GetVertexPhysVals (const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
void GetEdgeInterpVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void GetEdgeQFactors (const int edge, Array< OneD, NekDouble > &outarray)
 Extract the metric factors to compute the contravariant fluxes along edge edge and stores them into outarray following the local edge orientation (i.e. anticlockwise convention).
void GetFacePhysVals (const int face, const boost::shared_ptr< StdExpansion > &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=eNoOrientation)
void MultiplyByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
DNekMatSharedPtr CreateGeneralMatrix (const StdMatrixKey &mkey)
 this function generates the mass matrix $\mathbf{M}[i][j] = \int \phi_i(\mathbf{x}) \phi_j(\mathbf{x}) d\mathbf{x}$
void GeneralMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
void LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void WeakDirectionalDerivMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void MassLevelCurvatureMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LinearAdvectionDiffusionReactionMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
void HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
DNekMatSharedPtr GenMatrix (const StdMatrixKey &mkey)
void PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
void PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void PhysDeriv_s (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
void PhysDeriv_n (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
void PhysDirectionalDeriv (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &outarray)
void StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
void StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void AddRobinMassMatrix (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
void AddRobinEdgeContribution (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, Array< OneD, NekDouble > &coeffs)
void DGDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, boost::shared_ptr< StdExpansion > > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &coeffs, Array< OneD, NekDouble > &outarray)
NekDouble PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain.
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.
void LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 Convert local cartesian coordinate xi into local collapsed coordinates eta.
const boost::shared_ptr
< SpatialDomains::GeomFactors > & 
GetMetricInfo (void) const
virtual int v_GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id.
virtual const Array< OneD,
const NekDouble > & 
v_GetPhysNormals (void)
virtual void v_SetPhysNormals (Array< OneD, const NekDouble > &normal)
virtual void v_SetUpPhysNormals (const int edge)
virtual int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
virtual void v_ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmode_offset, NekDouble *coeffs)
 Unpack data from input file assuming it comes from the same expansion type.
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
virtual void v_DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
virtual StdRegions::Orientation v_GetFaceOrient (int face)
virtual StdRegions::Orientation v_GetEorient (int edge)
virtual StdRegions::Orientation v_GetCartesianEorient (int edge)
virtual StdRegions::Orientation v_GetPorient (int point)
NekDouble Linf (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete $ L_\infty$ error $ |\epsilon|_\infty = \max |u - u_{exact}|$ where $ u_{exact}$ is given by the array sol.
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.
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.
const NormalVectorGetEdgeNormal (const int edge) const
void ComputeEdgeNormal (const int edge)
void NegateEdgeNormal (const int edge)
bool EdgeNormalNegated (const int edge)
void ComputeFaceNormal (const int face)
void NegateFaceNormal (const int face)
void ComputeVertexNormal (const int vertex)
const NormalVectorGetFaceNormal (const int face) const
const NormalVectorGetVertexNormal (const int vertex) const
const NormalVectorGetSurfaceNormal (const int id) const
const LibUtilities::PointsKeyVector GetPointsKeys () const
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap (int eid)
Array< OneD, unsigned int > GetFaceInverseBoundaryMap (int fid, StdRegions::Orientation faceOrient=eNoOrientation)
DNekMatSharedPtr BuildInverseTransformationMatrix (const DNekScalMatSharedPtr &m_transformationmatrix)
template<class T >
boost::shared_ptr< T > as ()
- 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.

Protected Member Functions

virtual DNekMatSharedPtr v_GenMatrix (const StdRegions::StdMatrixKey &mkey)
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)
- Protected Member Functions inherited from Nektar::LocalRegions::Expansion
void ComputeLaplacianMetric ()
void ComputeQuadratureMetric ()
virtual void v_MultiplyByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_ComputeLaplacianMetric ()
virtual void v_GetCoords (Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
virtual DNekScalMatSharedPtr v_GetLocMatrix (const LocalRegions::MatrixKey &mkey)
virtual DNekMatSharedPtr v_BuildTransformationMatrix (const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
virtual DNekMatSharedPtr v_BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd)
- 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.
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.
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 IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void GeneralMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void MassMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
void LaplacianMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LaplacianMatrixOp_MatFree (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void WeakDerivMatrixOp_MatFree (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void WeakDirectionalDerivMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void MassLevelCurvatureMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LinearAdvectionDiffusionReactionMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
void HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void HelmholtzMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
virtual NekDouble v_StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
virtual void v_AddEdgeNormBoundaryInt (const int edge, boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
virtual void v_AddEdgeNormBoundaryInt (const int edge, boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
virtual void v_AddFaceNormBoundaryInt (const int face, boost::shared_ptr< StdExpansion > &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion1D
virtual NekDouble v_PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)

Private Attributes

Expansion2DWeakPtr m_elementLeft
Expansion2DWeakPtr m_elementRight
int m_elementEdgeLeft
int m_elementEdgeRight

Additional Inherited Members

- Protected Attributes inherited from Nektar::LocalRegions::Expansion
SpatialDomains::GeometrySharedPtr m_geom
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
MetricMap m_metrics
- Protected Attributes inherited from Nektar::StdRegions::StdExpansion1D
std::map< int, NormalVectorm_vertexNormals

Detailed Description

Definition at line 60 of file Expansion1D.h.

Constructor & Destructor Documentation

Nektar::LocalRegions::Expansion1D::Expansion1D ( SpatialDomains::Geometry1DSharedPtr  pGeom)
inline

Definition at line 63 of file Expansion1D.h.

References m_elementEdgeLeft, and m_elementEdgeRight.

virtual Nektar::LocalRegions::Expansion1D::~Expansion1D ( )
inlinevirtual

Definition at line 69 of file Expansion1D.h.

{}

Member Function Documentation

void Nektar::LocalRegions::Expansion1D::AddHDGHelmholtzTraceTerms ( const NekDouble  tau,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)

Definition at line 282 of file Expansion1D.cpp.

References ASSERTL0, Nektar::StdRegions::eInvMass, Nektar::StdRegions::eWeakDeriv0, Nektar::StdRegions::eWeakDeriv1, Nektar::StdRegions::eWeakDeriv2, Nektar::eWrapper, Nektar::StdRegions::StdExpansion::GetBasis(), Nektar::StdRegions::StdExpansion::GetBoundaryMap(), Nektar::StdRegions::StdExpansion::GetCoordim(), Nektar::LocalRegions::Expansion::GetLocMatrix(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::GetNumPoints(), and Nektar::StdRegions::StdExpansion::NumBndryCoeffs().

Referenced by v_GenMatrix().

{
int i,n;
int nbndry = NumBndryCoeffs();
int nquad = GetNumPoints(0);
int ncoeffs = GetNcoeffs();
int coordim = GetCoordim();
Array<OneD, unsigned int> vmap;
ASSERTL0(&inarray[0] != &outarray[0],"Input and output arrays use the same memory");
const Array<OneD, const NekDouble> &Basis = GetBasis(0)->GetBdata();
// Add F = \tau <phi_i,phi_j> (note phi_i is zero if phi_j is non-zero)
for(i = 0; i < nbndry; ++i)
{
outarray[vmap[i]] += tau*Basis[(vmap[i]+1)*nquad-1]*Basis[(vmap[i]+1)*nquad-1]*inarray[vmap[i]];
outarray[vmap[i]] += tau*Basis[vmap[i]*nquad]*Basis[vmap[i]*nquad]*inarray[vmap[i]];
}
//===============================================================
// Add -\sum_i D_i^T M^{-1} G_i + E_i M^{-1} G_i =
// \sum_i D_i M^{-1} G_i term
Array<OneD, NekDouble> tmpcoeff(ncoeffs,0.0);
DNekVec Coeffs (ncoeffs,outarray,eWrapper);
DNekVec Tmpcoeff(ncoeffs,tmpcoeff,eWrapper);
for(n = 0; n < coordim; ++n)
{
// evaluate M^{-1} G
for(i = 0; i < ncoeffs; ++i)
{
// lower boundary (negative normal)
tmpcoeff[i] -= invMass(i,vmap[0])*Basis[vmap[0]*nquad]*Basis[vmap[0]*nquad]*inarray[vmap[0]];
// upper boundary (positive normal)
tmpcoeff[i] += invMass(i,vmap[1])*Basis[(vmap[1]+1)*nquad-1]*Basis[(vmap[1]+1)*nquad-1]*inarray[vmap[1]];
}
DNekScalMat &Dmat = *GetLocMatrix(DerivType[n]);
Coeffs = Coeffs + Dmat*Tmpcoeff;
}
}
void Nektar::LocalRegions::Expansion1D::AddNormTraceInt ( const int  dir,
Array< OneD, const NekDouble > &  inarray,
Array< OneD, NekDouble > &  outarray 
)

Definition at line 261 of file Expansion1D.cpp.

References Nektar::StdRegions::StdExpansion::GetBasis(), Nektar::StdRegions::StdExpansion::GetBoundaryMap(), Nektar::StdRegions::StdExpansion::GetNumPoints(), and Nektar::StdRegions::StdExpansion::NumBndryCoeffs().

Referenced by v_GenMatrix().

{
int k;
int nbndry = NumBndryCoeffs();
int nquad = GetNumPoints(0);
const Array<OneD, const NekDouble> &Basis = GetBasis(0)->GetBdata();
Array<OneD, unsigned int> vmap;
// add G \lambda term (can assume G is diagonal since one
// of the basis is zero at boundary otherwise)
for(k = 0; k < nbndry; ++k)
{
outarray[vmap[k]] += (Basis[(vmap[k]+1)*nquad-1]*Basis[(vmap[k]+1)*nquad-1] - Basis[vmap[k]*nquad]*Basis[vmap[k]*nquad])*inarray[vmap[k]];
}
}
SpatialDomains::Geometry1DSharedPtr Nektar::LocalRegions::Expansion1D::GetGeom1D ( ) const
inline
int Nektar::LocalRegions::Expansion1D::GetLeftAdjacentElementEdge ( ) const
inline
Expansion2DSharedPtr Nektar::LocalRegions::Expansion1D::GetLeftAdjacentElementExp ( ) const
inline
int Nektar::LocalRegions::Expansion1D::GetRightAdjacentElementEdge ( ) const
inline

Definition at line 133 of file Expansion1D.h.

References m_elementEdgeRight.

{
}
Expansion2DSharedPtr Nektar::LocalRegions::Expansion1D::GetRightAdjacentElementExp ( ) const
inline

Definition at line 122 of file Expansion1D.h.

References ASSERTL1, m_elementLeft, and m_elementRight.

{
ASSERTL1(m_elementLeft.lock().get(), "Right adjacent element not set.");
return m_elementRight.lock();
}
void Nektar::LocalRegions::Expansion1D::SetAdjacentElementExp ( int  edge,
Expansion2DSharedPtr e 
)
inline

Definition at line 138 of file Expansion1D.h.

References ASSERTL1, m_elementEdgeLeft, m_elementEdgeRight, m_elementLeft, and m_elementRight.

{
if (m_elementLeft.lock().get())
{
ASSERTL1(!m_elementRight.lock().get(),
"Both adjacent elements already set.");
}
else
{
}
}
void Nektar::LocalRegions::Expansion1D::v_AddRobinEdgeContribution ( const int  vert,
const Array< OneD, const NekDouble > &  primCoeffs,
Array< OneD, NekDouble > &  coeffs 
)
protectedvirtual

Given an edge and vector of element coefficients:

  • maps those elemental coefficients corresponding to the edge into an edge-vector.
  • resets the element coefficients
  • multiplies the edge vector by the edge mass matrix
  • maps the edge coefficients back onto the elemental coefficients

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 390 of file Expansion1D.cpp.

References ASSERTL1, Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::GetVertexMap(), Nektar::StdRegions::StdExpansion::IsBoundaryInteriorExpansion(), and Vmath::Zero().

{
"Not set up for non boundary-interior expansions");
int map = GetVertexMap(vert);
Vmath::Zero(GetNcoeffs(), coeffs, 1);
coeffs[map] = primCoeffs[0];
}
void Nektar::LocalRegions::Expansion1D::v_AddRobinMassMatrix ( const int  vert,
const Array< OneD, const NekDouble > &  primCoeffs,
DNekMatSharedPtr inoutmat 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 337 of file Expansion1D.cpp.

References ASSERTL0, ASSERTL1, Nektar::StdRegions::StdExpansion::GetBoundaryMap(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::GetVertexMap(), Nektar::StdRegions::StdExpansion::IsBoundaryInteriorExpansion(), and Nektar::StdRegions::StdExpansion::NumBndryCoeffs().

{
ASSERTL0(IsBoundaryInteriorExpansion(),"Robin boundary conditions are only implemented for boundary-interior expanisons");
ASSERTL1(inoutmat->GetRows() == inoutmat->GetColumns(),
"Assuming that input matrix was square");
// Get local Element mapping for vertex point
int map = GetVertexMap(vert);
// Now need to identify a map which takes the local edge
// mass matrix to the matrix stored in inoutmat;
// This can currently be deduced from the size of the matrix
// - if inoutmat.m_rows() == v_NCoeffs() it is a full
// matrix system
// - if inoutmat.m_rows() == v_NumBndCoeffs() it is a
// boundary CG system
int rows = inoutmat->GetRows();
if (rows == GetNcoeffs())
{
// no need to do anything
}
else if(rows == NumBndryCoeffs()) // same as NumDGBndryCoeffs()
{
int i;
Array<OneD,unsigned int> bmap;
for(i = 0; i < 2; ++i)
{
if(map == bmap[i])
{
map = i;
break;
}
}
ASSERTL1(i != 2,"Did not find number in map");
}
// assumes end points have unit magnitude
(*inoutmat)(map,map) += primCoeffs[0];
}
DNekMatSharedPtr Nektar::LocalRegions::Expansion1D::v_GenMatrix ( const StdRegions::StdMatrixKey mkey)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::SegExp.

Definition at line 43 of file Expansion1D.cpp.

References AddHDGHelmholtzTraceTerms(), AddNormTraceInt(), ASSERTL0, ASSERTL1, Nektar::StdRegions::eFactorLambda, Nektar::StdRegions::eFactorTau, Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::StdRegions::eHybridDGHelmholtz, Nektar::StdRegions::eHybridDGLamToQ0, Nektar::StdRegions::eHybridDGLamToQ1, Nektar::StdRegions::eHybridDGLamToQ2, Nektar::StdRegions::eHybridDGLamToU, Nektar::StdRegions::eInvHybridDGHelmholtz, Nektar::StdRegions::eInvMass, Nektar::StdRegions::eMass, Nektar::StdRegions::eWeakDeriv0, Nektar::StdRegions::eWeakDeriv1, Nektar::StdRegions::eWeakDeriv2, Nektar::eWrapper, Nektar::StdRegions::StdExpansion::GetBoundaryMap(), Nektar::StdRegions::StdMatrixKey::GetConstFactor(), Nektar::StdRegions::StdExpansion::GetCoordim(), Nektar::LocalRegions::Expansion::GetLocMatrix(), Nektar::StdRegions::StdMatrixKey::GetMatrixType(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::IsBoundaryInteriorExpansion(), Vmath::Neg(), Nektar::StdRegions::StdExpansion::NumBndryCoeffs(), Nektar::StdRegions::StdExpansion::NumDGBndryCoeffs(), Nektar::Transpose(), Vmath::Vcopy(), and Vmath::Zero().

{
DNekMatSharedPtr returnval;
switch(mkey.GetMatrixType())
{
{
"HybridDGHelmholtz matrix not set up "
"for non boundary-interior expansions");
int i;
NekDouble lambdaval = mkey.GetConstFactor(StdRegions::eFactorLambda);
NekDouble tau = mkey.GetConstFactor(StdRegions::eFactorTau);
int ncoeffs = GetNcoeffs();
int coordim = GetCoordim();
DNekMat LocMat(ncoeffs,ncoeffs);
returnval = MemoryManager<DNekMat>::AllocateSharedPtr(ncoeffs,ncoeffs);
DNekMat &Mat = *returnval;
Vmath::Zero(ncoeffs*ncoeffs,Mat.GetPtr(),1);
for(i=0; i < coordim; ++i)
{
DNekScalMat &Dmat = *GetLocMatrix(DerivType[i]);
Mat = Mat + Dmat*invMass*Transpose(Dmat);
}
// Add end Mass Matrix Contribution
Mat = Mat + lambdaval*Mass;
Array<OneD,unsigned int> bmap;
// Add tau*F_e using elemental mass matrices
for(i = 0; i < 2; ++i)
{
Mat(bmap[i],bmap[i]) = Mat(bmap[i],bmap[i]) + tau;
}
}
break;
{
int j,k;
int nbndry = NumDGBndryCoeffs();
int ncoeffs = GetNcoeffs();
factors[StdRegions::eFactorLambda] = mkey.GetConstFactor(StdRegions::eFactorLambda);
factors[StdRegions::eFactorTau] = mkey.GetConstFactor(StdRegions::eFactorTau);
Array<OneD,NekDouble> lambda(nbndry);
DNekVec Lambda(nbndry,lambda,eWrapper);
Array<OneD,NekDouble> ulam(ncoeffs);
DNekVec Ulam(ncoeffs,ulam,eWrapper);
Array<OneD,NekDouble> f(ncoeffs);
DNekVec F(ncoeffs,f,eWrapper);
// declare matrix space
returnval = MemoryManager<DNekMat>::AllocateSharedPtr(ncoeffs,nbndry);
DNekMat &Umat = *returnval;
// Helmholtz matrix
// for each degree of freedom of the lambda space
// calculate Umat entry
// Generate Lambda to U_lambda matrix
for(j = 0; j < nbndry; ++j)
{
Vmath::Zero(nbndry,&lambda[0],1);
Vmath::Zero(ncoeffs,&f[0],1);
lambda[j] = 1.0;
Ulam = invHmat*F; // generate Ulam from lambda
// fill column of matrix
for(k = 0; k < ncoeffs; ++k)
{
Umat(k,j) = Ulam[k];
}
}
}
break;
{
int j,k,dir;
int nbndry = NumDGBndryCoeffs();
int ncoeffs = GetNcoeffs();
Array<OneD,NekDouble> lambda(nbndry);
DNekVec Lambda(nbndry,lambda,eWrapper);
Array<OneD,NekDouble> ulam(ncoeffs);
DNekVec Ulam(ncoeffs,ulam,eWrapper);
Array<OneD,NekDouble> f(ncoeffs);
DNekVec F(ncoeffs,f,eWrapper);
factors[StdRegions::eFactorLambda] = mkey.GetConstFactor(StdRegions::eFactorLambda);
factors[StdRegions::eFactorTau] = mkey.GetConstFactor(StdRegions::eFactorTau);
// declare matrix space
returnval = MemoryManager<DNekMat>::AllocateSharedPtr(ncoeffs,nbndry);
DNekMat &Qmat = *returnval;
// Lambda to U matrix
// Inverse mass matrix
//Weak Derivative matrix
switch(mkey.GetMatrixType())
{
dir = 0;
break;
dir = 1;
break;
dir = 2;
break;
default:
ASSERTL0(false,"Direction not known");
break;
}
// for each degree of freedom of the lambda space
// calculate Qmat entry
// Generate Lambda to Q_lambda matrix
for(j = 0; j < nbndry; ++j)
{
Vmath::Zero(nbndry,&lambda[0],1);
lambda[j] = 1.0;
// for lambda[j] = 1 this is the solution to ulam
for(k = 0; k < ncoeffs; ++k)
{
Ulam[k] = lamToU(k,j);
}
// -D^T ulam
Vmath::Neg(ncoeffs,&ulam[0],1);
F = Transpose(*Dmat)*Ulam;
// + \tilde{G} \lambda
AddNormTraceInt(dir,lambda,f);
// multiply by inverse mass matrix
Ulam = invMass*F;
// fill column of matrix (Qmat is in column major format)
Vmath::Vcopy(ncoeffs,&ulam[0],1,&(Qmat.GetPtr())[0]+j*ncoeffs,1);
}
}
break;
{
int j;
int nbndry = NumBndryCoeffs();
factors[StdRegions::eFactorLambda] = mkey.GetConstFactor(StdRegions::eFactorLambda);
factors[StdRegions::eFactorTau] = mkey.GetConstFactor(StdRegions::eFactorTau);
Array<OneD,unsigned int> bmap;
Array<OneD, NekDouble> lam(2);
// declare matrix space
returnval = MemoryManager<DNekMat>::AllocateSharedPtr(nbndry, nbndry);
DNekMat &BndMat = *returnval;
// Matrix to map Lambda to U
// Matrix to map Lambda to Q
lam[0] = 1.0; lam[1] = 0.0;
for(j = 0; j < nbndry; ++j)
{
BndMat(0,j) = -LamToQ(bmap[0],j) - factors[StdRegions::eFactorTau]*(LamToU(bmap[0],j) - lam[j]);
}
lam[0] = 0.0; lam[1] = 1.0;
for(j = 0; j < nbndry; ++j)
{
BndMat(1,j) = LamToQ(bmap[1],j) - factors[StdRegions::eFactorTau]*(LamToU(bmap[1],j) - lam[j]);
}
}
break;
default:
ASSERTL0(false,"This matrix type cannot be generated from this class");
break;
}
return returnval;
}

Member Data Documentation

int Nektar::LocalRegions::Expansion1D::m_elementEdgeLeft
private

Definition at line 111 of file Expansion1D.h.

Referenced by Expansion1D(), GetLeftAdjacentElementEdge(), and SetAdjacentElementExp().

int Nektar::LocalRegions::Expansion1D::m_elementEdgeRight
private

Definition at line 112 of file Expansion1D.h.

Referenced by Expansion1D(), GetRightAdjacentElementEdge(), and SetAdjacentElementExp().

Expansion2DWeakPtr Nektar::LocalRegions::Expansion1D::m_elementLeft
private
Expansion2DWeakPtr Nektar::LocalRegions::Expansion1D::m_elementRight
private

Definition at line 110 of file Expansion1D.h.

Referenced by GetRightAdjacentElementExp(), and SetAdjacentElementExp().