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

#include <Expansion2D.h>

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

Public Member Functions

 Expansion2D (SpatialDomains::Geometry2DSharedPtr pGeom)
 
virtual ~Expansion2D ()
 
void SetTraceToGeomOrientation (Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, NekDouble > &inout)
 
Expansion1DSharedPtr GetEdgeExp (int edge, bool SetUpNormal=true)
 
void SetEdgeExp (const int edge, Expansion1DSharedPtr &e)
 
void AddNormTraceInt (const int dir, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &edgeCoeffs, Array< OneD, NekDouble > &outarray)
 
void AddNormTraceInt (const int dir, Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs)
 
void AddEdgeBoundaryInt (const int edge, ExpansionSharedPtr &EdgeExp, Array< OneD, NekDouble > &edgePhys, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
 
void AddHDGHelmholtzEdgeTerms (const NekDouble tau, const int edge, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, NekDouble > &edgePhys, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
 
void AddHDGHelmholtzTraceTerms (const NekDouble tau, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
 
Expansion3DSharedPtr GetLeftAdjacentElementExp () const
 
Expansion3DSharedPtr GetRightAdjacentElementExp () const
 
int GetLeftAdjacentElementFace () const
 
int GetRightAdjacentElementFace () const
 
void SetAdjacentElementExp (int face, Expansion3DSharedPtr &f)
 
SpatialDomains::Geometry2DSharedPtr GetGeom2D () const
 
void ReOrientEdgePhysMap (const int nvert, const StdRegions::Orientation orient, const int nq0, Array< OneD, int > &idmap)
 
- 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 ()
 
virtual const
SpatialDomains::GeomFactorsSharedPtr
v_GetMetricInfo () 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 boost::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 boost::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
 
void AddFaceNormBoundaryInt (const int face, const boost::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)
 
- 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::BasisSharedPtr
GetBasis (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...
 
boost::shared_ptr< StdExpansionGetStdExp (void) const
 
boost::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)
 
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)
 
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)
 
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 boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetTracePhysVals (const int edge, const boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetVertexPhysVals (const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
 
void GetEdgeInterpVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetEdgeQFactors (const int edge, Array< OneD, NekDouble > &outarray)
 Extract the metric factors to compute the contravariant fluxes along edge edge and stores them into outarray following the local edge orientation (i.e. anticlockwise convention). More...
 
void GetFacePhysVals (const int face, const boost::shared_ptr< StdExpansion > &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=eNoOrientation)
 
void 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 LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionDiffusionReactionMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
void HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
DNekMatSharedPtr GenMatrix (const StdMatrixKey &mkey)
 
void PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
void PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void PhysDeriv_s (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
 
void PhysDeriv_n (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
 
void PhysDirectionalDeriv (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &outarray)
 
void StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
void StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void AddRobinMassMatrix (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
 
void AddRobinEdgeContribution (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, Array< OneD, NekDouble > &coeffs)
 
NekDouble PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
void LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 Convert local cartesian coordinate xi into local collapsed coordinates eta. More...
 
const boost::shared_ptr
< SpatialDomains::GeomFactors > & 
GetMetricInfo (void) const
 
virtual int v_GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
virtual const Array< OneD,
const NekDouble > & 
v_GetPhysNormals (void)
 
virtual void v_SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
virtual int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray)
 
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual void v_DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual StdRegions::Orientation v_GetForient (int face)
 
virtual StdRegions::Orientation v_GetEorient (int edge)
 
virtual StdRegions::Orientation v_GetCartesianEorient (int edge)
 
virtual StdRegions::Orientation v_GetPorient (int point)
 
NekDouble Linf (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete $ L_\infty$ error $ |\epsilon|_\infty = \max |u - u_{exact}|$ where $ u_{exact}$ is given by the array sol. More...
 
NekDouble L2 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete $ L_2$ error, $ | \epsilon |_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 dx \right]^{1/2} d\xi_1 $ where $ u_{exact}$ is given by the array sol. More...
 
NekDouble H1 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete $ H^1$ error, $ | \epsilon |^1_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 + \nabla(u - u_{exact})\cdot\nabla(u - u_{exact})\cdot dx \right]^{1/2} d\xi_1 $ where $ u_{exact}$ is given by the array sol. More...
 
const NormalVectorGetEdgeNormal (const int edge) const
 
void ComputeEdgeNormal (const int edge)
 
void NegateEdgeNormal (const int edge)
 
bool EdgeNormalNegated (const int edge)
 
void ComputeFaceNormal (const int face)
 
void NegateFaceNormal (const int face)
 
bool FaceNormalNegated (const int face)
 
void ComputeVertexNormal (const int vertex)
 
const NormalVectorGetFaceNormal (const int face) const
 
const NormalVectorGetVertexNormal (const int vertex) const
 
const NormalVectorGetSurfaceNormal (const int id) const
 
const LibUtilities::PointsKeyVector GetPointsKeys () const
 
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap (int eid)
 
Array< OneD, unsigned int > GetFaceInverseBoundaryMap (int fid, StdRegions::Orientation faceOrient=eNoOrientation)
 
DNekMatSharedPtr BuildInverseTransformationMatrix (const DNekScalMatSharedPtr &m_transformationmatrix)
 
void PhysInterpToSimplexEquiSpaced (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, 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 >
boost::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::StdRegions::StdExpansion2D
 StdExpansion2D ()
 
 StdExpansion2D (int numcoeffs, const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb)
 
 StdExpansion2D (const StdExpansion2D &T)
 
virtual ~StdExpansion2D ()
 
void PhysTensorDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray_d0, Array< OneD, NekDouble > &outarray_d1)
 Calculate the 2D derivative in the local tensor/collapsed coordinate at the physical points. More...
 
NekDouble Integral (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &w0, const Array< OneD, const NekDouble > &w1)
 
void BwdTrans_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0=true, bool doCheckCollDir1=true)
 
void IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0=true, bool doCheckCollDir1=true)
 

Protected Member Functions

virtual DNekMatSharedPtr v_GenMatrix (const StdRegions::StdMatrixKey &mkey)
 
virtual void v_DGDeriv (const int dir, const Array< OneD, const NekDouble > &incoeffs, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &edgeCoeffs, Array< OneD, NekDouble > &out_d)
 
virtual void v_AddEdgeNormBoundaryInt (const int edge, const ExpansionSharedPtr &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 ExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
 
virtual void v_AddRobinMassMatrix (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
 
virtual void v_AddRobinEdgeContribution (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, Array< OneD, NekDouble > &coeffs)
 
virtual DNekMatSharedPtr v_BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd)
 
void GetPhysEdgeVarCoeffsFromElement (const int edge, ExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &varcoeff, Array< OneD, NekDouble > &outarray)
 
void ReOrientQuadEdgePhysMap (const StdRegions::Orientation orient, const int nq0, Array< OneD, int > &idmap)
 
Array< OneD, unsigned int > v_GetEdgeInverseBoundaryMap (int eid)
 
virtual void v_NegateEdgeNormal (const int edge)
 
virtual bool v_EdgeNormalNegated (const int edge)
 
virtual void v_SetUpPhysNormals (const int edge)
 
const StdRegions::NormalVectorv_GetEdgeNormal (const int edge) const
 
const StdRegions::NormalVectorv_GetSurfaceNormal (const int id) const
 
- 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 void v_ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
 
virtual void v_AddEdgeNormBoundaryInt (const int edge, const boost::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 boost::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
 
virtual void v_AddFaceNormBoundaryInt (const int face, const boost::shared_ptr< Expansion > &FaceExp, const Array< OneD, const NekDouble > &Fn, 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 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)
 
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion2D
virtual NekDouble v_PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
virtual NekDouble v_PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
 
virtual void v_BwdTrans_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1)=0
 
virtual void v_IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1)=0
 
virtual void v_LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual void v_HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
 
virtual int v_GetTraceNcoeffs (const int i) const
 

Protected Attributes

std::vector< Expansion1DWeakPtrm_edgeExp
 
std::vector< bool > m_requireNeg
 
std::map< int,
StdRegions::NormalVector
m_edgeNormals
 
std::map< int, bool > m_negatedNormals
 
Expansion3DWeakPtr m_elementLeft
 
Expansion3DWeakPtr m_elementRight
 
int m_elementFaceLeft
 
int m_elementFaceRight
 
- Protected Attributes inherited from Nektar::LocalRegions::Expansion
SpatialDomains::GeometrySharedPtr m_geom
 
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
 
MetricMap m_metrics
 
- Protected Attributes inherited from Nektar::StdRegions::StdExpansion
Array< OneD,
LibUtilities::BasisSharedPtr
m_base
 
int m_elmt_id
 
int m_ncoeffs
 
LibUtilities::NekManager
< StdMatrixKey, DNekMat,
StdMatrixKey::opLess
m_stdMatrixManager
 
LibUtilities::NekManager
< StdMatrixKey, DNekBlkMat,
StdMatrixKey::opLess
m_stdStaticCondMatrixManager
 
LibUtilities::NekManager
< IndexMapKey, IndexMapValues,
IndexMapKey::opLess
m_IndexMapManager
 

Detailed Description

Definition at line 59 of file Expansion2D.h.

Constructor & Destructor Documentation

Nektar::LocalRegions::Expansion2D::Expansion2D ( SpatialDomains::Geometry2DSharedPtr  pGeom)

Definition at line 49 of file Expansion2D.cpp.

References m_elementFaceLeft, and m_elementFaceRight.

49  :
51  {
52  m_elementFaceLeft = -1;
53  m_elementFaceRight = -1;
54  }
Expansion(SpatialDomains::GeometrySharedPtr pGeom)
Definition: Expansion.cpp:48
StdExpansion()
Default Constructor.
virtual Nektar::LocalRegions::Expansion2D::~Expansion2D ( )
inlinevirtual

Definition at line 66 of file Expansion2D.h.

66 {}

Member Function Documentation

void Nektar::LocalRegions::Expansion2D::AddEdgeBoundaryInt ( const int  edge,
ExpansionSharedPtr EdgeExp,
Array< OneD, NekDouble > &  edgePhys,
Array< OneD, NekDouble > &  outarray,
const StdRegions::VarCoeffMap varcoeffs = StdRegions:: NullVarCoeffMap 
)
inline

For a given edge add the {F}_1j contributions

Variable coeffs

Definition at line 417 of file Expansion2D.cpp.

References Nektar::StdRegions::eVarCoeffD00, Nektar::StdRegions::eVarCoeffD11, Nektar::StdRegions::eVarCoeffD22, Nektar::StdRegions::StdExpansion::GetEdgeToElementMap(), GetPhysEdgeVarCoeffsFromElement(), sign, Nektar::StdRegions::StdExpansion::v_GetEorient(), and Vmath::Vmul().

Referenced by AddNormTraceInt().

423  {
424  int i;
425  int order_e = EdgeExp->GetNcoeffs();
426  int nquad_e = EdgeExp->GetNumPoints(0);
427  Array<OneD,unsigned int> map;
428  Array<OneD,int> sign;
429  Array<OneD, NekDouble> coeff(order_e);
430 
431  GetEdgeToElementMap(edge, v_GetEorient(edge), map, sign);
432 
436  StdRegions::VarCoeffMap::const_iterator x;
437 
438  /// @TODO Variable coeffs
439  if ((x = varcoeffs.find(VarCoeff[0])) != varcoeffs.end())
440  {
441  Array<OneD, NekDouble> work(nquad_e);
443  edge, EdgeExp, x->second, work);
444  Vmath::Vmul(nquad_e, work, 1, edgePhys, 1, edgePhys, 1);
445  }
446 
447  EdgeExp->IProductWRTBase(edgePhys, coeff);
448 
449  // add data to out array
450  for(i = 0; i < order_e; ++i)
451  {
452  outarray[map[i]] += sign[i]*coeff[i];
453  }
454  }
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:27
void GetPhysEdgeVarCoeffsFromElement(const int edge, ExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &varcoeff, Array< OneD, NekDouble > &outarray)
void GetEdgeToElementMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int P=-1)
Definition: StdExpansion.h:851
virtual StdRegions::Orientation v_GetEorient(int edge)
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:183
void Nektar::LocalRegions::Expansion2D::AddHDGHelmholtzEdgeTerms ( const NekDouble  tau,
const int  edge,
Array< OneD, ExpansionSharedPtr > &  EdgeExp,
Array< OneD, NekDouble > &  edgePhys,
const StdRegions::VarCoeffMap dirForcing,
Array< OneD, NekDouble > &  outarray 
)
inline

: What direction to use here??

: Document this (probably not needed)

Definition at line 491 of file Expansion2D.cpp.

References Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::eInvMass, Nektar::StdRegions::eVarCoeffD00, Nektar::StdRegions::eVarCoeffD11, Nektar::StdRegions::eVarCoeffD22, Nektar::StdRegions::eWeakDeriv0, Nektar::StdRegions::eWeakDeriv1, Nektar::StdRegions::eWeakDeriv2, Nektar::eWrapper, Nektar::StdRegions::StdExpansion::GetCoordim(), Nektar::StdRegions::StdExpansion::GetEdgeNormal(), Nektar::StdRegions::StdExpansion::GetEdgeToElementMap(), Nektar::StdRegions::StdExpansion::GetEorient(), Nektar::LocalRegions::Expansion::GetLocMatrix(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), GetPhysEdgeVarCoeffsFromElement(), m_negatedNormals, Vmath::Neg(), Nektar::StdRegions::NullConstFactorMap, sign, and Vmath::Vmul().

Referenced by AddHDGHelmholtzTraceTerms().

498  {
499  int i, j, n;
500  int nquad_e = EdgeExp[edge]->GetNumPoints(0);
501  int order_e = EdgeExp[edge]->GetNcoeffs();
502  int coordim = GetCoordim();
503  int ncoeffs = GetNcoeffs();
504 
505  Array<OneD, NekDouble> inval (nquad_e);
506  Array<OneD, NekDouble> outcoeff(order_e);
507  Array<OneD, NekDouble> tmpcoeff(ncoeffs);
508 
509  const Array<OneD, const Array<OneD, NekDouble> > &normals
510  = GetEdgeNormal(edge);
511 
512  Array<OneD,unsigned int> emap;
513  Array<OneD,int> sign;
514 
516 
517  StdRegions::Orientation edgedir = GetEorient(edge);
518 
519  DNekVec Coeffs (ncoeffs,outarray,eWrapper);
520  DNekVec Tmpcoeff(ncoeffs,tmpcoeff,eWrapper);
521 
522  GetEdgeToElementMap(edge,edgedir,emap,sign);
523 
527 
531 
532  StdRegions::VarCoeffMap::const_iterator x;
533  /// @TODO: What direction to use here??
534  if ((x = varcoeffs.find(VarCoeff[0])) != varcoeffs.end())
535  {
536  Array<OneD, NekDouble> work(nquad_e);
538  edge, EdgeExp[edge], x->second, work);
539  Vmath::Vmul(nquad_e, work, 1, edgePhys, 1, edgePhys, 1);
540  }
541 
542  //================================================================
543  // Add F = \tau <phi_i,in_phys>
544  // Fill edge and take inner product
545  EdgeExp[edge]->IProductWRTBase(edgePhys, outcoeff);
546  // add data to out array
547  for(i = 0; i < order_e; ++i)
548  {
549  outarray[emap[i]] += sign[i] * tau * outcoeff[i];
550  }
551  //================================================================
552 
553  //===============================================================
554  // Add -\sum_i D_i^T M^{-1} G_i + E_i M^{-1} G_i =
555  // \sum_i D_i M^{-1} G_i term
556 
557  // Two independent direction
558  for(n = 0; n < coordim; ++n)
559  {
560  Vmath::Vmul(nquad_e, normals[n], 1, edgePhys, 1, inval, 1);
561 
562  if (m_negatedNormals[edge])
563  {
564  Vmath::Neg(nquad_e, inval, 1);
565  }
566 
567  // Multiply by variable coefficient
568  /// @TODO: Document this (probably not needed)
569 // StdRegions::VarCoeffMap::const_iterator x;
570 // if ((x = varcoeffs.find(VarCoeff[n])) != varcoeffs.end())
571 // {
572 // GetPhysEdgeVarCoeffsFromElement(edge,EdgeExp[edge],x->second,varcoeff_work);
573 // Vmath::Vmul(nquad_e,varcoeff_work,1,EdgeExp[edge]->GetPhys(),1,EdgeExp[edge]->UpdatePhys(),1);
574 // }
575 
576  EdgeExp[edge]->IProductWRTBase(inval, outcoeff);
577 
578  // M^{-1} G
579  for(i = 0; i < ncoeffs; ++i)
580  {
581  tmpcoeff[i] = 0;
582  for(j = 0; j < order_e; ++j)
583  {
584  tmpcoeff[i] += invMass(i,emap[j])*sign[j]*outcoeff[j];
585  }
586  }
587 
588  if(varcoeffs.find(VarCoeff[n]) != varcoeffs.end())
589  {
590  MatrixKey mkey(DerivType[n], DetShapeType(), *this, StdRegions::NullConstFactorMap, varcoeffs);
591  DNekScalMat &Dmat = *GetLocMatrix(mkey);
592  Coeffs = Coeffs + Dmat*Tmpcoeff;
593  }
594 
595  else
596  {
597  DNekScalMat &Dmat = *GetLocMatrix(DerivType[n]);
598  Coeffs = Coeffs + Dmat*Tmpcoeff;
599  }
600  }
601  }
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:470
const NormalVector & GetEdgeNormal(const int edge) const
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:27
void GetPhysEdgeVarCoeffsFromElement(const int edge, ExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &varcoeff, Array< OneD, NekDouble > &outarray)
std::map< int, bool > m_negatedNormals
Definition: Expansion2D.h:136
StdRegions::Orientation GetEorient(int edge)
Definition: StdExpansion.h:768
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:396
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition: Expansion.cpp:85
void GetEdgeToElementMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int P=-1)
Definition: StdExpansion.h:851
NekVector< NekDouble > DNekVec
Definition: NekTypeDefs.hpp:49
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:131
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
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:183
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:253
void Nektar::LocalRegions::Expansion2D::AddHDGHelmholtzTraceTerms ( const NekDouble  tau,
const Array< OneD, const NekDouble > &  inarray,
Array< OneD, ExpansionSharedPtr > &  EdgeExp,
const StdRegions::VarCoeffMap dirForcing,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 459 of file Expansion2D.cpp.

References AddHDGHelmholtzEdgeTerms(), ASSERTL0, Nektar::StdRegions::StdExpansion::GetNedges(), Nektar::StdRegions::StdExpansion::GetTotPoints(), and Vmath::Vcopy().

Referenced by v_GenMatrix().

465  {
466  ASSERTL0(&inarray[0] != &outarray[0],
467  "Input and output arrays use the same memory");
468 
469  int e, cnt, order_e, nedges = GetNedges();
470  Array<OneD, const NekDouble> tmp;
471 
472  cnt = 0;
473 
474  for(e = 0; e < nedges; ++e)
475  {
476  order_e = EdgeExp[e]->GetNcoeffs();
477  Array<OneD, NekDouble> edgeCoeffs(order_e);
478  Array<OneD, NekDouble> edgePhys (EdgeExp[e]->GetTotPoints());
479 
480  Vmath::Vcopy(order_e, tmp = inarray + cnt, 1, edgeCoeffs, 1);
481  EdgeExp[e]->BwdTrans(edgeCoeffs, edgePhys);
483  tau, e, EdgeExp, edgePhys, dirForcing, outarray);
484 
485  cnt += order_e;
486  }
487  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:141
void AddHDGHelmholtzEdgeTerms(const NekDouble tau, const int edge, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, NekDouble > &edgePhys, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1061
int GetNedges() const
This function returns the number of edges of the expansion domain.
Definition: StdExpansion.h:272
void Nektar::LocalRegions::Expansion2D::AddNormTraceInt ( const int  dir,
Array< OneD, ExpansionSharedPtr > &  EdgeExp,
Array< OneD, Array< OneD, NekDouble > > &  edgeCoeffs,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 382 of file Expansion2D.cpp.

References AddEdgeBoundaryInt(), Nektar::StdRegions::StdExpansion::GetEdgeNormal(), Nektar::StdRegions::StdExpansion::GetNedges(), m_negatedNormals, Vmath::Neg(), and Vmath::Vmul().

Referenced by v_DGDeriv(), and v_GenMatrix().

387  {
388  int e;
389  int nquad_e;
390  int nedges = GetNedges();
391 
392  for(e = 0; e < nedges; ++e)
393  {
394  nquad_e = EdgeExp[e]->GetNumPoints(0);
395 
396  Array<OneD, NekDouble> edgePhys(nquad_e);
397  const Array<OneD, const Array<OneD, NekDouble> > &normals
398  = GetEdgeNormal(e);
399 
400  EdgeExp[e]->BwdTrans(edgeCoeffs[e], edgePhys);
401 
402  Vmath::Vmul(nquad_e, normals[dir], 1, edgePhys, 1, edgePhys, 1);
403 
404  if (m_negatedNormals[e])
405  {
406  Vmath::Neg(nquad_e, edgePhys, 1);
407  }
408 
409  AddEdgeBoundaryInt(e, EdgeExp[e], edgePhys, outarray);
410  }
411  }
const NormalVector & GetEdgeNormal(const int edge) const
std::map< int, bool > m_negatedNormals
Definition: Expansion2D.h:136
void AddEdgeBoundaryInt(const int edge, ExpansionSharedPtr &EdgeExp, Array< OneD, NekDouble > &edgePhys, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:396
int GetNedges() const
This function returns the number of edges of the expansion domain.
Definition: StdExpansion.h:272
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:183
void Nektar::LocalRegions::Expansion2D::AddNormTraceInt ( const int  dir,
Array< OneD, const NekDouble > &  inarray,
Array< OneD, ExpansionSharedPtr > &  EdgeExp,
Array< OneD, NekDouble > &  outarray,
const StdRegions::VarCoeffMap varcoeffs 
)
inline

Computes the C matrix entries due to the presence of the identity matrix in Eqn. 32.

: Document this

Definition at line 327 of file Expansion2D.cpp.

References AddEdgeBoundaryInt(), Nektar::StdRegions::StdExpansion::GetEdgeNormal(), Nektar::StdRegions::StdExpansion::GetNedges(), m_negatedNormals, Vmath::Neg(), and Vmath::Vmul().

333  {
334  int i,e,cnt;
335  int order_e,nquad_e;
336  int nedges = GetNedges();
337 
338  cnt = 0;
339  for(e = 0; e < nedges; ++e)
340  {
341  order_e = EdgeExp[e]->GetNcoeffs();
342  nquad_e = EdgeExp[e]->GetNumPoints(0);
343 
344  const Array<OneD, const Array<OneD, NekDouble> > &normals
345  = GetEdgeNormal(e);
346  Array<OneD, NekDouble> edgeCoeffs(order_e);
347  Array<OneD, NekDouble> edgePhys (nquad_e);
348 
349  for(i = 0; i < order_e; ++i)
350  {
351  edgeCoeffs[i] = inarray[i+cnt];
352  }
353  cnt += order_e;
354 
355  EdgeExp[e]->BwdTrans(edgeCoeffs, edgePhys);
356 
357  // Multiply by variable coefficient
358  /// @TODO: Document this
359  // StdRegions::VarCoeffType VarCoeff[3] = {StdRegions::eVarCoeffD00,
360  // StdRegions::eVarCoeffD11,
361  // StdRegions::eVarCoeffD22};
362  // StdRegions::VarCoeffMap::const_iterator x;
363  // Array<OneD, NekDouble> varcoeff_work(nquad_e);
364 
365  // if ((x = varcoeffs.find(VarCoeff[dir])) != varcoeffs.end())
366  // {
367  // GetPhysEdgeVarCoeffsFromElement(e,EdgeExp[e],x->second,varcoeff_work);
368  // Vmath::Vmul(nquad_e,varcoeff_work,1,EdgeExp[e]->GetPhys(),1,EdgeExp[e]->UpdatePhys(),1);
369  // }
370 
371  Vmath::Vmul(nquad_e, normals[dir], 1, edgePhys, 1, edgePhys, 1);
372 
373  if (m_negatedNormals[e])
374  {
375  Vmath::Neg(nquad_e, edgePhys, 1);
376  }
377 
378  AddEdgeBoundaryInt(e, EdgeExp[e], edgePhys, outarray, varcoeffs);
379  }
380  }
const NormalVector & GetEdgeNormal(const int edge) const
std::map< int, bool > m_negatedNormals
Definition: Expansion2D.h:136
void AddEdgeBoundaryInt(const int edge, ExpansionSharedPtr &EdgeExp, Array< OneD, NekDouble > &edgePhys, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:396
int GetNedges() const
This function returns the number of edges of the expansion domain.
Definition: StdExpansion.h:272
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:183
Expansion1DSharedPtr Nektar::LocalRegions::Expansion2D::GetEdgeExp ( int  edge,
bool  SetUpNormal = true 
)
inline

Definition at line 201 of file Expansion2D.h.

References ASSERTL1, Nektar::StdRegions::StdExpansion::GetNedges(), and m_edgeExp.

Referenced by v_GenMatrix().

204  {
205  ASSERTL1(edge < GetNedges(), "Edge out of range.");
206  return m_edgeExp[edge].lock();
207  }
std::vector< Expansion1DWeakPtr > m_edgeExp
Definition: Expansion2D.h:133
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
int GetNedges() const
This function returns the number of edges of the expansion domain.
Definition: StdExpansion.h:272
SpatialDomains::Geometry2DSharedPtr Nektar::LocalRegions::Expansion2D::GetGeom2D ( ) const
inline
Expansion3DSharedPtr Nektar::LocalRegions::Expansion2D::GetLeftAdjacentElementExp ( ) const
inline

Definition at line 223 of file Expansion2D.h.

References ASSERTL1, and m_elementLeft.

Referenced by Nektar::MultiRegions::ExpList2D::v_GetNormals(), Nektar::LocalRegions::TriExp::v_NormVectorIProductWRTBase(), and Nektar::LocalRegions::QuadExp::v_NormVectorIProductWRTBase().

224  {
225  ASSERTL1(m_elementLeft.lock().get(),
226  "Left adjacent element not set.");
227  return m_elementLeft.lock();
228  }
Expansion3DWeakPtr m_elementLeft
Definition: Expansion2D.h:137
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
int Nektar::LocalRegions::Expansion2D::GetLeftAdjacentElementFace ( ) const
inline
void Nektar::LocalRegions::Expansion2D::GetPhysEdgeVarCoeffsFromElement ( const int  edge,
ExpansionSharedPtr EdgeExp,
const Array< OneD, const NekDouble > &  varcoeff,
Array< OneD, NekDouble > &  outarray 
)
protected

Extracts the variable coefficients along an edge

Definition at line 606 of file Expansion2D.cpp.

References Nektar::StdRegions::StdExpansion::FwdTrans(), Nektar::StdRegions::StdExpansion::GetEdgeToElementMap(), Nektar::StdRegions::StdExpansion::GetEorient(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), and sign.

Referenced by AddEdgeBoundaryInt(), AddHDGHelmholtzEdgeTerms(), and v_GenMatrix().

611  {
612  Array<OneD, NekDouble> tmp(GetNcoeffs());
613  Array<OneD, NekDouble> edgetmp(EdgeExp->GetNcoeffs());
614 
615  // FwdTrans varcoeffs
616  FwdTrans(varcoeff, tmp);
617 
618  // Map to edge
619  Array<OneD,unsigned int> emap;
620  Array<OneD, int> sign;
621  StdRegions::Orientation edgedir = GetEorient(edge);
622  GetEdgeToElementMap(edge,edgedir,emap,sign);
623 
624  for (unsigned int i = 0; i < EdgeExp->GetNcoeffs(); ++i)
625  {
626  edgetmp[i] = tmp[emap[i]];
627  }
628 
629  // BwdTrans
630  EdgeExp->BwdTrans(edgetmp, outarray);
631  }
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:27
StdRegions::Orientation GetEorient(int edge)
Definition: StdExpansion.h:768
void GetEdgeToElementMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int P=-1)
Definition: StdExpansion.h:851
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:131
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Forward transformation from physical space to coefficient space...
Expansion3DSharedPtr Nektar::LocalRegions::Expansion2D::GetRightAdjacentElementExp ( ) const
inline

Definition at line 231 of file Expansion2D.h.

References ASSERTL1, m_elementLeft, and m_elementRight.

232  {
233  ASSERTL1(m_elementLeft.lock().get(),
234  "Right adjacent element not set.");
235 
236  return m_elementRight.lock();
237  }
Expansion3DWeakPtr m_elementRight
Definition: Expansion2D.h:138
Expansion3DWeakPtr m_elementLeft
Definition: Expansion2D.h:137
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
int Nektar::LocalRegions::Expansion2D::GetRightAdjacentElementFace ( ) const
inline

Definition at line 244 of file Expansion2D.h.

References m_elementFaceRight.

245  {
246  return m_elementFaceRight;
247  }
void Nektar::LocalRegions::Expansion2D::ReOrientEdgePhysMap ( const int  nvert,
const StdRegions::Orientation  orient,
const int  nq0,
Array< OneD, int > &  idmap 
)

Definition at line 1400 of file Expansion2D.cpp.

References ASSERTL0, Nektar::StdRegions::eBackwards, and Nektar::StdRegions::eForwards.

1405  {
1406  if (idmap.num_elements() != nq0)
1407  {
1408  idmap = Array<OneD, int>(nq0);
1409  }
1410  switch (orient)
1411  {
1412  case StdRegions::eForwards:
1413  // Fwd
1414  for (int i = 0; i < nq0; ++i)
1415  {
1416  idmap[i] = i;
1417  }
1418  break;
1420  {
1421  // Bwd
1422  for (int i = 0; i < nq0; ++i)
1423  {
1424  idmap[i] = nq0-1-i;
1425  }
1426  }
1427  break;
1428  default:
1429  ASSERTL0(false, "Unknown orientation");
1430  break;
1431  }
1432  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
void Nektar::LocalRegions::Expansion2D::ReOrientQuadEdgePhysMap ( const StdRegions::Orientation  orient,
const int  nq0,
Array< OneD, int > &  idmap 
)
protected
void Nektar::LocalRegions::Expansion2D::SetAdjacentElementExp ( int  face,
Expansion3DSharedPtr f 
)
inline

Definition at line 249 of file Expansion2D.h.

References ASSERTL1, m_elementFaceLeft, m_elementFaceRight, m_elementLeft, and m_elementRight.

Referenced by Nektar::MultiRegions::DisContField3D::SetUpDG().

252  {
253  if (m_elementLeft.lock().get())
254  {
255  ASSERTL1(!m_elementRight.lock().get(),
256  "Both adjacent elements already set.");
257 
258  m_elementRight = f;
259  m_elementFaceRight = face;
260  }
261  else
262  {
263  m_elementLeft = f;
264  m_elementFaceLeft = face;
265  }
266  }
Expansion3DWeakPtr m_elementRight
Definition: Expansion2D.h:138
Expansion3DWeakPtr m_elementLeft
Definition: Expansion2D.h:137
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
void Nektar::LocalRegions::Expansion2D::SetEdgeExp ( const int  edge,
Expansion1DSharedPtr e 
)
inline

Definition at line 209 of file Expansion2D.h.

References ASSERTL1, Nektar::StdRegions::StdExpansion::GetNedges(), and m_edgeExp.

212  {
213  unsigned int nEdges = GetNedges();
214  ASSERTL1(edge < nEdges, "Edge out of range.");
215  if (m_edgeExp.size() < nEdges)
216  {
217  m_edgeExp.resize(nEdges);
218  }
219  m_edgeExp[edge] = e;
220  }
std::vector< Expansion1DWeakPtr > m_edgeExp
Definition: Expansion2D.h:133
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
int GetNedges() const
This function returns the number of edges of the expansion domain.
Definition: StdExpansion.h:272
void Nektar::LocalRegions::Expansion2D::SetTraceToGeomOrientation ( Array< OneD, ExpansionSharedPtr > &  EdgeExp,
Array< OneD, NekDouble > &  inout 
)

Definition at line 306 of file Expansion2D.cpp.

References Nektar::StdRegions::StdExpansion::GetEdgeNcoeffs(), Nektar::StdRegions::StdExpansion::GetEorient(), and Nektar::StdRegions::StdExpansion::GetNedges().

Referenced by v_GenMatrix().

309  {
310  int i, cnt = 0;
311  int nedges = GetNedges();
312  Array<OneD, NekDouble> e_tmp;
313 
314  for(i = 0; i < nedges; ++i)
315  {
316  EdgeExp[i]->SetCoeffsToOrientation(GetEorient(i),
317  e_tmp = inout + cnt,
318  e_tmp = inout + cnt);
319  cnt += GetEdgeNcoeffs(i);
320  }
321  }
StdRegions::Orientation GetEorient(int edge)
Definition: StdExpansion.h:768
int GetEdgeNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th edge.
Definition: StdExpansion.h:287
int GetNedges() const
This function returns the number of edges of the expansion domain.
Definition: StdExpansion.h:272
void Nektar::LocalRegions::Expansion2D::v_AddEdgeNormBoundaryInt ( const int  edge,
const ExpansionSharedPtr EdgeExp,
const Array< OneD, const NekDouble > &  Fx,
const Array< OneD, const NekDouble > &  Fy,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Definition at line 56 of file Expansion2D.cpp.

References Nektar::LocalRegions::Expansion::AddEdgeNormBoundaryInt(), ASSERTL1, Nektar::StdRegions::StdExpansion::GetCoordim(), Nektar::StdRegions::StdExpansion::GetEdgeNormal(), GetGeom2D(), Nektar::StdRegions::StdExpansion::GetNedges(), m_edgeExp, m_negatedNormals, m_requireNeg, Vmath::Neg(), Vmath::Vmul(), and Vmath::Vvtvp().

62  {
63  ASSERTL1(GetCoordim() == 2,
64  "Routine only set up for two-dimensions");
65 
66  const Array<OneD, const Array<OneD, NekDouble> > normals
67  = GetEdgeNormal(edge);
68 
69  if (m_requireNeg.size() == 0)
70  {
71  m_requireNeg.resize(GetNedges());
72 
73  for (int i = 0; i < GetNedges(); ++i)
74  {
75  m_requireNeg[i] = false;
76  if (m_negatedNormals[i])
77  {
78  m_requireNeg[i] = true;
79  continue;
80  }
81 
82  Expansion1DSharedPtr edgeExp =
83  m_edgeExp[i].lock()->as<Expansion1D>();
84 
85  if (edgeExp->GetRightAdjacentElementExp())
86  {
87  if (edgeExp->GetRightAdjacentElementExp()->GetGeom2D()
88  ->GetGlobalID() == GetGeom2D()->GetGlobalID())
89  {
90  m_requireNeg[i] = true;
91  }
92  }
93  }
94  }
95 
96  // We allow the case of mixed polynomial order by supporting only
97  // those modes on the edge common to both adjoining elements. This
98  // is enforced here by taking the minimum size and padding with
99  // zeros.
100  int nquad_e = min(EdgeExp->GetNumPoints(0),
101  int(normals[0].num_elements()));
102 
103  int nEdgePts = EdgeExp->GetTotPoints();
104  Array<OneD, NekDouble> edgePhys(nEdgePts);
105  Vmath::Vmul (nquad_e, normals[0], 1, Fx, 1, edgePhys, 1);
106  Vmath::Vvtvp(nquad_e, normals[1], 1, Fy, 1, edgePhys, 1,
107  edgePhys, 1);
108 
109  Expansion1DSharedPtr locExp = EdgeExp->as<Expansion1D>();
110 
111  if (m_negatedNormals[edge])
112  {
113  Vmath::Neg(nquad_e, edgePhys, 1);
114  }
115  else if (locExp->GetRightAdjacentElementEdge() != -1)
116  {
117  if (locExp->GetRightAdjacentElementExp()->GetGeom2D()->GetGlobalID()
118  == GetGeom2D()->GetGlobalID())
119  {
120  Vmath::Neg(nquad_e, edgePhys, 1);
121  }
122  }
123 
124  AddEdgeNormBoundaryInt(edge, EdgeExp, edgePhys, outarray);
125  }
const NormalVector & GetEdgeNormal(const int edge) const
std::map< int, bool > m_negatedNormals
Definition: Expansion2D.h:136
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:442
std::vector< bool > m_requireNeg
Definition: Expansion2D.h:134
SpatialDomains::Geometry2DSharedPtr GetGeom2D() const
Definition: Expansion2D.h:269
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:396
std::vector< Expansion1DWeakPtr > m_edgeExp
Definition: Expansion2D.h:133
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
boost::shared_ptr< Expansion1D > Expansion1DSharedPtr
Definition: Expansion1D.h:53
void AddEdgeNormBoundaryInt(const int edge, const boost::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: Expansion.cpp:115
int GetNedges() const
This function returns the number of edges of the expansion domain.
Definition: StdExpansion.h:272
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:183
void Nektar::LocalRegions::Expansion2D::v_AddEdgeNormBoundaryInt ( const int  edge,
const ExpansionSharedPtr EdgeExp,
const Array< OneD, const NekDouble > &  Fn,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Definition at line 127 of file Expansion2D.cpp.

References ASSERTL0, Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::eEdgeToElement, Nektar::StdRegions::eFactorGaussEdge, Nektar::LibUtilities::eGauss_Lagrange, Nektar::StdRegions::eGaussDG, Nektar::StdRegions::eMass, Nektar::LibUtilities::eSegment, Nektar::StdRegions::StdExpansion::GetBasisNumModes(), Nektar::StdRegions::StdExpansion::GetEorient(), GetGeom2D(), Nektar::StdRegions::StdExpansion::GetNedges(), Nektar::LibUtilities::InterpCoeff1D(), Nektar::StdRegions::StdExpansion::m_base, m_edgeExp, m_negatedNormals, m_requireNeg, Nektar::StdRegions::StdExpansion::m_stdMatrixManager, and Vmath::Neg().

132  {
133  int i;
134 
135  if (m_requireNeg.size() == 0)
136  {
137  m_requireNeg.resize(GetNedges());
138 
139  for (i = 0; i < GetNedges(); ++i)
140  {
141  m_requireNeg[i] = false;
142  if (m_negatedNormals[i])
143  {
144  m_requireNeg[i] = true;
145  continue;
146  }
147 
148  Expansion1DSharedPtr edgeExp =
149  m_edgeExp[i].lock()->as<Expansion1D>();
150 
151  if (edgeExp->GetRightAdjacentElementExp())
152  {
153  if (edgeExp->GetRightAdjacentElementExp()->GetGeom2D()
154  ->GetGlobalID() == GetGeom2D()->GetGlobalID())
155  {
156  m_requireNeg[i] = true;
157  }
158  }
159  }
160  }
161 
162  StdRegions::IndexMapKey ikey(
165  edge, GetEorient(edge));
167  StdExpansion::GetIndexMap(ikey);
168 
169  // Order of the element
170  int order_e = map->num_elements();
171  // Order of the trace
172  int n_coeffs = EdgeExp->GetNcoeffs();
173 
174  Array<OneD, NekDouble> edgeCoeffs(n_coeffs);
175  if(n_coeffs!=order_e) // Going to orthogonal space
176  {
177  EdgeExp->FwdTrans(Fn, edgeCoeffs);
178  Expansion1DSharedPtr locExp = EdgeExp->as<Expansion1D>();
179 
180  if (m_requireNeg[edge])
181  {
182  Vmath::Neg(n_coeffs, edgeCoeffs, 1);
183  }
184 
185  Array<OneD, NekDouble> coeff(n_coeffs,0.0);
186  LibUtilities::BasisType btype = ((LibUtilities::BasisType) 1); //1-->Ortho_A
187  LibUtilities::BasisKey bkey_ortho(btype,EdgeExp->GetBasis(0)->GetNumModes(),EdgeExp->GetBasis(0)->GetPointsKey());
188  LibUtilities::BasisKey bkey(EdgeExp->GetBasis(0)->GetBasisType(),EdgeExp->GetBasis(0)->GetNumModes(),EdgeExp->GetBasis(0)->GetPointsKey());
189  LibUtilities::InterpCoeff1D(bkey,edgeCoeffs,bkey_ortho,coeff);
190 
191  // Cutting high frequencies
192  for(i = order_e; i < n_coeffs; i++)
193  {
194  coeff[i] = 0.0;
195  }
196 
197  LibUtilities::InterpCoeff1D(bkey_ortho,coeff,bkey,edgeCoeffs);
198 
199  StdRegions::StdMatrixKey masskey(StdRegions::eMass,LibUtilities::eSegment,*EdgeExp);
200  EdgeExp->MassMatrixOp(edgeCoeffs, edgeCoeffs, masskey);
201  }
202  else
203  {
204  EdgeExp->IProductWRTBase(Fn, edgeCoeffs);
205 
206  Expansion1DSharedPtr locExp = EdgeExp->as<Expansion1D>();
207 
208  if (m_requireNeg[edge])
209  {
210  Vmath::Neg(n_coeffs, edgeCoeffs, 1);
211  }
212  }
213 
214  // Implementation for all the basis except Gauss points
215  if(EdgeExp->GetBasis(0)->GetBasisType() !=
217  {
218  // add data to outarray if forward edge normal is outwards
219  for(i = 0; i < order_e; ++i)
220  {
221  outarray[(*map)[i].index] +=
222  (*map)[i].sign * edgeCoeffs[i];
223  }
224  }
225  else
226  {
227  int nCoeffs0, nCoeffs1;
228  int j;
229 
231  factors[StdRegions::eFactorGaussEdge] = edge;
232  StdRegions::StdMatrixKey key(StdRegions::eGaussDG,
233  DetShapeType(),*this,factors);
234 
235  DNekMatSharedPtr mat_gauss = m_stdMatrixManager[key];
236 
237  switch(edge)
238  {
239  case 0:
240  {
241  nCoeffs1 = m_base[1]->GetNumModes();
242 
243  for(i = 0; i < order_e; ++i)
244  {
245  for(j = 0; j < nCoeffs1; j++)
246  {
247  outarray[(*map)[i].index + j*order_e] +=
248  mat_gauss->GetPtr()[j]*
249  (*map)[i].sign*edgeCoeffs[i];
250  }
251  }
252  break;
253  }
254  case 1:
255  {
256  nCoeffs0 = m_base[0]->GetNumModes();
257 
258  for(i = 0; i < order_e; ++i)
259  {
260  for(j = 0; j < nCoeffs0; j++)
261  {
262  outarray[(*map)[i].index - j] +=
263  mat_gauss->GetPtr()[order_e - 1 -j]*
264  (*map)[i].sign*edgeCoeffs[i];
265  }
266  }
267  break;
268  }
269  case 2:
270  {
271  nCoeffs1 = m_base[1]->GetNumModes();
272 
273  for(i = 0; i < order_e; ++i)
274  {
275  for(j = 0; j < nCoeffs1; j++)
276  {
277  outarray[(*map)[i].index - j*order_e] +=
278  mat_gauss->GetPtr()[order_e - 1 - j]*
279  (*map)[i].sign*edgeCoeffs[i];
280  }
281  }
282  break;
283  }
284  case 3:
285  {
286  nCoeffs0 = m_base[0]->GetNumModes();
287 
288  for(i = 0; i < order_e; ++i)
289  {
290  for(j = 0; j < nCoeffs0; j++)
291  {
292  outarray[(*map)[i].index + j] +=
293  mat_gauss->GetPtr()[j]*
294  (*map)[i].sign*edgeCoeffs[i];
295  }
296  }
297  break;
298  }
299  default:
300  ASSERTL0(false,"edge value (< 3) is out of range");
301  break;
302  }
303  }
304  }
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:470
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
boost::shared_ptr< IndexMapValues > IndexMapValuesSharedPtr
Definition: IndexMapKey.h:126
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
Definition: StdExpansion.h:178
void InterpCoeff1D(const BasisKey &fbasis0, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, Array< OneD, NekDouble > &to)
Definition: InterpCoeff.cpp:47
std::map< int, bool > m_negatedNormals
Definition: Expansion2D.h:136
Lagrange Polynomials using the Gauss points .
Definition: BasisType.h:54
StdRegions::Orientation GetEorient(int edge)
Definition: StdExpansion.h:768
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:252
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
std::vector< bool > m_requireNeg
Definition: Expansion2D.h:134
SpatialDomains::Geometry2DSharedPtr GetGeom2D() const
Definition: Expansion2D.h:269
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:396
std::vector< Expansion1DWeakPtr > m_edgeExp
Definition: Expansion2D.h:133
LibUtilities::NekManager< StdMatrixKey, DNekMat, StdMatrixKey::opLess > m_stdMatrixManager
Array< OneD, LibUtilities::BasisSharedPtr > m_base
boost::shared_ptr< Expansion1D > Expansion1DSharedPtr
Definition: Expansion1D.h:53
int GetNedges() const
This function returns the number of edges of the expansion domain.
Definition: StdExpansion.h:272
void Nektar::LocalRegions::Expansion2D::v_AddRobinEdgeContribution ( const int  edgeid,
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 1260 of file Expansion2D.cpp.

References ASSERTL1, Nektar::StdRegions::eMass, Nektar::LibUtilities::eSegment, Nektar::StdRegions::eVarCoeffMass, Nektar::StdRegions::StdExpansion::GetEdgeToElementMap(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::IsBoundaryInteriorExpansion(), m_edgeExp, Nektar::StdRegions::NullConstFactorMap, sign, Nektar::StdRegions::StdExpansion::v_GetEorient(), and Vmath::Zero().

1261  {
1263  "Not set up for non boundary-interior expansions");
1264  int i;
1265  ExpansionSharedPtr edgeExp = m_edgeExp[edgeid].lock();
1266  int order_e = edgeExp->GetNcoeffs();
1267 
1268  Array<OneD,unsigned int> map;
1269  Array<OneD,int> sign;
1270 
1271  StdRegions::VarCoeffMap varcoeffs;
1272  varcoeffs[StdRegions::eVarCoeffMass] = primCoeffs;
1273 
1274  LocalRegions::MatrixKey mkey(StdRegions::eMass,LibUtilities::eSegment, *edgeExp, StdRegions::NullConstFactorMap, varcoeffs);
1275  DNekScalMat &edgemat = *edgeExp->GetLocMatrix(mkey);
1276 
1277  NekVector<NekDouble> vEdgeCoeffs (order_e);
1278 
1279  GetEdgeToElementMap(edgeid,v_GetEorient(edgeid),map,sign);
1280 
1281  for (i = 0; i < order_e; ++i)
1282  {
1283  vEdgeCoeffs[i] = coeffs[map[i]]*sign[i];
1284  }
1285  Vmath::Zero(GetNcoeffs(), coeffs, 1);
1286 
1287  vEdgeCoeffs = edgemat * vEdgeCoeffs;
1288 
1289  for (i = 0; i < order_e; ++i)
1290  {
1291  coeffs[map[i]] = vEdgeCoeffs[i]*sign[i];
1292  }
1293  }
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:27
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:227
boost::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
void GetEdgeToElementMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int P=-1)
Definition: StdExpansion.h:851
std::vector< Expansion1DWeakPtr > m_edgeExp
Definition: Expansion2D.h:133
virtual StdRegions::Orientation v_GetEorient(int edge)
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:131
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:373
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:253
void Nektar::LocalRegions::Expansion2D::v_AddRobinMassMatrix ( const int  edgeid,
const Array< OneD, const NekDouble > &  primCoeffs,
DNekMatSharedPtr inoutmat 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1135 of file Expansion2D.cpp.

References ASSERTL0, ASSERTL1, Nektar::StdRegions::eBackwards, Nektar::LibUtilities::eGauss_Lagrange, Nektar::LibUtilities::eGLL_Lagrange, Nektar::StdRegions::eMass, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eSegment, Nektar::StdRegions::eVarCoeffMass, Nektar::StdRegions::StdExpansion::GetBoundaryMap(), Nektar::StdRegions::StdExpansion::GetEdgeNcoeffs(), Nektar::StdRegions::StdExpansion::GetEdgeToElementMap(), Nektar::StdRegions::StdExpansion::GetEorient(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::IsBoundaryInteriorExpansion(), m_edgeExp, Nektar::StdRegions::NullConstFactorMap, Nektar::StdRegions::StdExpansion::NumBndryCoeffs(), Nektar::StdRegions::StdExpansion::NumDGBndryCoeffs(), sign, and Nektar::StdRegions::StdExpansion::v_GetEorient().

1136  {
1138  "Not set up for non boundary-interior expansions");
1139  ASSERTL1(inoutmat->GetRows() == inoutmat->GetColumns(),
1140  "Assuming that input matrix was square");
1141  int i,j;
1142  int id1,id2;
1143  ExpansionSharedPtr edgeExp = m_edgeExp[edge].lock();
1144  int order_e = edgeExp->GetNcoeffs();
1145 
1146  Array<OneD,unsigned int> map;
1147  Array<OneD,int> sign;
1148 
1149  StdRegions::VarCoeffMap varcoeffs;
1150  varcoeffs[StdRegions::eVarCoeffMass] = primCoeffs;
1151 
1152  LocalRegions::MatrixKey mkey(StdRegions::eMass,LibUtilities::eSegment, *edgeExp, StdRegions::NullConstFactorMap, varcoeffs);
1153  DNekScalMat &edgemat = *edgeExp->GetLocMatrix(mkey);
1154 
1155  // Now need to identify a map which takes the local edge
1156  // mass matrix to the matrix stored in inoutmat;
1157  // This can currently be deduced from the size of the matrix
1158 
1159  // - if inoutmat.m_rows() == v_NCoeffs() it is a full
1160  // matrix system
1161 
1162  // - if inoutmat.m_rows() == v_NumBndCoeffs() it is a
1163  // boundary CG system
1164 
1165  // - if inoutmat.m_rows() == v_NumDGBndCoeffs() it is a
1166  // trace DG system
1167  int rows = inoutmat->GetRows();
1168 
1169  if (rows == GetNcoeffs())
1170  {
1171  GetEdgeToElementMap(edge,v_GetEorient(edge),map,sign);
1172  }
1173  else if(rows == NumBndryCoeffs())
1174  {
1175  int nbndry = NumBndryCoeffs();
1176  Array<OneD,unsigned int> bmap(nbndry);
1177 
1178  GetEdgeToElementMap(edge,v_GetEorient(edge),map,sign);
1179 
1180  GetBoundaryMap(bmap);
1181 
1182  for(i = 0; i < order_e; ++i)
1183  {
1184  for(j = 0; j < nbndry; ++j)
1185  {
1186  if(map[i] == bmap[j])
1187  {
1188  map[i] = j;
1189  break;
1190  }
1191  }
1192  ASSERTL1(j != nbndry,"Did not find number in map");
1193  }
1194  }
1195  else if (rows == NumDGBndryCoeffs())
1196  {
1197  // possibly this should be a separate method
1198  int cnt = 0;
1199  map = Array<OneD, unsigned int> (order_e);
1200  sign = Array<OneD, int> (order_e,1);
1201 
1202  for(i = 0; i < edge; ++i)
1203  {
1204  cnt += GetEdgeNcoeffs(i);
1205  }
1206 
1207  for(i = 0; i < order_e; ++i)
1208  {
1209  map[i] = cnt++;
1210  }
1211  // check for mapping reversal
1212  if(GetEorient(edge) == StdRegions::eBackwards)
1213  {
1214  switch(edgeExp->GetBasis(0)->GetBasisType())
1215  {
1217  reverse( map.get() , map.get()+order_e);
1218  break;
1220  reverse( map.get() , map.get()+order_e);
1221  break;
1223  {
1224  swap(map[0],map[1]);
1225  for(i = 3; i < order_e; i+=2)
1226  {
1227  sign[i] = -1;
1228  }
1229  }
1230  break;
1231  default:
1232  ASSERTL0(false,"Edge boundary type not valid for this method");
1233  }
1234  }
1235  }
1236  else
1237  {
1238  ASSERTL0(false,"Could not identify matrix type from dimension");
1239  }
1240 
1241  for(i = 0; i < order_e; ++i)
1242  {
1243  id1 = map[i];
1244  for(j = 0; j < order_e; ++j)
1245  {
1246  id2 = map[j];
1247  (*inoutmat)(id1,id2) += edgemat(i,j)*sign[i]*sign[j];
1248  }
1249  }
1250  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:27
Principle Modified Functions .
Definition: BasisType.h:49
Lagrange Polynomials using the Gauss points .
Definition: BasisType.h:54
StdRegions::Orientation GetEorient(int edge)
Definition: StdExpansion.h:768
int GetEdgeNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th edge.
Definition: StdExpansion.h:287
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:227
boost::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
void GetEdgeToElementMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int P=-1)
Definition: StdExpansion.h:851
std::vector< Expansion1DWeakPtr > m_edgeExp
Definition: Expansion2D.h:133
virtual StdRegions::Orientation v_GetEorient(int edge)
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:131
Lagrange for SEM basis .
Definition: BasisType.h:53
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:814
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:253
DNekMatSharedPtr Nektar::LocalRegions::Expansion2D::v_BuildVertexMatrix ( const DNekScalMatSharedPtr r_bnd)
protectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1295 of file Expansion2D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::eFULL, Nektar::StdRegions::StdExpansion::GetNverts(), and Nektar::StdRegions::StdExpansion::GetVertexMap().

1297  {
1298  MatrixStorage storage = eFULL;
1299  DNekMatSharedPtr m_vertexmatrix;
1300 
1301  int nVerts, vid1, vid2, vMap1, vMap2;
1302  NekDouble VertexValue;
1303 
1304  nVerts = GetNverts();
1305 
1306  m_vertexmatrix =
1308  nVerts, nVerts, 0.0, storage);
1309  DNekMat &VertexMat = (*m_vertexmatrix);
1310 
1311  for (vid1 = 0; vid1 < nVerts; ++vid1)
1312  {
1313  vMap1 = GetVertexMap(vid1);
1314 
1315  for (vid2 = 0; vid2 < nVerts; ++vid2)
1316  {
1317  vMap2 = GetVertexMap(vid2);
1318  VertexValue = (*r_bnd)(vMap1, vMap2);
1319  VertexMat.SetValue(vid1, vid2, VertexValue);
1320  }
1321  }
1322 
1323  return m_vertexmatrix;
1324  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
int GetVertexMap(const int localVertexId, bool useCoeffPacking=false)
Definition: StdExpansion.h:824
NekMatrix< NekDouble, StandardMatrixTag > DNekMat
Definition: NekTypeDefs.hpp:52
double NekDouble
int GetNverts() const
This function returns the number of vertices of the expansion domain.
Definition: StdExpansion.h:259
void Nektar::LocalRegions::Expansion2D::v_DGDeriv ( const int  dir,
const Array< OneD, const NekDouble > &  incoeffs,
Array< OneD, ExpansionSharedPtr > &  EdgeExp,
Array< OneD, Array< OneD, NekDouble > > &  edgeCoeffs,
Array< OneD, NekDouble > &  out_d 
)
protectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1097 of file Expansion2D.cpp.

References AddNormTraceInt(), Nektar::StdRegions::eInvMass, Nektar::StdRegions::eWeakDeriv0, Nektar::StdRegions::eWeakDeriv1, Nektar::StdRegions::eWeakDeriv2, Nektar::eWrapper, Nektar::LocalRegions::Expansion::GetLocMatrix(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Vmath::Neg(), and Nektar::Transpose().

1103  {
1107 
1108  int ncoeffs = GetNcoeffs();
1109 
1111  DNekScalMat &Dmat = *GetLocMatrix(DerivType[dir]);
1112 
1113  Array<OneD, NekDouble> coeffs = incoeffs;
1114  DNekVec Coeffs (ncoeffs,coeffs, eWrapper);
1115 
1116  Coeffs = Transpose(Dmat)*Coeffs;
1117  Vmath::Neg(ncoeffs, coeffs,1);
1118 
1119  // Add the boundary integral including the relevant part of
1120  // the normal
1121  AddNormTraceInt(dir, EdgeExp, edgeCoeffs, coeffs);
1122 
1123  DNekVec Out_d (ncoeffs,out_d,eWrapper);
1124 
1125  Out_d = InvMass*Coeffs;
1126  }
void AddNormTraceInt(const int dir, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &edgeCoeffs, Array< OneD, NekDouble > &outarray)
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:396
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition: Expansion.cpp:85
NekVector< NekDouble > DNekVec
Definition: NekTypeDefs.hpp:49
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:131
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
bool Nektar::LocalRegions::Expansion2D::v_EdgeNormalNegated ( const int  edge)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1395 of file Expansion2D.cpp.

References m_negatedNormals.

1396  {
1397  return m_negatedNormals[edge];
1398  }
std::map< int, bool > m_negatedNormals
Definition: Expansion2D.h:136
DNekMatSharedPtr Nektar::LocalRegions::Expansion2D::v_GenMatrix ( const StdRegions::StdMatrixKey mkey)
protectedvirtual

Computes matrices needed for the HDG formulation. References to equations relate to the following paper: R. M. Kirby, S. J. Sherwin, B. Cockburn, To CG or to HDG: A Comparative Study, J. Sci. Comp P1-30 DOI 10.1007/s10915-011-9501-7

TODO: Add variable coeffs

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::QuadExp, Nektar::LocalRegions::TriExp, and Nektar::LocalRegions::NodalTriExp.

Definition at line 641 of file Expansion2D.cpp.

References AddHDGHelmholtzTraceTerms(), AddNormTraceInt(), Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, ASSERTL1, Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::eFactorLambda, Nektar::StdRegions::eFactorTau, Nektar::StdRegions::eForwards, Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::StdRegions::eHybridDGHelmholtz, Nektar::StdRegions::eHybridDGLamToQ0, Nektar::StdRegions::eHybridDGLamToQ1, Nektar::StdRegions::eHybridDGLamToQ2, Nektar::StdRegions::eHybridDGLamToU, Nektar::StdRegions::eInvHybridDGHelmholtz, Nektar::StdRegions::eInvLaplacianWithUnityMean, Nektar::StdRegions::eInvMass, Nektar::StdRegions::eLaplacian, Nektar::StdRegions::eMass, Nektar::StdRegions::eVarCoeffD00, Nektar::StdRegions::eVarCoeffD11, Nektar::StdRegions::eVarCoeffD22, Nektar::StdRegions::eVarCoeffMass, Nektar::StdRegions::eWeakDeriv0, Nektar::StdRegions::eWeakDeriv1, Nektar::StdRegions::eWeakDeriv2, Nektar::eWrapper, Vmath::Fill(), Nektar::StdRegions::StdMatrixKey::GetConstFactor(), Nektar::StdRegions::StdMatrixKey::GetConstFactors(), Nektar::StdRegions::StdExpansion::GetCoordim(), GetEdgeExp(), Nektar::StdRegions::StdExpansion::GetEdgeNormal(), Nektar::StdRegions::StdExpansion::GetEdgeToElementMap(), Nektar::StdRegions::StdExpansion::GetEorient(), Nektar::LocalRegions::Expansion::GetLocMatrix(), Nektar::StdRegions::StdMatrixKey::GetMatrixType(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::GetNedges(), GetPhysEdgeVarCoeffsFromElement(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::StdRegions::StdMatrixKey::GetVarCoeff(), Nektar::StdRegions::StdMatrixKey::GetVarCoeffAsMap(), Nektar::StdRegions::StdMatrixKey::GetVarCoeffs(), Nektar::StdRegions::StdMatrixKey::HasVarCoeff(), Nektar::StdRegions::StdExpansion::IProductWRTBase(), Nektar::StdRegions::StdExpansion::IsBoundaryInteriorExpansion(), Nektar::StdRegions::StdExpansion::m_ncoeffs, m_negatedNormals, Vmath::Neg(), Nektar::StdRegions::NullConstFactorMap, Nektar::StdRegions::StdExpansion::NumDGBndryCoeffs(), SetTraceToGeomOrientation(), sign, Vmath::Svtvp(), Nektar::Transpose(), Vmath::Vcopy(), Vmath::Vmul(), Vmath::Vvtvp(), and Vmath::Zero().

Referenced by Nektar::LocalRegions::NodalTriExp::v_GenMatrix(), Nektar::LocalRegions::TriExp::v_GenMatrix(), and Nektar::LocalRegions::QuadExp::v_GenMatrix().

642  {
643  DNekMatSharedPtr returnval;
644 
645  switch(mkey.GetMatrixType())
646  {
647  // (Z^e)^{-1} (Eqn. 33, P22)
649  {
651  "HybridDGHelmholtz matrix not set up "
652  "for non boundary-interior expansions");
653 
654  int i,j,k;
655  NekDouble lambdaval = mkey.GetConstFactor(StdRegions::eFactorLambda);
656  NekDouble tau = mkey.GetConstFactor(StdRegions::eFactorTau);
657  int ncoeffs = GetNcoeffs();
658  int nedges = GetNedges();
659 
660  Array<OneD,unsigned int> emap;
661  Array<OneD,int> sign;
663  ExpansionSharedPtr EdgeExp;
664  ExpansionSharedPtr EdgeExp2;
665 
666  int order_e, coordim = GetCoordim();
671  DNekMat LocMat(ncoeffs,ncoeffs);
672 
673  returnval = MemoryManager<DNekMat>::AllocateSharedPtr(ncoeffs,ncoeffs);
674  DNekMat &Mat = *returnval;
675  Vmath::Zero(ncoeffs*ncoeffs,Mat.GetPtr(),1);
676 
680 
681  for(i=0; i < coordim; ++i)
682  {
683  if(mkey.HasVarCoeff(Coeffs[i]))
684  {
685  MatrixKey DmatkeyL(DerivType[i], DetShapeType(), *this, StdRegions::NullConstFactorMap, mkey.GetVarCoeffAsMap(Coeffs[i]));
686  MatrixKey DmatkeyR(DerivType[i], DetShapeType(), *this);
687 
688  DNekScalMat &DmatL = *GetLocMatrix(DmatkeyL);
689  DNekScalMat &DmatR = *GetLocMatrix(DmatkeyR);
690  Mat = Mat + DmatL*invMass*Transpose(DmatR);
691  }
692  else
693  {
694  DNekScalMat &Dmat = *GetLocMatrix(DerivType[i]);
695  Mat = Mat + Dmat*invMass*Transpose(Dmat);
696  }
697 
698  }
699 
700  // Add Mass Matrix Contribution for Helmholtz problem
702  Mat = Mat + lambdaval*Mass;
703 
704  // Add tau*E_l using elemental mass matrices on each edge
705  for(i = 0; i < nedges; ++i)
706  {
707  EdgeExp = GetEdgeExp(i);
708  EdgeExp2 = GetEdgeExp(i);
709  order_e = EdgeExp->GetNcoeffs();
710  int nq = EdgeExp->GetNumPoints(0);
711  GetEdgeToElementMap(i,edgedir,emap,sign);
712 
713  // @TODO: Document
714  StdRegions::VarCoeffMap edgeVarCoeffs;
715  if (mkey.HasVarCoeff(StdRegions::eVarCoeffD00))
716  {
717  Array<OneD, NekDouble> mu(nq);
718  GetPhysEdgeVarCoeffsFromElement(i, EdgeExp2, mkey.GetVarCoeff(StdRegions::eVarCoeffD00), mu);
719  edgeVarCoeffs[StdRegions::eVarCoeffMass] = mu;
720  }
721  DNekScalMat &eMass = *EdgeExp->GetLocMatrix(StdRegions::eMass, StdRegions::NullConstFactorMap, edgeVarCoeffs);
722  //DNekScalMat &eMass = *EdgeExp->GetLocMatrix(StdRegions::eMass);
723 
724  for(j = 0; j < order_e; ++j)
725  {
726  for(k = 0; k < order_e; ++k)
727  {
728  Mat(emap[j],emap[k]) = Mat(emap[j],emap[k]) + tau*sign[j]*sign[k]*eMass(j,k);
729  }
730  }
731  }
732  }
733  break;
734  // U^e (P22)
736  {
737  int i,j,k;
738  int nbndry = NumDGBndryCoeffs();
739  int ncoeffs = GetNcoeffs();
740  int nedges = GetNedges();
741  NekDouble tau = mkey.GetConstFactor(StdRegions::eFactorTau);
742 
743  Array<OneD,NekDouble> lambda(nbndry);
744  DNekVec Lambda(nbndry,lambda,eWrapper);
745  Array<OneD,NekDouble> ulam(ncoeffs);
746  DNekVec Ulam(ncoeffs,ulam,eWrapper);
747  Array<OneD,NekDouble> f(ncoeffs);
748  DNekVec F(ncoeffs,f,eWrapper);
749 
750  Array<OneD, ExpansionSharedPtr> EdgeExp(nedges);
751  // declare matrix space
752  returnval = MemoryManager<DNekMat>::AllocateSharedPtr(ncoeffs,nbndry);
753  DNekMat &Umat = *returnval;
754 
755  // Z^e matrix
756  MatrixKey newkey(StdRegions::eInvHybridDGHelmholtz, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
757  DNekScalMat &invHmat = *GetLocMatrix(newkey);
758 
759  Array<OneD,unsigned int> emap;
760  Array<OneD,int> sign;
761 
762  for(i = 0; i < nedges; ++i)
763  {
764  EdgeExp[i] = GetEdgeExp(i);
765  }
766 
767  // for each degree of freedom of the lambda space
768  // calculate Umat entry
769  // Generate Lambda to U_lambda matrix
770  for(j = 0; j < nbndry; ++j)
771  {
772  // standard basis vectors e_j
773  Vmath::Zero(nbndry,&lambda[0],1);
774  Vmath::Zero(ncoeffs,&f[0],1);
775  lambda[j] = 1.0;
776 
777  SetTraceToGeomOrientation(EdgeExp,lambda);
778 
779  // Compute F = [I D_1 M^{-1} D_2 M^{-1}] C e_j
781  tau, lambda, EdgeExp, mkey.GetVarCoeffs(), f);
782 
783  // Compute U^e_j
784  Ulam = invHmat*F; // generate Ulam from lambda
785 
786  // fill column of matrix
787  for(k = 0; k < ncoeffs; ++k)
788  {
789  Umat(k,j) = Ulam[k];
790  }
791  }
792  }
793  break;
794  // Q_0, Q_1, Q_2 matrices (P23)
795  // Each are a product of a row of Eqn 32 with the C matrix.
796  // Rather than explicitly computing all of Eqn 32, we note each
797  // row is almost a multiple of U^e, so use that as our starting
798  // point.
802  {
803  int i,j,k,dir;
804  int nbndry = NumDGBndryCoeffs();
805  int ncoeffs = GetNcoeffs();
806  int nedges = GetNedges();
807 
808  Array<OneD,NekDouble> lambda(nbndry);
809  DNekVec Lambda(nbndry,lambda,eWrapper);
810  Array<OneD, ExpansionSharedPtr> EdgeExp(nedges);
811 
812  Array<OneD,NekDouble> ulam(ncoeffs);
813  DNekVec Ulam(ncoeffs,ulam,eWrapper);
814  Array<OneD,NekDouble> f(ncoeffs);
815  DNekVec F(ncoeffs,f,eWrapper);
816 
817  // declare matrix space
818  returnval = MemoryManager<DNekMat>::AllocateSharedPtr(ncoeffs,nbndry);
819  DNekMat &Qmat = *returnval;
820 
821  // Lambda to U matrix
822  MatrixKey lamToUkey(StdRegions::eHybridDGLamToU, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
823  DNekScalMat &lamToU = *GetLocMatrix(lamToUkey);
824 
825  // Inverse mass matrix
827 
828  for(i = 0; i < nedges; ++i)
829  {
830  EdgeExp[i] = GetEdgeExp(i);
831  }
832 
833  //Weak Derivative matrix
835  switch(mkey.GetMatrixType())
836  {
838  dir = 0;
840  break;
842  dir = 1;
844  break;
846  dir = 2;
848  break;
849  default:
850  ASSERTL0(false,"Direction not known");
851  break;
852  }
853 
854  // for each degree of freedom of the lambda space
855  // calculate Qmat entry
856  // Generate Lambda to Q_lambda matrix
857  for(j = 0; j < nbndry; ++j)
858  {
859  Vmath::Zero(nbndry,&lambda[0],1);
860  lambda[j] = 1.0;
861 
862  // for lambda[j] = 1 this is the solution to ulam
863  for(k = 0; k < ncoeffs; ++k)
864  {
865  Ulam[k] = lamToU(k,j);
866  }
867 
868  // -D^T ulam
869  Vmath::Neg(ncoeffs,&ulam[0],1);
870  F = Transpose(*Dmat)*Ulam;
871 
872  SetTraceToGeomOrientation(EdgeExp,lambda);
873 
874  // Add the C terms resulting from the I's on the
875  // diagonals of Eqn 32
876  AddNormTraceInt(dir,lambda,EdgeExp,f,mkey.GetVarCoeffs());
877 
878  // finally multiply by inverse mass matrix
879  Ulam = invMass*F;
880 
881  // fill column of matrix (Qmat is in column major format)
882  Vmath::Vcopy(ncoeffs,&ulam[0],1,&(Qmat.GetPtr())[0]+j*ncoeffs,1);
883  }
884  }
885  break;
886  // Matrix K (P23)
888  {
889  int i,j,e,cnt;
890  int order_e, nquad_e;
891  int nbndry = NumDGBndryCoeffs();
892  int coordim = GetCoordim();
893  int nedges = GetNedges();
894  NekDouble tau = mkey.GetConstFactor(StdRegions::eFactorTau);
895 
896  Array<OneD,NekDouble> work, varcoeff_work;
897  Array<OneD,const Array<OneD, NekDouble> > normals;
898  Array<OneD, ExpansionSharedPtr> EdgeExp(nedges);
899  Array<OneD, NekDouble> lam(nbndry);
900 
901  Array<OneD,unsigned int> emap;
902  Array<OneD, int> sign;
903  StdRegions::Orientation edgedir;
904 
905  // declare matrix space
906  returnval = MemoryManager<DNekMat>::AllocateSharedPtr(nbndry, nbndry);
907  DNekMat &BndMat = *returnval;
908 
909  DNekScalMatSharedPtr LamToQ[3];
910 
911  // Matrix to map Lambda to U
912  MatrixKey LamToUkey(StdRegions::eHybridDGLamToU, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
913  DNekScalMat &LamToU = *GetLocMatrix(LamToUkey);
914 
915  // Matrix to map Lambda to Q0
916  MatrixKey LamToQ0key(StdRegions::eHybridDGLamToQ0, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
917  LamToQ[0] = GetLocMatrix(LamToQ0key);
918 
919  // Matrix to map Lambda to Q1
920  MatrixKey LamToQ1key(StdRegions::eHybridDGLamToQ1, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
921  LamToQ[1] = GetLocMatrix(LamToQ1key);
922 
923  // Matrix to map Lambda to Q2 for 3D coordinates
924  if (coordim == 3)
925  {
926  MatrixKey LamToQ2key(StdRegions::eHybridDGLamToQ2, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
927  LamToQ[2] = GetLocMatrix(LamToQ2key);
928  }
929 
930  // Set up edge segment expansions from local geom info
931  for(i = 0; i < nedges; ++i)
932  {
933  EdgeExp[i] = GetEdgeExp(i);
934  }
935 
936  // Set up matrix derived from <mu, Q_lam.n - \tau (U_lam - Lam) >
937  for(i = 0; i < nbndry; ++i)
938  {
939  cnt = 0;
940 
941  Vmath::Zero(nbndry,lam,1);
942  lam[i] = 1.0;
943  SetTraceToGeomOrientation(EdgeExp,lam);
944 
945  for(e = 0; e < nedges; ++e)
946  {
947  order_e = EdgeExp[e]->GetNcoeffs();
948  nquad_e = EdgeExp[e]->GetNumPoints(0);
949 
950  normals = GetEdgeNormal(e);
951  edgedir = GetEorient(e);
952 
953  work = Array<OneD,NekDouble>(nquad_e);
954  varcoeff_work = Array<OneD, NekDouble>(nquad_e);
955 
956  GetEdgeToElementMap(e,edgedir,emap,sign);
957 
958 
962  const StdRegions::VarCoeffMap &varcoeffs = mkey.GetVarCoeffs();
963  StdRegions::VarCoeffMap::const_iterator x;
964 
965  // Q0 * n0 (BQ_0 terms)
966  Array<OneD, NekDouble> edgeCoeffs(order_e);
967  Array<OneD, NekDouble> edgePhys (nquad_e);
968  for(j = 0; j < order_e; ++j)
969  {
970  edgeCoeffs[j] = sign[j]*(*LamToQ[0])(emap[j],i);
971  }
972 
973  EdgeExp[e]->BwdTrans(edgeCoeffs, edgePhys);
974 // @TODO Var coeffs
975  // Multiply by variable coefficient
976 // if ((x = varcoeffs.find(VarCoeff[0])) != varcoeffs.end())
977 // {
978 // GetPhysEdgeVarCoeffsFromElement(e,EdgeExp[e],x->second,varcoeff_work);
979 // Vmath::Vmul(nquad_e,varcoeff_work,1,EdgeExp[e]->GetPhys(),1,EdgeExp[e]->UpdatePhys(),1);
980 // }
981 
982  Vmath::Vmul(nquad_e, normals[0], 1, edgePhys, 1, work, 1);
983 
984  // Q1 * n1 (BQ_1 terms)
985  for(j = 0; j < order_e; ++j)
986  {
987  edgeCoeffs[j] = sign[j]*(*LamToQ[1])(emap[j],i);
988  }
989 
990  EdgeExp[e]->BwdTrans(edgeCoeffs, edgePhys);
991 
992 // @TODO var coeffs
993  // Multiply by variable coefficients
994 // if ((x = varcoeffs.find(VarCoeff[1])) != varcoeffs.end())
995 // {
996 // GetPhysEdgeVarCoeffsFromElement(e,EdgeExp[e],x->second,varcoeff_work);
997 // Vmath::Vmul(nquad_e,varcoeff_work,1,EdgeExp[e]->GetPhys(),1,EdgeExp[e]->UpdatePhys(),1);
998 // }
999 
1000  Vmath::Vvtvp(nquad_e, normals[1], 1, edgePhys, 1,
1001  work, 1, work, 1);
1002 
1003  // Q2 * n2 (BQ_2 terms)
1004  if (coordim == 3)
1005  {
1006  for(j = 0; j < order_e; ++j)
1007  {
1008  edgeCoeffs[j] = sign[j]*(*LamToQ[2])(emap[j],i);
1009  }
1010 
1011  EdgeExp[e]->BwdTrans(edgeCoeffs, edgePhys);
1012 // @TODO var coeffs
1013  // Multiply by variable coefficients
1014 // if ((x = varcoeffs.find(VarCoeff[2])) != varcoeffs.end())
1015 // {
1016 // GetPhysEdgeVarCoeffsFromElement(e,EdgeExp[e],x->second,varcoeff_work);
1017 // Vmath::Vmul(nquad_e,varcoeff_work,1,EdgeExp[e]->GetPhys(),1,EdgeExp[e]->UpdatePhys(),1);
1018 // }
1019 
1020  Vmath::Vvtvp(nquad_e, normals[2], 1, edgePhys, 1,
1021  work, 1, work, 1);
1022  }
1023 
1024  if (m_negatedNormals[e])
1025  {
1026  Vmath::Neg(nquad_e, work, 1);
1027  }
1028 
1029  // - tau (ulam - lam)
1030  // Corresponds to the G and BU terms.
1031  for(j = 0; j < order_e; ++j)
1032  {
1033  edgeCoeffs[j] = sign[j]*LamToU(emap[j],i) - lam[cnt+j];
1034  }
1035 
1036  EdgeExp[e]->BwdTrans(edgeCoeffs, edgePhys);
1037 
1038  // Multiply by variable coefficients
1039  if ((x = varcoeffs.find(VarCoeff[0])) != varcoeffs.end())
1040  {
1041  GetPhysEdgeVarCoeffsFromElement(e,EdgeExp[e],x->second,varcoeff_work);
1042  Vmath::Vmul(nquad_e,varcoeff_work,1,edgePhys,1,edgePhys,1);
1043  }
1044 
1045  Vmath::Svtvp(nquad_e,-tau,edgePhys,1,
1046  work,1,work,1);
1047 /// TODO: Add variable coeffs
1048  EdgeExp[e]->IProductWRTBase(work, edgeCoeffs);
1049 
1050  EdgeExp[e]->SetCoeffsToOrientation(edgeCoeffs, edgedir);
1051 
1052  for(j = 0; j < order_e; ++j)
1053  {
1054  BndMat(cnt+j,i) = edgeCoeffs[j];
1055  }
1056 
1057  cnt += order_e;
1058  }
1059  }
1060  }
1061  break;
1062  //HDG postprocessing
1064  {
1065  MatrixKey lapkey(StdRegions::eLaplacian, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
1066  DNekScalMat &LapMat = *GetLocMatrix(lapkey);
1067 
1068  returnval = MemoryManager<DNekMat>::AllocateSharedPtr(LapMat.GetRows(),LapMat.GetColumns());
1069  DNekMatSharedPtr lmat = returnval;
1070 
1071  (*lmat) = LapMat;
1072 
1073  // replace first column with inner product wrt 1
1074  int nq = GetTotPoints();
1075  Array<OneD, NekDouble> tmp(nq);
1076  Array<OneD, NekDouble> outarray(m_ncoeffs);
1077  Vmath::Fill(nq,1.0,tmp,1);
1078  IProductWRTBase(tmp, outarray);
1079 
1080  Vmath::Vcopy(m_ncoeffs,&outarray[0],1,
1081  &(lmat->GetPtr())[0],1);
1082 
1083  lmat->Invert();
1084  }
1085  break;
1086  default:
1087  ASSERTL0(false,"This matrix type cannot be generated from this class");
1088  break;
1089  }
1090 
1091  return returnval;
1092  }
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:470
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
const NormalVector & GetEdgeNormal(const int edge) const
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:27
void GetPhysEdgeVarCoeffsFromElement(const int edge, ExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &varcoeff, Array< OneD, NekDouble > &outarray)
void AddNormTraceInt(const int dir, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &edgeCoeffs, Array< OneD, NekDouble > &outarray)
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
this function calculates the inner product of a given function f with the different modes of the expa...
Definition: StdExpansion.h:635
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:46
std::map< int, bool > m_negatedNormals
Definition: Expansion2D.h:136
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
Definition: Vmath.cpp:485
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:442
StdRegions::Orientation GetEorient(int edge)
Definition: StdExpansion.h:768
void SetTraceToGeomOrientation(Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, NekDouble > &inout)
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:141
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:227
Expansion1DSharedPtr GetEdgeExp(int edge, bool SetUpNormal=true)
Definition: Expansion2D.h:201
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)
NekMatrix< NekDouble, StandardMatrixTag > DNekMat
Definition: NekTypeDefs.hpp:52
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:396
double NekDouble
boost::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition: Expansion.cpp:85
void AddHDGHelmholtzTraceTerms(const NekDouble tau, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
void GetEdgeToElementMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int P=-1)
Definition: StdExpansion.h:851
NekVector< NekDouble > DNekVec
Definition: NekTypeDefs.hpp:49
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:131
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:373
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1061
int GetNedges() const
This function returns the number of edges of the expansion domain.
Definition: StdExpansion.h:272
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
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:183
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:253
Array< OneD, unsigned int > Nektar::LocalRegions::Expansion2D::v_GetEdgeInverseBoundaryMap ( int  eid)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1326 of file Expansion2D.cpp.

References Nektar::StdRegions::StdExpansion::GetBoundaryMap(), Nektar::StdRegions::StdExpansion::GetEdgeInteriorMap(), Nektar::StdRegions::StdExpansion::GetEdgeNcoeffs(), GetGeom2D(), and Nektar::StdRegions::StdExpansion::NumBndryCoeffs().

1328  {
1329  int n, j;
1330  int nEdgeCoeffs;
1331  int nBndCoeffs = NumBndryCoeffs();
1332 
1333  Array<OneD, unsigned int> bmap(nBndCoeffs);
1334  GetBoundaryMap(bmap);
1335 
1336  // Map from full system to statically condensed system (i.e reverse
1337  // GetBoundaryMap)
1338  map<int, int> invmap;
1339  for (j = 0; j < nBndCoeffs; ++j)
1340  {
1341  invmap[bmap[j]] = j;
1342  }
1343 
1344  // Number of interior edge coefficients
1345  nEdgeCoeffs = GetEdgeNcoeffs(eid) - 2;
1346 
1348 
1349  Array<OneD, unsigned int> edgemaparray(nEdgeCoeffs);
1350  Array<OneD, unsigned int> maparray (nEdgeCoeffs);
1351  Array<OneD, int> signarray (nEdgeCoeffs, 1);
1352  StdRegions::Orientation eOrient = geom->GetEorient(eid);
1353 
1354  // maparray is the location of the edge within the matrix
1355  GetEdgeInteriorMap(eid, eOrient, maparray, signarray);
1356 
1357  for (n = 0; n < nEdgeCoeffs; ++n)
1358  {
1359  edgemaparray[n] = invmap[maparray[n]];
1360  }
1361 
1362  return edgemaparray;
1363  }
void GetEdgeInteriorMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
Definition: StdExpansion.h:830
int GetEdgeNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th edge.
Definition: StdExpansion.h:287
SpatialDomains::Geometry2DSharedPtr GetGeom2D() const
Definition: Expansion2D.h:269
boost::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry2D.h:59
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:814
const StdRegions::NormalVector & Nektar::LocalRegions::Expansion2D::v_GetEdgeNormal ( const int  edge) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1370 of file Expansion2D.cpp.

References ASSERTL0, and m_edgeNormals.

Referenced by v_GetSurfaceNormal().

1371  {
1372  std::map<int, StdRegions::NormalVector>::const_iterator x;
1373  x = m_edgeNormals.find(edge);
1374  ASSERTL0 (x != m_edgeNormals.end(),
1375  "Edge normal not computed.");
1376  return x->second;
1377  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
std::map< int, StdRegions::NormalVector > m_edgeNormals
Definition: Expansion2D.h:135
const StdRegions::NormalVector & Nektar::LocalRegions::Expansion2D::v_GetSurfaceNormal ( const int  id) const
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1379 of file Expansion2D.cpp.

References v_GetEdgeNormal().

1381  {
1382  return v_GetEdgeNormal(id);
1383  }
const StdRegions::NormalVector & v_GetEdgeNormal(const int edge) const
void Nektar::LocalRegions::Expansion2D::v_NegateEdgeNormal ( const int  edge)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1385 of file Expansion2D.cpp.

References Nektar::StdRegions::StdExpansion::GetCoordim(), m_edgeNormals, m_negatedNormals, and Vmath::Neg().

1386  {
1387  m_negatedNormals[edge] = true;
1388  for (int i = 0; i < GetCoordim(); ++i)
1389  {
1390  Vmath::Neg(m_edgeNormals[edge][i].num_elements(),
1391  m_edgeNormals[edge][i], 1);
1392  }
1393  }
std::map< int, bool > m_negatedNormals
Definition: Expansion2D.h:136
std::map< int, StdRegions::NormalVector > m_edgeNormals
Definition: Expansion2D.h:135
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:396
void Nektar::LocalRegions::Expansion2D::v_SetUpPhysNormals ( const int  edge)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1365 of file Expansion2D.cpp.

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

1366  {
1367  ComputeEdgeNormal(edge);
1368  }
void ComputeEdgeNormal(const int edge)

Member Data Documentation

std::vector<Expansion1DWeakPtr> Nektar::LocalRegions::Expansion2D::m_edgeExp
protected
std::map<int, StdRegions::NormalVector> Nektar::LocalRegions::Expansion2D::m_edgeNormals
protected
int Nektar::LocalRegions::Expansion2D::m_elementFaceLeft
protected

Definition at line 139 of file Expansion2D.h.

Referenced by Expansion2D(), GetLeftAdjacentElementFace(), and SetAdjacentElementExp().

int Nektar::LocalRegions::Expansion2D::m_elementFaceRight
protected

Definition at line 140 of file Expansion2D.h.

Referenced by Expansion2D(), GetRightAdjacentElementFace(), and SetAdjacentElementExp().

Expansion3DWeakPtr Nektar::LocalRegions::Expansion2D::m_elementLeft
protected
Expansion3DWeakPtr Nektar::LocalRegions::Expansion2D::m_elementRight
protected

Definition at line 138 of file Expansion2D.h.

Referenced by GetRightAdjacentElementExp(), and SetAdjacentElementExp().

std::map<int, bool> Nektar::LocalRegions::Expansion2D::m_negatedNormals
protected
std::vector<bool> Nektar::LocalRegions::Expansion2D::m_requireNeg
protected

Definition at line 134 of file Expansion2D.h.

Referenced by v_AddEdgeNormBoundaryInt().