Nektar++
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)
 
ExpansionSharedPtr GetEdgeExp (int edge, bool SetUpNormal=true)
 
void SetEdgeExp (const int edge, ExpansionSharedPtr &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
 
- 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::GeomFactorsSharedPtrv_GetMetricInfo () const
 
DNekMatSharedPtr BuildTransformationMatrix (const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
 
DNekMatSharedPtr BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd)
 
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::BasisSharedPtrGetBasis (int dir) const
 This function gets the shared point to basis in the dir direction. More...
 
int GetNcoeffs (void) const
 This function returns the total number of coefficients used in the expansion. More...
 
int GetTotPoints () const
 This function returns the total number of quadrature points used in the element. More...
 
LibUtilities::BasisType GetBasisType (const int dir) const
 This function returns the type of basis used in the dir direction. More...
 
int GetBasisNumModes (const int dir) const
 This function returns the number of expansion modes in the dir direction. More...
 
int EvalBasisNumModesMax (void) const
 This function returns the maximum number of expansion modes over all local directions. More...
 
LibUtilities::PointsType GetPointsType (const int dir) const
 This function returns the type of quadrature points used in the dir direction. More...
 
int GetNumPoints (const int dir) const
 This function returns the number of quadrature points in the dir direction. More...
 
const Array< OneD, const NekDouble > & GetPoints (const int dir) const
 This function returns a pointer to the array containing the quadrature points in dir direction. More...
 
int GetNverts () const
 This function returns the number of vertices of the expansion domain. More...
 
int GetNedges () const
 This function returns the number of edges of the expansion domain. More...
 
int GetEdgeNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge. More...
 
int GetTotalEdgeIntNcoeffs () const
 
int GetEdgeNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th edge. More...
 
int DetCartesianDirOfEdge (const int edge)
 
const LibUtilities::BasisKey DetEdgeBasisKey (const int i) const
 
const LibUtilities::BasisKey DetFaceBasisKey (const int i, const int k) const
 
int GetFaceNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th face. More...
 
int GetFaceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th face. More...
 
int GetFaceIntNcoeffs (const int i) const
 
int GetTotalFaceIntNcoeffs () const
 
LibUtilities::PointsKey GetFacePointsKey (const int i, const int j) const
 
int NumBndryCoeffs (void) const
 
int NumDGBndryCoeffs (void) const
 
LibUtilities::BasisType GetEdgeBasisType (const int i) const
 This function returns the type of expansion basis on the i-th edge. More...
 
const LibUtilities::PointsKey GetNodalPointsKey () const
 This function returns the type of expansion Nodal point type if defined. More...
 
int GetNfaces () const
 This function returns the number of faces of the expansion domain. More...
 
int GetNtrace () const
 Returns the number of trace elements connected to this element. More...
 
LibUtilities::ShapeType DetShapeType () const
 This function returns the shape of the expansion domain. More...
 
boost::shared_ptr< StdExpansionGetStdExp (void) const
 
int GetShapeDimension () const
 
bool IsBoundaryInteriorExpansion ()
 
bool IsNodalNonTensorialExp ()
 
void BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Backward transformation from coefficient space to physical space. More...
 
void FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Forward transformation from physical space to coefficient space. More...
 
void FwdTrans_BndConstrained (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
NekDouble Integral (const Array< OneD, const NekDouble > &inarray)
 This function integrates the specified function over the domain. More...
 
void FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 This function fills the array outarray with the mode-th mode of the expansion. More...
 
void IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 this function calculates the inner product of a given function f with the different modes of the expansion More...
 
void IProductWRTBase (const Array< OneD, const NekDouble > &base, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int coll_check)
 
void IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
int GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
void SetElmtId (const int id)
 Set the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
void GetCoords (Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2=NullNekDouble1DArray, Array< OneD, NekDouble > &coords_3=NullNekDouble1DArray)
 this function returns the physical coordinates of the quadrature points of the expansion More...
 
void GetCoord (const Array< OneD, const NekDouble > &Lcoord, Array< OneD, NekDouble > &coord)
 given the coordinates of a point of the element in the local collapsed coordinate system, this function calculates the physical coordinates of the point More...
 
DNekMatSharedPtr GetStdMatrix (const StdMatrixKey &mkey)
 
DNekBlkMatSharedPtr GetStdStaticCondMatrix (const StdMatrixKey &mkey)
 
IndexMapValuesSharedPtr GetIndexMap (const IndexMapKey &ikey)
 
const Array< OneD, const NekDouble > & GetPhysNormals (void)
 
void SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
virtual void SetUpPhysNormals (const int edge)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
void DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
StdRegions::Orientation GetForient (int face)
 
StdRegions::Orientation GetEorient (int edge)
 
StdRegions::Orientation GetPorient (int point)
 
StdRegions::Orientation GetCartesianEorient (int edge)
 
void SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
 
void SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
int CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
void ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs)
 
NekDouble StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
 
int GetCoordim ()
 
void GetBoundaryMap (Array< OneD, unsigned int > &outarray)
 
void GetInteriorMap (Array< OneD, unsigned int > &outarray)
 
int GetVertexMap (const int localVertexId, bool useCoeffPacking=false)
 
void GetEdgeInteriorMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
void GetFaceInteriorMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
void GetEdgeToElementMap (const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
 
void GetFaceToElementMap (const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int nummodesA=-1, int nummodesB=-1)
 
void GetEdgePhysVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 Extract the physical values along edge edge from inarray into outarray following the local edge orientation and point distribution defined by defined in EdgeExp. More...
 
void GetEdgePhysVals (const int edge, const boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetTracePhysVals (const int edge, const boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetVertexPhysVals (const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
 
void GetEdgeInterpVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void GetEdgeQFactors (const int edge, Array< OneD, NekDouble > &outarray)
 Extract the metric factors to compute the contravariant fluxes along edge edge and stores them into outarray following the local edge orientation (i.e. anticlockwise convention). More...
 
void GetFacePhysVals (const int face, const boost::shared_ptr< StdExpansion > &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=eNoOrientation)
 
void MultiplyByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
DNekMatSharedPtr CreateGeneralMatrix (const StdMatrixKey &mkey)
 this function generates the mass matrix $\mathbf{M}[i][j] = \int \phi_i(\mathbf{x}) \phi_j(\mathbf{x}) d\mathbf{x}$ More...
 
void GeneralMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
 
void LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void WeakDirectionalDerivMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void MassLevelCurvatureMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
void LinearAdvectionDiffusionReactionMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
 
void HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
 
DNekMatSharedPtr GenMatrix (const StdMatrixKey &mkey)
 
void PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
void PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void PhysDeriv_s (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
 
void PhysDeriv_n (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
 
void PhysDirectionalDeriv (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &outarray)
 
void StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
 
void StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 
void AddRobinMassMatrix (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
 
void AddRobinEdgeContribution (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, Array< OneD, NekDouble > &coeffs)
 
NekDouble PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
NekDouble PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain. More...
 
void LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 Convert local cartesian coordinate xi into local collapsed coordinates eta. More...
 
const boost::shared_ptr< SpatialDomains::GeomFactors > & GetMetricInfo (void) const
 
virtual int v_GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id. More...
 
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals (void)
 
virtual void v_SetPhysNormals (Array< OneD, const NekDouble > &normal)
 
virtual int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
 
virtual void v_ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmode_offset, NekDouble *coeffs)
 Unpack data from input file assuming it comes from the same expansion type. More...
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
 
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
 
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual void v_DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
 
virtual StdRegions::Orientation v_GetForient (int face)
 
virtual StdRegions::Orientation v_GetEorient (int edge)
 
virtual StdRegions::Orientation v_GetCartesianEorient (int edge)
 
virtual StdRegions::Orientation v_GetPorient (int point)
 
NekDouble Linf (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete $ L_\infty$ error $ |\epsilon|_\infty = \max |u - u_{exact}|$ where $ u_{exact}$ is given by the array sol. More...
 
NekDouble L2 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete $ L_2$ error, $ | \epsilon |_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 dx \right]^{1/2} d\xi_1 $ where $ u_{exact}$ is given by the array sol. More...
 
NekDouble H1 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete $ H^1$ error, $ | \epsilon |^1_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 + \nabla(u - u_{exact})\cdot\nabla(u - u_{exact})\cdot dx \right]^{1/2} d\xi_1 $ where $ u_{exact}$ is given by the array sol. More...
 
const NormalVectorGetEdgeNormal (const int edge) const
 
void ComputeEdgeNormal (const int edge)
 
void NegateEdgeNormal (const int edge)
 
bool EdgeNormalNegated (const int edge)
 
void ComputeFaceNormal (const int face)
 
void NegateFaceNormal (const int face)
 
void ComputeVertexNormal (const int vertex)
 
const NormalVectorGetFaceNormal (const int face) const
 
const NormalVectorGetVertexNormal (const int vertex) const
 
const NormalVectorGetSurfaceNormal (const int id) const
 
const LibUtilities::PointsKeyVector GetPointsKeys () const
 
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap (int eid)
 
Array< OneD, unsigned int > GetFaceInverseBoundaryMap (int fid, StdRegions::Orientation faceOrient=eNoOrientation)
 
DNekMatSharedPtr BuildInverseTransformationMatrix (const DNekScalMatSharedPtr &m_transformationmatrix)
 
void PhysInterpToSimplexEquiSpaced (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs an interpolation from the physical space points provided at input into an array of equispaced points which are not the collapsed coordinate. So for a tetrahedron you will only get a tetrahedral number of values. More...
 
void GetSimplexEquiSpacedConnectivity (Array< OneD, int > &conn, bool standard=true)
 This function provides the connectivity of local simplices (triangles or tets) to connect the equispaced data points provided by PhysInterpToSimplexEquiSpaced. More...
 
template<class T >
boost::shared_ptr< T > as ()
 
void IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
 
- 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)
 
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_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)
 

Protected Attributes

std::vector< ExpansionWeakPtrm_edgeExp
 
std::vector< bool > m_requireNeg
 
std::map< int, StdRegions::NormalVectorm_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::BasisSharedPtrm_base
 
int m_elmt_id
 
int m_ncoeffs
 
LibUtilities::NekManager< StdMatrixKey, DNekMat, StdMatrixKey::opLessm_stdMatrixManager
 
LibUtilities::NekManager< StdMatrixKey, DNekBlkMat, StdMatrixKey::opLessm_stdStaticCondMatrixManager
 
LibUtilities::NekManager< IndexMapKey, IndexMapValues, IndexMapKey::opLessm_IndexMapManager
 

Detailed Description

Definition at line 58 of file Expansion2D.h.

Constructor & Destructor Documentation

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

Definition at line 47 of file Expansion2D.cpp.

References m_elementFaceLeft, and m_elementFaceRight.

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

Definition at line 62 of file Expansion2D.h.

62 {}

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

421  {
422  int i;
423  int order_e = EdgeExp->GetNcoeffs();
424  int nquad_e = EdgeExp->GetNumPoints(0);
425  Array<OneD,unsigned int> map;
426  Array<OneD,int> sign;
427  Array<OneD, NekDouble> coeff(order_e);
428 
429  GetEdgeToElementMap(edge, v_GetEorient(edge), map, sign);
430 
434  StdRegions::VarCoeffMap::const_iterator x;
435 
436  /// @TODO Variable coeffs
437  if ((x = varcoeffs.find(VarCoeff[0])) != varcoeffs.end())
438  {
439  Array<OneD, NekDouble> work(nquad_e);
441  edge, EdgeExp, x->second, work);
442  Vmath::Vmul(nquad_e, work, 1, edgePhys, 1, edgePhys, 1);
443  }
444 
445  EdgeExp->IProductWRTBase(edgePhys, coeff);
446 
447  // add data to out array
448  for(i = 0; i < order_e; ++i)
449  {
450  outarray[map[i]] += sign[i]*coeff[i];
451  }
452  }
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:22
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)
Definition: StdExpansion.h:820
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:169
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 489 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().

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

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

Referenced by v_GenMatrix().

463  {
464  ASSERTL0(&inarray[0] != &outarray[0],
465  "Input and output arrays use the same memory");
466 
467  int e, cnt, order_e, nedges = GetNedges();
468  Array<OneD, const NekDouble> tmp;
469 
470  cnt = 0;
471 
472  for(e = 0; e < nedges; ++e)
473  {
474  order_e = EdgeExp[e]->GetNcoeffs();
475  Array<OneD, NekDouble> edgeCoeffs(order_e);
476  Array<OneD, NekDouble> edgePhys (EdgeExp[e]->GetTotPoints());
477 
478  Vmath::Vcopy(order_e, tmp = inarray + cnt, 1, edgeCoeffs, 1);
479  EdgeExp[e]->BwdTrans(edgeCoeffs, edgePhys);
481  tau, e, EdgeExp, edgePhys, dirForcing, outarray);
482 
483  cnt += order_e;
484  }
485  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
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:1038
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 380 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().

385  {
386  int e;
387  int nquad_e;
388  int nedges = GetNedges();
389 
390  for(e = 0; e < nedges; ++e)
391  {
392  nquad_e = EdgeExp[e]->GetNumPoints(0);
393 
394  Array<OneD, NekDouble> edgePhys(nquad_e);
395  const Array<OneD, const Array<OneD, NekDouble> > &normals
396  = GetEdgeNormal(e);
397 
398  EdgeExp[e]->BwdTrans(edgeCoeffs[e], edgePhys);
399 
400  Vmath::Vmul(nquad_e, normals[dir], 1, edgePhys, 1, edgePhys, 1);
401 
402  if (m_negatedNormals[e])
403  {
404  Vmath::Neg(nquad_e, edgePhys, 1);
405  }
406 
407  AddEdgeBoundaryInt(e, EdgeExp[e], edgePhys, outarray);
408  }
409  }
const NormalVector & GetEdgeNormal(const int edge) const
std::map< int, bool > m_negatedNormals
Definition: Expansion2D.h:125
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:382
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:169
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 325 of file Expansion2D.cpp.

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

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

Definition at line 176 of file Expansion2D.h.

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

Referenced by v_GenMatrix().

177  {
178  ASSERTL1(edge < GetNedges(), "Edge out of range.");
179  return m_edgeExp[edge].lock();
180  }
std::vector< ExpansionWeakPtr > m_edgeExp
Definition: Expansion2D.h:122
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
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 193 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().

194  {
195  ASSERTL1(m_elementLeft.lock().get(), "Left adjacent element not set.");
196  return m_elementLeft.lock();
197  }
Expansion3DWeakPtr m_elementLeft
Definition: Expansion2D.h:126
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
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 604 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().

609  {
610  Array<OneD, NekDouble> tmp(GetNcoeffs());
611  Array<OneD, NekDouble> edgetmp(EdgeExp->GetNcoeffs());
612 
613  // FwdTrans varcoeffs
614  FwdTrans(varcoeff, tmp);
615 
616  // Map to edge
617  Array<OneD,unsigned int> emap;
618  Array<OneD, int> sign;
619  StdRegions::Orientation edgedir = GetEorient(edge);
620  GetEdgeToElementMap(edge,edgedir,emap,sign);
621 
622  for (unsigned int i = 0; i < EdgeExp->GetNcoeffs(); ++i)
623  {
624  edgetmp[i] = tmp[emap[i]];
625  }
626 
627  // BwdTrans
628  EdgeExp->BwdTrans(edgetmp, outarray);
629  }
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:22
void GetEdgeToElementMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
Definition: StdExpansion.h:820
StdRegions::Orientation GetEorient(int edge)
Definition: StdExpansion.h:736
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 199 of file Expansion2D.h.

References ASSERTL1, m_elementLeft, and m_elementRight.

200  {
201  ASSERTL1(m_elementLeft.lock().get(), "Right adjacent element not set.");
202  return m_elementRight.lock();
203  }
Expansion3DWeakPtr m_elementRight
Definition: Expansion2D.h:127
Expansion3DWeakPtr m_elementLeft
Definition: Expansion2D.h:126
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
int Nektar::LocalRegions::Expansion2D::GetRightAdjacentElementFace ( ) const
inline

Definition at line 210 of file Expansion2D.h.

References m_elementFaceRight.

211  {
212  return m_elementFaceRight;
213  }
void Nektar::LocalRegions::Expansion2D::SetAdjacentElementExp ( int  face,
Expansion3DSharedPtr f 
)
inline

Definition at line 215 of file Expansion2D.h.

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

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

216  {
217  if (m_elementLeft.lock().get())
218  {
219  ASSERTL1(!m_elementRight.lock().get(),
220  "Both adjacent elements already set.");
221  m_elementRight = f;
222  m_elementFaceRight = face;
223  }
224  else
225  {
226  m_elementLeft = f;
227  m_elementFaceLeft = face;
228  }
229  }
Expansion3DWeakPtr m_elementRight
Definition: Expansion2D.h:127
Expansion3DWeakPtr m_elementLeft
Definition: Expansion2D.h:126
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
void Nektar::LocalRegions::Expansion2D::SetEdgeExp ( const int  edge,
ExpansionSharedPtr e 
)
inline

Definition at line 182 of file Expansion2D.h.

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

183  {
184  unsigned int nEdges = GetNedges();
185  ASSERTL1(edge < nEdges, "Edge out of range.");
186  if (m_edgeExp.size() < nEdges)
187  {
188  m_edgeExp.resize(nEdges);
189  }
190  m_edgeExp[edge] = e;
191  }
std::vector< ExpansionWeakPtr > m_edgeExp
Definition: Expansion2D.h:122
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
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 304 of file Expansion2D.cpp.

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

Referenced by v_GenMatrix().

307  {
308  int i, cnt = 0;
309  int nedges = GetNedges();
310  Array<OneD, NekDouble> e_tmp;
311 
312  for(i = 0; i < nedges; ++i)
313  {
314  EdgeExp[i]->SetCoeffsToOrientation(GetEorient(i),
315  e_tmp = inout + cnt,
316  e_tmp = inout + cnt);
317  cnt += GetEdgeNcoeffs(i);
318  }
319  }
StdRegions::Orientation GetEorient(int edge)
Definition: StdExpansion.h:736
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 54 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().

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

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

1259  {
1261  "Not set up for non boundary-interior expansions");
1262  int i;
1263  ExpansionSharedPtr edgeExp = m_edgeExp[edgeid].lock();
1264  int order_e = edgeExp->GetNcoeffs();
1265 
1266  Array<OneD,unsigned int> map;
1267  Array<OneD,int> sign;
1268 
1269  StdRegions::VarCoeffMap varcoeffs;
1270  varcoeffs[StdRegions::eVarCoeffMass] = primCoeffs;
1271 
1272  LocalRegions::MatrixKey mkey(StdRegions::eMass,LibUtilities::eSegment, *edgeExp, StdRegions::NullConstFactorMap, varcoeffs);
1273  DNekScalMat &edgemat = *edgeExp->GetLocMatrix(mkey);
1274 
1275  NekVector<NekDouble> vEdgeCoeffs (order_e);
1276 
1277  GetEdgeToElementMap(edgeid,v_GetEorient(edgeid),map,sign);
1278 
1279  for (i = 0; i < order_e; ++i)
1280  {
1281  vEdgeCoeffs[i] = coeffs[map[i]]*sign[i];
1282  }
1283  Vmath::Zero(GetNcoeffs(), coeffs, 1);
1284 
1285  vEdgeCoeffs = edgemat * vEdgeCoeffs;
1286 
1287  for (i = 0; i < order_e; ++i)
1288  {
1289  coeffs[map[i]] = vEdgeCoeffs[i]*sign[i];
1290  }
1291  }
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:22
void GetEdgeToElementMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
Definition: StdExpansion.h:820
std::vector< ExpansionWeakPtr > m_edgeExp
Definition: Expansion2D.h:122
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:225
virtual StdRegions::Orientation v_GetEorient(int edge)
boost::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
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:359
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:249
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 1133 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().

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

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1293 of file Expansion2D.cpp.

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

1295  {
1296  MatrixStorage storage = eFULL;
1297  DNekMatSharedPtr m_vertexmatrix;
1298 
1299  int nVerts, vid1, vid2, vMap1, vMap2;
1300  NekDouble VertexValue;
1301 
1302  nVerts = GetNverts();
1303 
1304  m_vertexmatrix =
1306  nVerts, nVerts, 0.0, storage);
1307  DNekMat &VertexMat = (*m_vertexmatrix);
1308 
1309  for (vid1 = 0; vid1 < nVerts; ++vid1)
1310  {
1311  vMap1 = GetVertexMap(vid1);
1312 
1313  for (vid2 = 0; vid2 < nVerts; ++vid2)
1314  {
1315  vMap2 = GetVertexMap(vid2);
1316  VertexValue = (*r_bnd)(vMap1, vMap2);
1317  VertexMat.SetValue(vid1, vid2, VertexValue);
1318  }
1319  }
1320 
1321  return m_vertexmatrix;
1322  }
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:800
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 1095 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().

1101  {
1105 
1106  int ncoeffs = GetNcoeffs();
1107 
1109  DNekScalMat &Dmat = *GetLocMatrix(DerivType[dir]);
1110 
1111  Array<OneD, NekDouble> coeffs = incoeffs;
1112  DNekVec Coeffs (ncoeffs,coeffs, eWrapper);
1113 
1114  Coeffs = Transpose(Dmat)*Coeffs;
1115  Vmath::Neg(ncoeffs, coeffs,1);
1116 
1117  // Add the boundary integral including the relevant part of
1118  // the normal
1119  AddNormTraceInt(dir, EdgeExp, edgeCoeffs, coeffs);
1120 
1121  DNekVec Out_d (ncoeffs,out_d,eWrapper);
1122 
1123  Out_d = InvMass*Coeffs;
1124  }
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:382
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition: Expansion.cpp:83
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 1393 of file Expansion2D.cpp.

References m_negatedNormals.

1394  {
1395  return m_negatedNormals[edge];
1396  }
std::map< int, bool > m_negatedNormals
Definition: Expansion2D.h:125
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 639 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().

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1324 of file Expansion2D.cpp.

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

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1368 of file Expansion2D.cpp.

References ASSERTL0, and m_edgeNormals.

Referenced by v_GetSurfaceNormal().

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1377 of file Expansion2D.cpp.

References v_GetEdgeNormal().

1379  {
1380  return v_GetEdgeNormal(id);
1381  }
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 1383 of file Expansion2D.cpp.

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

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

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1363 of file Expansion2D.cpp.

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

1364  {
1365  ComputeEdgeNormal(edge);
1366  }
void ComputeEdgeNormal(const int edge)

Member Data Documentation

std::vector<ExpansionWeakPtr> 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 128 of file Expansion2D.h.

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

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

Definition at line 129 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 127 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 123 of file Expansion2D.h.

Referenced by v_AddEdgeNormBoundaryInt().