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

#include <Expansion3D.h>

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

Public Member Functions

 Expansion3D (SpatialDomains::Geometry3DSharedPtr pGeom)
virtual ~Expansion3D ()
void SetFaceExp (const int face, Expansion2DSharedPtr &f)
Expansion2DSharedPtr GetFaceExp (const int face)
void SetTraceToGeomOrientation (Array< OneD, NekDouble > &inout)
 Align trace orientation with the geometry orientation.
void SetFaceToGeomOrientation (const int face, Array< OneD, NekDouble > &inout)
 Align face orientation with the geometry orientation.
void AddHDGHelmholtzFaceTerms (const NekDouble tau, const int edge, Array< OneD, NekDouble > &facePhys, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
void AddNormTraceInt (const int dir, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, Array< OneD, NekDouble > > &faceCoeffs, Array< OneD, NekDouble > &outarray)
void AddNormTraceInt (const int dir, Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs)
void AddFaceBoundaryInt (const int face, ExpansionSharedPtr &FaceExp, Array< OneD, NekDouble > &facePhys, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
SpatialDomains::Geometry3DSharedPtr GetGeom3D () const
- Public Member Functions inherited from Nektar::LocalRegions::Expansion
 Expansion (SpatialDomains::GeometrySharedPtr pGeom)
 Expansion (const Expansion &pSrc)
virtual ~Expansion ()
DNekScalMatSharedPtr GetLocMatrix (const LocalRegions::MatrixKey &mkey)
DNekScalMatSharedPtr GetLocMatrix (const StdRegions::MatrixType mtype, const StdRegions::ConstFactorMap &factors=StdRegions::NullConstFactorMap, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
SpatialDomains::GeometrySharedPtr GetGeom () const
virtual const
SpatialDomains::GeomFactorsSharedPtr
v_GetMetricInfo () const
DNekMatSharedPtr BuildTransformationMatrix (const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
DNekMatSharedPtr BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd)
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.
 StdExpansion (const int numcoeffs, const int numbases, const LibUtilities::BasisKey &Ba=LibUtilities::NullBasisKey, const LibUtilities::BasisKey &Bb=LibUtilities::NullBasisKey, const LibUtilities::BasisKey &Bc=LibUtilities::NullBasisKey)
 Constructor.
 StdExpansion (const StdExpansion &T)
 Copy Constructor.
virtual ~StdExpansion ()
 Destructor.
int GetNumBases () const
 This function returns the number of 1D bases used in the expansion.
const Array< OneD, const
LibUtilities::BasisSharedPtr > & 
GetBase () const
 This function gets the shared point to basis.
const
LibUtilities::BasisSharedPtr
GetBasis (int dir) const
 This function gets the shared point to basis in the dir direction.
int GetNcoeffs (void) const
 This function returns the total number of coefficients used in the expansion.
int GetTotPoints () const
 This function returns the total number of quadrature points used in the element.
LibUtilities::BasisType GetBasisType (const int dir) const
 This function returns the type of basis used in the dir direction.
int GetBasisNumModes (const int dir) const
 This function returns the number of expansion modes in the dir direction.
int EvalBasisNumModesMax (void) const
 This function returns the maximum number of expansion modes over all local directions.
LibUtilities::PointsType GetPointsType (const int dir) const
 This function returns the type of quadrature points used in the dir direction.
int GetNumPoints (const int dir) const
 This function returns the number of quadrature points in the dir direction.
const Array< OneD, const
NekDouble > & 
GetPoints (const int dir) const
 This function returns a pointer to the array containing the quadrature points in dir direction.
int GetNverts () const
 This function returns the number of vertices of the expansion domain.
int GetNedges () const
 This function returns the number of edges of the expansion domain.
int GetEdgeNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th edge.
int GetTotalEdgeIntNcoeffs () const
int GetEdgeNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th edge.
int DetCartesianDirOfEdge (const int edge)
const LibUtilities::BasisKey DetEdgeBasisKey (const int i) const
const LibUtilities::BasisKey DetFaceBasisKey (const int i, const int k) const
int GetFaceNumPoints (const int i) const
 This function returns the number of quadrature points belonging to the i-th face.
int GetFaceNcoeffs (const int i) const
 This function returns the number of expansion coefficients belonging to the i-th face.
int GetFaceIntNcoeffs (const int i) const
int GetTotalFaceIntNcoeffs () const
LibUtilities::PointsKey GetFacePointsKey (const int i, const int j) const
int NumBndryCoeffs (void) const
int NumDGBndryCoeffs (void) const
LibUtilities::BasisType GetEdgeBasisType (const int i) const
 This function returns the type of expansion basis on the i-th edge.
int GetNfaces () const
 This function returns the number of faces of the expansion domain.
int GetNtrace () const
 Returns the number of trace elements connected to this element.
LibUtilities::ShapeType DetShapeType () const
 This function returns the shape of the expansion domain.
int GetShapeDimension () const
bool IsBoundaryInteriorExpansion ()
void BwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Backward transformation from coefficient space to physical space.
void FwdTrans (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 This function performs the Forward transformation from physical space to coefficient space.
void FwdTrans_BndConstrained (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
NekDouble Integral (const Array< OneD, const NekDouble > &inarray)
 This function integrates the specified function over the domain.
void FillMode (const int mode, Array< OneD, NekDouble > &outarray)
 This function fills the array outarray with the mode-th mode of the expansion.
void IProductWRTBase (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
 this function calculates the inner product of a given function f with the different modes of the expansion
void IProductWRTBase (const Array< OneD, const NekDouble > &base, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int coll_check)
void IProductWRTDerivBase (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
int GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id.
void SetElmtId (const int id)
 Set the element id of this expansion when used in a list by returning value of m_elmt_id.
void GetCoords (Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2=NullNekDouble1DArray, Array< OneD, NekDouble > &coords_3=NullNekDouble1DArray)
 this function returns the physical coordinates of the quadrature points of the expansion
void GetCoord (const Array< OneD, const NekDouble > &Lcoord, Array< OneD, NekDouble > &coord)
 given the coordinates of a point of the element in the local collapsed coordinate system, this function calculates the physical coordinates of the point
DNekMatSharedPtr GetStdMatrix (const StdMatrixKey &mkey)
DNekBlkMatSharedPtr GetStdStaticCondMatrix (const StdMatrixKey &mkey)
IndexMapValuesSharedPtr GetIndexMap (const IndexMapKey &ikey)
const Array< OneD, const
NekDouble > & 
GetPhysNormals (void)
void SetPhysNormals (Array< OneD, const NekDouble > &normal)
virtual void SetUpPhysNormals (const int edge)
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
void NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
void DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
StdRegions::Orientation 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.
void GetEdgePhysVals (const int edge, const boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void GetTracePhysVals (const int edge, const boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void GetVertexPhysVals (const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
void GetEdgeInterpVals (const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void GetEdgeQFactors (const int edge, Array< OneD, NekDouble > &outarray)
 Extract the metric factors to compute the contravariant fluxes along edge edge and stores them into outarray following the local edge orientation (i.e. anticlockwise convention).
void GetFacePhysVals (const int face, const boost::shared_ptr< StdExpansion > &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=eNoOrientation)
void MultiplyByQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void MultiplyByStdQuadratureMetric (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
DNekMatSharedPtr CreateGeneralMatrix (const StdMatrixKey &mkey)
 this function generates the mass matrix $\mathbf{M}[i][j] = \int \phi_i(\mathbf{x}) \phi_j(\mathbf{x}) d\mathbf{x}$
void GeneralMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void MassMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LaplacianMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void ReduceOrderCoeffs (int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void SVVLaplacianFilter (Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
void LaplacianMatrixOp (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void WeakDerivMatrixOp (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void WeakDirectionalDerivMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void MassLevelCurvatureMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LinearAdvectionDiffusionReactionMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
void HelmholtzMatrixOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
DNekMatSharedPtr GenMatrix (const StdMatrixKey &mkey)
void PhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
void PhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void PhysDeriv_s (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
void PhysDeriv_n (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
void PhysDirectionalDeriv (const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &outarray)
void StdPhysDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
void StdPhysDeriv (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void AddRobinMassMatrix (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
void AddRobinEdgeContribution (const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, Array< OneD, NekDouble > &coeffs)
NekDouble PhysEvaluate (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain.
NekDouble PhysEvaluate (const Array< OneD, DNekMatSharedPtr > &I, const Array< OneD, const NekDouble > &physvals)
 This function evaluates the expansion at a single (arbitrary) point of the domain.
void LocCoordToLocCollapsed (const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
 Convert local cartesian coordinate xi into local collapsed coordinates eta.
const boost::shared_ptr
< SpatialDomains::GeomFactors > & 
GetMetricInfo (void) const
virtual int v_GetElmtId ()
 Get the element id of this expansion when used in a list by returning value of m_elmt_id.
virtual const Array< OneD,
const NekDouble > & 
v_GetPhysNormals (void)
virtual void v_SetPhysNormals (Array< OneD, const NekDouble > &normal)
virtual void v_SetUpPhysNormals (const int edge)
virtual int v_CalcNumberOfCoefficients (const std::vector< unsigned int > &nummodes, int &modes_offset)
virtual void v_ExtractDataToCoeffs (const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmode_offset, NekDouble *coeffs)
 Unpack data from input file assuming it comes from the same expansion type.
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
virtual void v_NormVectorIProductWRTBase (const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
virtual void v_DropLocStaticCondMatrix (const LocalRegions::MatrixKey &mkey)
virtual StdRegions::Orientation v_GetEorient (int edge)
virtual StdRegions::Orientation v_GetCartesianEorient (int edge)
virtual StdRegions::Orientation v_GetPorient (int point)
NekDouble Linf (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete $ L_\infty$ error $ |\epsilon|_\infty = \max |u - u_{exact}|$ where $ u_{exact}$ is given by the array sol.
NekDouble L2 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete $ L_2$ error, $ | \epsilon |_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 dx \right]^{1/2} d\xi_1 $ where $ u_{exact}$ is given by the array sol.
NekDouble H1 (const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
 Function to evaluate the discrete $ H^1$ error, $ | \epsilon |^1_{2} = \left [ \int^1_{-1} [u - u_{exact}]^2 + \nabla(u - u_{exact})\cdot\nabla(u - u_{exact})\cdot dx \right]^{1/2} d\xi_1 $ where $ u_{exact}$ is given by the array sol.
const NormalVectorGetEdgeNormal (const int edge) const
void ComputeEdgeNormal (const int edge)
void NegateEdgeNormal (const int edge)
bool EdgeNormalNegated (const int edge)
void ComputeFaceNormal (const int face)
void NegateFaceNormal (const int face)
void ComputeVertexNormal (const int vertex)
const NormalVectorGetFaceNormal (const int face) const
const NormalVectorGetVertexNormal (const int vertex) const
const NormalVectorGetSurfaceNormal (const int id) const
const LibUtilities::PointsKeyVector GetPointsKeys () const
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap (int eid)
Array< OneD, unsigned int > GetFaceInverseBoundaryMap (int fid, StdRegions::Orientation faceOrient=eNoOrientation)
DNekMatSharedPtr BuildInverseTransformationMatrix (const DNekScalMatSharedPtr &m_transformationmatrix)
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.
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.
template<class T >
boost::shared_ptr< T > as ()
- Public Member Functions inherited from Nektar::StdRegions::StdExpansion3D
 StdExpansion3D ()
 StdExpansion3D (int numcoeffs, const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc)
 StdExpansion3D (const StdExpansion3D &T)
virtual ~StdExpansion3D ()
void PhysTensorDeriv (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray_d1, Array< OneD, NekDouble > &outarray_d2, Array< OneD, NekDouble > &outarray_d3)
 Calculate the 3D derivative in the local tensor/collapsed coordinate at the physical points.
void BwdTrans_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
void IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)

Protected Member Functions

virtual void v_DGDeriv (const int dir, const Array< OneD, const NekDouble > &incoeffs, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, Array< OneD, NekDouble > > &faceCoeffs, Array< OneD, NekDouble > &out_d)
 Evaluate coefficients of weak deriviative in the direction dir given the input coefficicents incoeffs and the imposed boundary values in EdgeExp (which will have its phys space updated).
virtual DNekMatSharedPtr v_GenMatrix (const StdRegions::StdMatrixKey &mkey)
virtual void v_AddFaceNormBoundaryInt (const int face, const ExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
virtual void v_AddRobinMassMatrix (const int face, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
virtual StdRegions::Orientation v_GetForient (int face)
virtual Array< OneD, unsigned int > v_GetEdgeInverseBoundaryMap (int eid)
virtual Array< OneD, unsigned int > v_GetFaceInverseBoundaryMap (int fid, StdRegions::Orientation faceOrient=StdRegions::eNoOrientation)
virtual DNekMatSharedPtr v_BuildTransformationMatrix (const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
virtual DNekMatSharedPtr v_BuildInverseTransformationMatrix (const DNekScalMatSharedPtr &m_transformationmatrix)
 Build inverse and inverse transposed transformation matrix: $\mathbf{R^{-1}}$ and $\mathbf{R^{-T}}$.
virtual DNekMatSharedPtr v_BuildVertexMatrix (const DNekScalMatSharedPtr &r_bnd)
- 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 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.
IndexMapValuesSharedPtr CreateIndexMap (const IndexMapKey &ikey)
 Create an IndexMap which contains mapping information linking any specific element shape with either its boundaries, edges, faces, verteces, etc.
void BwdTrans_MatOp (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void BwdTrans_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void IProductWRTBase_SumFac (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void IProductWRTDerivBase_SumFac (const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void GeneralMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void MassMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LaplacianMatrixOp_MatFree_Kernel (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
void LaplacianMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LaplacianMatrixOp_MatFree (const int k1, const int k2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void WeakDerivMatrixOp_MatFree (const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void WeakDirectionalDerivMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void MassLevelCurvatureMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LinearAdvectionDiffusionReactionMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
void HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void HelmholtzMatrixOp_MatFree_GenericImpl (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_SetCoeffsToOrientation (StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_SetCoeffsToOrientation (Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
virtual NekDouble v_StdPhysEvaluate (const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
- Protected Member Functions inherited from Nektar::StdRegions::StdExpansion3D
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.
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 > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)=0
virtual void v_IProductWRTBase_SumFacKernel (const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)=0
virtual void v_LaplacianMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
virtual void v_HelmholtzMatrixOp_MatFree (const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
virtual NekDouble v_Integral (const Array< OneD, const NekDouble > &inarray)
 Integrates the specified function over the domain.
virtual void v_NegateFaceNormal (const int face)

Private Attributes

std::vector< Expansion2DWeakPtrm_faceExp
std::vector< bool > m_requireNeg

Additional Inherited Members

- Protected Attributes inherited from Nektar::LocalRegions::Expansion
SpatialDomains::GeometrySharedPtr m_geom
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
MetricMap m_metrics
- Protected Attributes inherited from Nektar::StdRegions::StdExpansion3D
std::map< int, NormalVectorm_faceNormals
std::map< int, bool > m_negatedNormals

Detailed Description

Definition at line 59 of file Expansion3D.h.

Constructor & Destructor Documentation

Nektar::LocalRegions::Expansion3D::Expansion3D ( SpatialDomains::Geometry3DSharedPtr  pGeom)
inline

Definition at line 63 of file Expansion3D.h.

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

Definition at line 64 of file Expansion3D.h.

{}

Member Function Documentation

void Nektar::LocalRegions::Expansion3D::AddFaceBoundaryInt ( const int  face,
ExpansionSharedPtr FaceExp,
Array< OneD, NekDouble > &  facePhys,
Array< OneD, NekDouble > &  outarray,
const StdRegions::VarCoeffMap varcoeffs = StdRegions::NullVarCoeffMap 
)
inline

For a given face add the {F}_1j contributions

Definition at line 267 of file Expansion3D.cpp.

References Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::eFaceToElement, Nektar::StdRegions::StdExpansion::GetBasisNumModes(), Nektar::StdRegions::StdExpansion::GetForient(), and Nektar::StdRegions::StdExpansion::GetIndexMap().

Referenced by AddNormTraceInt().

{
int i;
int order_f = FaceExp->GetNcoeffs();
Array<OneD, NekDouble> coeff(order_f);
StdRegions::IndexMapKey ikey(
face, GetForient(face));
// StdRegions::VarCoeffType VarCoeff[3] = {StdRegions::eVarCoeffD00,
// StdRegions::eVarCoeffD11,
// StdRegions::eVarCoeffD22};
// StdRegions::VarCoeffMap::const_iterator x;
// Array<OneD, NekDouble> varcoeff_work(nquad_e);
//
///// @TODO Variable coeffs
// if ((x = varcoeffs.find(VarCoeff[0])) != varcoeffs.end())
// {
// GetPhysEdgeVarCoeffsFromElement(edge,EdgeExp,x->second,varcoeff_work);
// Vmath::Vmul(nquad_e,varcoeff_work,1,EdgeExp->GetPhys(),1,EdgeExp->UpdatePhys(),1);
// }
FaceExp->IProductWRTBase(facePhys, coeff);
// add data to out array
for(i = 0; i < order_f; ++i)
{
outarray[(*map)[i].index] += (*map)[i].sign*coeff[i];
}
}
void Nektar::LocalRegions::Expansion3D::AddHDGHelmholtzFaceTerms ( const NekDouble  tau,
const int  edge,
Array< OneD, NekDouble > &  facePhys,
const StdRegions::VarCoeffMap dirForcing,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 48 of file Expansion3D.cpp.

References Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::eFaceToElement, Nektar::StdRegions::eInvMass, Nektar::StdRegions::eWeakDeriv0, Nektar::StdRegions::eWeakDeriv1, Nektar::StdRegions::eWeakDeriv2, Nektar::eWrapper, Nektar::StdRegions::StdExpansion::GetBasisNumModes(), Nektar::StdRegions::StdExpansion::GetCoordim(), GetFaceExp(), Nektar::StdRegions::StdExpansion::GetFaceNormal(), Nektar::StdRegions::StdExpansion::GetForient(), Nektar::StdRegions::StdExpansion::GetIndexMap(), Nektar::LocalRegions::Expansion::GetLocMatrix(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion3D::m_negatedNormals, Vmath::Neg(), and Vmath::Vmul().

Referenced by v_GenMatrix().

{
ExpansionSharedPtr FaceExp = GetFaceExp(face);
int i,j,n;
int nquad_f = FaceExp->GetNumPoints(0)*FaceExp->GetNumPoints(1);
int order_f = FaceExp->GetNcoeffs();
int coordim = GetCoordim();
int ncoeffs = GetNcoeffs();
Array<OneD, NekDouble> inval (nquad_f);
Array<OneD, NekDouble> outcoeff(order_f);
Array<OneD, NekDouble> tmpcoeff(ncoeffs);
const Array<OneD, const Array<OneD, NekDouble> > &normals
= GetFaceNormal(face);
DNekVec Coeffs(ncoeffs,outarray,eWrapper);
DNekVec Tmpcoeff(ncoeffs,tmpcoeff,eWrapper);
StdRegions::IndexMapKey ikey(
face, GetForient(face));
// @TODO Variable coefficients
/*
StdRegions::VarCoeffType VarCoeff[3] = {StdRegions::eVarCoeffD00,
StdRegions::eVarCoeffD11,
StdRegions::eVarCoeffD22};
Array<OneD, NekDouble> varcoeff_work(nquad_f);
StdRegions::VarCoeffMap::const_iterator x;
///// @TODO: What direction to use here??
if ((x = varcoeffs.find(VarCoeff[0])) != varcoeffs.end())
{
GetPhysFaceVarCoeffsFromElement(face,FaceExp,x->second,varcoeff_work);
Vmath::Vmul(nquad_f,varcoeff_work,1,FaceExp->GetPhys(),1,FaceExp->UpdatePhys(),1);
}
*/
//================================================================
// Add F = \tau <phi_i,in_phys>
// Fill face and take inner product
FaceExp->IProductWRTBase(facePhys, outcoeff);
for(i = 0; i < order_f; ++i)
{
outarray[(*map)[i].index] += (*map)[i].sign*tau*outcoeff[i];
}
//================================================================
NekDouble scale = invMass.Scale();
const NekDouble *data = invMass.GetRawPtr();
//===============================================================
// Add -\sum_i D_i^T M^{-1} G_i + E_i M^{-1} G_i =
// \sum_i D_i M^{-1} G_i term
// Three independent direction
for(n = 0; n < coordim; ++n)
{
Vmath::Vmul(nquad_f, normals[n], 1, facePhys, 1, inval, 1);
if (m_negatedNormals[face])
{
Vmath::Neg(nquad_f, inval, 1);
}
// @TODO Multiply by variable coefficients
// @TODO: Document this (probably not needed)
/*
StdRegions::VarCoeffMap::const_iterator x;
if ((x = varcoeffs.find(VarCoeff[n])) != varcoeffs.end())
{
GetPhysEdgeVarCoeffsFromElement(edge,FaceExp,x->second,varcoeff_work);
Vmath::Vmul(nquad_f,varcoeff_work,1,FaceExp->GetPhys(),1,FaceExp->UpdatePhys(),1);
}
*/
FaceExp->IProductWRTBase(inval, outcoeff);
// M^{-1} G
for(i = 0; i < ncoeffs; ++i)
{
tmpcoeff[i] = 0;
for(j = 0; j < order_f; ++j)
{
tmpcoeff[i] += scale*data[i+(*map)[j].index*ncoeffs]*(*map)[j].sign*outcoeff[j];
}
}
DNekScalMat &Dmat = *GetLocMatrix(DerivType[n]);
Coeffs = Coeffs + Dmat*Tmpcoeff;
/*
if(varcoeffs.find(VarCoeff[n]) != varcoeffs.end())
{
MatrixKey mkey(DerivType[n], DetExpansionType(), *this, StdRegions::NullConstFactorMap, varcoeffs);
DNekScalMat &Dmat = *GetLocMatrix(mkey);
Coeffs = Coeffs + Dmat*Tmpcoeff;
}
else
{
DNekScalMat &Dmat = *GetLocMatrix(DerivType[n]);
Coeffs = Coeffs + Dmat*Tmpcoeff;
}
*/
}
}
void Nektar::LocalRegions::Expansion3D::AddNormTraceInt ( const int  dir,
Array< OneD, ExpansionSharedPtr > &  FaceExp,
Array< OneD, Array< OneD, NekDouble > > &  faceCoeffs,
Array< OneD, NekDouble > &  outarray 
)
inline

Definition at line 230 of file Expansion3D.cpp.

References AddFaceBoundaryInt(), Nektar::StdRegions::StdExpansion::GetFaceNormal(), Nektar::StdRegions::StdExpansion::GetNfaces(), Nektar::StdRegions::StdExpansion3D::m_negatedNormals, Vmath::Neg(), and Vmath::Vmul().

Referenced by v_DGDeriv(), and v_GenMatrix().

{
int f, cnt;
int order_f, nquad_f;
int nfaces = GetNfaces();
cnt = 0;
for(f = 0; f < nfaces; ++f)
{
order_f = FaceExp[f]->GetNcoeffs();
nquad_f = FaceExp[f]->GetNumPoints(0)*FaceExp[f]->GetNumPoints(1);
const Array<OneD, const Array<OneD, NekDouble> > &normals = GetFaceNormal(f);
Array<OneD, NekDouble> facePhys(nquad_f);
cnt += order_f;
FaceExp[f]->BwdTrans(faceCoeffs[f], facePhys);
Vmath::Vmul(nquad_f, normals[dir], 1, facePhys, 1, facePhys, 1);
{
Vmath::Neg(nquad_f, facePhys, 1);
}
AddFaceBoundaryInt(f, FaceExp[f], facePhys, outarray);
}
}
void Nektar::LocalRegions::Expansion3D::AddNormTraceInt ( const int  dir,
Array< OneD, const NekDouble > &  inarray,
Array< OneD, ExpansionSharedPtr > &  FaceExp,
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 175 of file Expansion3D.cpp.

References AddFaceBoundaryInt(), Nektar::StdRegions::StdExpansion::GetFaceNormal(), Nektar::StdRegions::StdExpansion::GetNfaces(), Nektar::StdRegions::StdExpansion3D::m_negatedNormals, Vmath::Neg(), and Vmath::Vmul().

{
int i,f,cnt;
int order_f,nquad_f;
int nfaces = GetNfaces();
cnt = 0;
for(f = 0; f < nfaces; ++f)
{
order_f = FaceExp[f]->GetNcoeffs();
nquad_f = FaceExp[f]->GetNumPoints(0)*FaceExp[f]->GetNumPoints(1);
const Array<OneD, const Array<OneD, NekDouble> > &normals = GetFaceNormal(f);
Array<OneD, NekDouble> faceCoeffs(order_f);
Array<OneD, NekDouble> facePhys (nquad_f);
for(i = 0; i < order_f; ++i)
{
faceCoeffs[i] = inarray[i+cnt];
}
cnt += order_f;
FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
// Multiply by variable coefficient
/// @TODO: Document this
// StdRegions::VarCoeffType VarCoeff[3] = {StdRegions::eVarCoeffD00,
// StdRegions::eVarCoeffD11,
// StdRegions::eVarCoeffD22};
// StdRegions::VarCoeffMap::const_iterator x;
// Array<OneD, NekDouble> varcoeff_work(nquad_e);
// if ((x = varcoeffs.find(VarCoeff[dir])) != varcoeffs.end())
// {
// GetPhysEdgeVarCoeffsFromElement(e,EdgeExp[e],x->second,varcoeff_work);
// Vmath::Vmul(nquad_e,varcoeff_work,1,EdgeExp[e]->GetPhys(),1,EdgeExp[e]->UpdatePhys(),1);
// }
Vmath::Vmul(nquad_f, normals[dir], 1, facePhys, 1, facePhys, 1);
{
Vmath::Neg(nquad_f, facePhys, 1);
}
AddFaceBoundaryInt(f, FaceExp[f], facePhys, outarray, varcoeffs);
}
}
Expansion2DSharedPtr Nektar::LocalRegions::Expansion3D::GetFaceExp ( const int  face)

Definition at line 913 of file Expansion3D.cpp.

References m_faceExp.

Referenced by AddHDGHelmholtzFaceTerms(), and v_GenMatrix().

{
return m_faceExp[face].lock();
}
SpatialDomains::Geometry3DSharedPtr Nektar::LocalRegions::Expansion3D::GetGeom3D ( ) const
inline
void Nektar::LocalRegions::Expansion3D::SetFaceExp ( const int  face,
Expansion2DSharedPtr f 
)

Definition at line 902 of file Expansion3D.cpp.

References ASSERTL1, Nektar::StdRegions::StdExpansion::GetNfaces(), and m_faceExp.

{
int nFaces = GetNfaces();
ASSERTL1(face < nFaces, "Face is out of range.");
if (m_faceExp.size() < nFaces)
{
m_faceExp.resize(nFaces);
}
m_faceExp[face] = f;
}
void Nektar::LocalRegions::Expansion3D::SetFaceToGeomOrientation ( const int  face,
Array< OneD, NekDouble > &  inout 
)

Align face orientation with the geometry orientation.

Definition at line 310 of file Expansion3D.cpp.

References ASSERTL1, Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::eDir1FwdDir1_Dir2FwdDir2, Nektar::StdRegions::eFaceToElement, Nektar::StdRegions::StdExpansion::GetBasisNumModes(), Nektar::StdRegions::StdExpansion::GetFaceNcoeffs(), Nektar::StdRegions::StdExpansion::GetForient(), Nektar::StdRegions::StdExpansion::GetIndexMap(), and Vmath::Vcopy().

Referenced by SetTraceToGeomOrientation(), and v_GenMatrix().

{
int j,k;
int nface = GetFaceNcoeffs(face);
Array<OneD, NekDouble> f_in(nface);
Vmath::Vcopy(nface,&inout[0],1,&f_in[0],1);
// retreiving face to element map for standard face orientation and
// for actual face orientation
StdRegions::IndexMapKey ikey1(
StdRegions::IndexMapKey ikey2(
face, GetForient(face));
ASSERTL1((*map1).num_elements() == (*map2).num_elements(),
"There is an error with the GetFaceToElementMap");
for(j = 0; j < (*map1).num_elements(); ++j)
{
// j = index in the standard orientation
for(k = 0; k < (*map2).num_elements(); ++k)
{
// k = index in the actual orientation
if((*map1)[j].index == (*map2)[k].index && k != j)
{
inout[k] = f_in[j];
//checking if sign is changing
if((*map1)[j].sign != (*map2)[k].sign)
inout[k] *= -1.0;
break;
}
}
}
}
void Nektar::LocalRegions::Expansion3D::SetTraceToGeomOrientation ( Array< OneD, NekDouble > &  inout)

Align trace orientation with the geometry orientation.

Definition at line 357 of file Expansion3D.cpp.

References Nektar::StdRegions::StdExpansion::GetFaceNcoeffs(), Nektar::StdRegions::StdExpansion::GetNfaces(), and SetFaceToGeomOrientation().

Referenced by v_GenMatrix().

{
int i,cnt = 0;
int nfaces = GetNfaces();
Array<OneD, NekDouble> f_tmp;
for(i = 0; i < nfaces; ++i)
{
SetFaceToGeomOrientation(i, f_tmp = inout + cnt);
cnt += GetFaceNcoeffs(i);
}
}
void Nektar::LocalRegions::Expansion3D::v_AddFaceNormBoundaryInt ( const int  face,
const ExpansionSharedPtr FaceExp,
const Array< OneD, const NekDouble > &  Fn,
Array< OneD, NekDouble > &  outarray 
)
protectedvirtual

Definition at line 918 of file Expansion3D.cpp.

References Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::eFaceToElement, Nektar::StdRegions::eMass, Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eTriangle, Nektar::StdRegions::StdExpansion::GetBasisNumModes(), Nektar::StdRegions::StdExpansion::GetForient(), GetGeom3D(), Nektar::StdRegions::StdExpansion::GetIndexMap(), Nektar::StdRegions::StdExpansion::GetNfaces(), Nektar::StdRegions::StdExpansion::m_base, m_faceExp, Nektar::StdRegions::StdExpansion3D::m_negatedNormals, and m_requireNeg.

{
int i, j;
/*
* Coming into this routine, the velocity V will have been
* multiplied by the trace normals to give the input vector Vn. By
* convention, these normals are inwards facing for elements which
* have FaceExp as their right-adjacent face. This conditional
* statement therefore determines whether the normals must be
* negated, since the integral being performed here requires an
* outwards facing normal.
*/
if (m_requireNeg.size() == 0)
{
for (i = 0; i < GetNfaces(); ++i)
{
m_requireNeg[i] = false;
{
m_requireNeg[i] = true;
continue;
}
Expansion2DSharedPtr faceExp = m_faceExp[i].lock();
if (faceExp->GetRightAdjacentElementExp())
{
if (faceExp->GetRightAdjacentElementExp()->GetGeom3D()
->GetGlobalID() == GetGeom3D()->GetGlobalID())
{
m_requireNeg[i] = true;
}
}
}
}
StdRegions::IndexMapKey ikey(
face, GetForient(face));
int order_e = (*map).num_elements(); // Order of the element
int n_coeffs = FaceExp->GetNcoeffs();
Array<OneD, NekDouble> faceCoeffs(n_coeffs);
if (n_coeffs != order_e) // Going to orthogonal space
{
Array<OneD, NekDouble> coeff(n_coeffs);
Array<OneD, NekDouble> array(n_coeffs);
FaceExp->FwdTrans(Fn, faceCoeffs);
int NumModesElementMax = FaceExp->GetBasis(0)->GetNumModes();
int NumModesElementMin = m_base[0]->GetNumModes();
FaceExp->ReduceOrderCoeffs(NumModesElementMin,
faceCoeffs,
faceCoeffs);
StdRegions::StdMatrixKey masskey(
StdRegions::eMass, FaceExp->DetShapeType(), *FaceExp);
FaceExp->MassMatrixOp(
faceCoeffs,faceCoeffs,masskey);
// Reorder coefficients for the lower degree face.
int offset1 = 0, offset2 = 0;
if (FaceExp->DetShapeType() == LibUtilities::eQuadrilateral)
{
for (i = 0; i < NumModesElementMin; ++i)
{
for (j = 0; j < NumModesElementMin; ++j)
{
faceCoeffs[offset1+j] =
faceCoeffs[offset2+j];
}
offset1 += NumModesElementMin;
offset2 += NumModesElementMax;
}
// Extract lower degree modes. TODO: Check this is correct.
for (i = NumModesElementMin; i < NumModesElementMax; ++i)
{
for (j = NumModesElementMin; j < NumModesElementMax; ++j)
{
faceCoeffs[i*NumModesElementMax+j] = 0.0;
}
}
}
if (FaceExp->DetShapeType() == LibUtilities::eTriangle)
{
// Reorder coefficients for the lower degree face.
int offset1 = 0, offset2 = 0;
for (i = 0; i < NumModesElementMin; ++i)
{
for (j = 0; j < NumModesElementMin-i; ++j)
{
faceCoeffs[offset1+j] =
faceCoeffs[offset2+j];
}
offset1 += NumModesElementMin-i;
offset2 += NumModesElementMax-i;
}
}
}
else
{
FaceExp->IProductWRTBase(Fn, faceCoeffs);
}
if (m_requireNeg[face])
{
for (i = 0; i < order_e; ++i)
{
outarray[(*map)[i].index] -= (*map)[i].sign * faceCoeffs[i];
}
}
else
{
for (i = 0; i < order_e; ++i)
{
outarray[(*map)[i].index] += (*map)[i].sign * faceCoeffs[i];
}
}
}
void Nektar::LocalRegions::Expansion3D::v_AddRobinMassMatrix ( const int  face,
const Array< OneD, const NekDouble > &  primCoeffs,
DNekMatSharedPtr inoutmat 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1094 of file Expansion3D.cpp.

References ASSERTL0, ASSERTL1, ASSERTL2, Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::eDir1FwdDir1_Dir2FwdDir2, Nektar::StdRegions::eFaceToElement, Nektar::StdRegions::eMass, Nektar::StdRegions::eVarCoeffMass, Nektar::StdRegions::StdExpansion::GetBasisNumModes(), Nektar::StdRegions::StdExpansion::GetBoundaryMap(), Nektar::StdRegions::StdExpansion::GetFaceNcoeffs(), Nektar::StdRegions::StdExpansion::GetFaceToElementMap(), Nektar::StdRegions::StdExpansion::GetForient(), Nektar::StdRegions::StdExpansion::GetIndexMap(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::IsBoundaryInteriorExpansion(), m_faceExp, Nektar::StdRegions::NullConstFactorMap, Nektar::StdRegions::StdExpansion::NumBndryCoeffs(), Nektar::StdRegions::StdExpansion::NumDGBndryCoeffs(), and sign.

{
"Not set up for non boundary-interior expansions");
ASSERTL1(inoutmat->GetRows() == inoutmat->GetColumns(),
"Assuming that input matrix was square");
int i,j;
int id1,id2;
Expansion2DSharedPtr faceExp = m_faceExp[face].lock();
int order_f = faceExp->GetNcoeffs();
Array<OneD, unsigned int> map;
Array<OneD, int> sign;
varcoeffs[StdRegions::eVarCoeffMass] = primCoeffs;
faceExp->DetShapeType();
LocalRegions::MatrixKey mkey(
shapeType,
*faceExp,
varcoeffs);
DNekScalMat &facemat = *faceExp->GetLocMatrix(mkey);
// Now need to identify a map which takes the local face
// mass matrix to the matrix stored in inoutmat;
// This can currently be deduced from the size of the matrix
// - if inoutmat.m_rows() == v_NCoeffs() it is a full
// matrix system
// - if inoutmat.m_rows() == v_NumBndCoeffs() it is a
// boundary CG system
// - if inoutmat.m_rows() == v_NumDGBndCoeffs() it is a
// trace DG system; still needs implementing.
int rows = inoutmat->GetRows();
if (rows == GetNcoeffs())
{
GetFaceToElementMap(face,GetForient(face),map,sign);
}
else if(rows == NumBndryCoeffs())
{
int nbndry = NumBndryCoeffs();
Array<OneD,unsigned int> bmap(nbndry);
GetFaceToElementMap(face,GetForient(face),map,sign);
for(i = 0; i < order_f; ++i)
{
for(j = 0; j < nbndry; ++j)
{
if(map[i] == bmap[j])
{
map[i] = j;
break;
}
}
ASSERTL1(j != nbndry,"Did not find number in map");
}
}
else if (rows == NumDGBndryCoeffs())
{
// possibly this should be a separate method
int cnt = 0;
map = Array<OneD, unsigned int> (order_f);
sign = Array<OneD, int> (order_f,1);
StdRegions::IndexMapKey ikey1(
face, GetForient(face));
StdRegions::IndexMapKey ikey2(
ASSERTL1((*map1).num_elements() == (*map2).num_elements(),
"There is an error with the GetFaceToElementMap");
for (i = 0; i < face; ++i)
{
cnt += GetFaceNcoeffs(i);
}
for(i = 0; i < (*map1).num_elements(); ++i)
{
int idx = -1;
for(j = 0; j < (*map2).num_elements(); ++j)
{
if((*map1)[i].index == (*map2)[j].index)
{
idx = j;
break;
}
}
ASSERTL2(idx >= 0, "Index not found");
map [i] = idx + cnt;
sign[i] = (*map2)[idx].sign;
}
}
else
{
ASSERTL0(false,"Could not identify matrix type from dimension");
}
for(i = 0; i < order_f; ++i)
{
id1 = map[i];
for(j = 0; j < order_f; ++j)
{
id2 = map[j];
(*inoutmat)(id1,id2) += facemat(i,j)*sign[i]*sign[j];
}
}
}
DNekMatSharedPtr Nektar::LocalRegions::Expansion3D::v_BuildInverseTransformationMatrix ( const DNekScalMatSharedPtr m_transformationmatrix)
protectedvirtual

Build inverse and inverse transposed transformation matrix: $\mathbf{R^{-1}}$ and $\mathbf{R^{-T}}$.

{R^{-T}}=[[{array}{ccc} {I} & -{R}_{ef} & -{R}_{ve}+{R}_{ve}{R}_{vf} \ 0 & {I} & {R}_{ef} \ 0 & 0 & {I}} {array}]]

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1680 of file Expansion3D.cpp.

References Nektar::eFULL, Nektar::StdRegions::StdExpansion::GetEdgeInverseBoundaryMap(), Nektar::StdRegions::StdExpansion::GetEdgeNcoeffs(), Nektar::StdRegions::StdExpansion::GetFaceIntNcoeffs(), Nektar::StdRegions::StdExpansion::GetFaceInverseBoundaryMap(), Nektar::StdRegions::StdExpansion::GetNedges(), Nektar::StdRegions::StdExpansion::GetNfaces(), Nektar::StdRegions::StdExpansion::GetNverts(), Nektar::StdRegions::StdExpansion::GetVertexMap(), Nektar::StdRegions::StdExpansion::NumBndryCoeffs(), and Vmath::Vcopy().

{
int i, j, n, eid = 0, fid = 0;
int nCoeffs = NumBndryCoeffs();
NekDouble MatrixValue;
DNekScalMat &R = (*m_transformationmatrix);
// Define storage for vertex transpose matrix and zero all entries
MatrixStorage storage = eFULL;
// Inverse transformation matrix
DNekMatSharedPtr m_inversetransformationmatrix =
MemoryManager<DNekMat>::AllocateSharedPtr(
nCoeffs, nCoeffs, 0.0, storage);
DNekMat &InvR = (*m_inversetransformationmatrix);
int nVerts = GetNverts();
int nEdges = GetNedges();
int nFaces = GetNfaces();
int nedgemodes = 0;
int nfacemodes = 0;
int nedgemodestotal = 0;
int nfacemodestotal = 0;
for (eid = 0; eid < nEdges; ++eid)
{
nedgemodes = GetEdgeNcoeffs(eid) - 2;
nedgemodestotal += nedgemodes;
}
for (fid = 0; fid < nFaces; ++fid)
{
nfacemodes = GetFaceIntNcoeffs(fid);
nfacemodestotal += nfacemodes;
}
Array<OneD, unsigned int>
edgemodearray(nedgemodestotal);
Array<OneD, unsigned int>
facemodearray(nfacemodestotal);
int offset = 0;
// Create array of edge modes
for (eid = 0; eid < nEdges; ++eid)
{
Array<OneD, unsigned int> edgearray
nedgemodes = GetEdgeNcoeffs(eid) - 2;
// Only copy if there are edge modes
if (nedgemodes)
{
Vmath::Vcopy(nedgemodes, &edgearray[0], 1,
&edgemodearray[offset], 1);
}
offset += nedgemodes;
}
offset = 0;
// Create array of face modes
for (fid = 0; fid < nFaces; ++fid)
{
Array<OneD, unsigned int> facearray
nfacemodes = GetFaceIntNcoeffs(fid);
// Only copy if there are face modes
if (nfacemodes)
{
Vmath::Vcopy(nfacemodes, &facearray[0], 1,
&facemodearray[offset], 1);
}
offset += nfacemodes;
}
// Vertex-edge/face
for (i = 0; i < nVerts; ++i)
{
for (j = 0; j < nedgemodestotal; ++j)
{
InvR.SetValue(
GetVertexMap(i), edgemodearray[j],
-R(GetVertexMap(i), edgemodearray[j]));
}
for (j = 0; j < nfacemodestotal; ++j)
{
InvR.SetValue(
GetVertexMap(i), facemodearray[j],
-R(GetVertexMap(i), facemodearray[j]));
for (n = 0; n < nedgemodestotal; ++n)
{
MatrixValue = InvR.GetValue(
GetVertexMap(i), facemodearray[j])
+ R(GetVertexMap(i), edgemodearray[n])
* R(edgemodearray[n], facemodearray[j]);
InvR.SetValue(
GetVertexMap(i), facemodearray[j], MatrixValue);
}
}
}
// Edge-face contributions
for (i = 0; i < nedgemodestotal; ++i)
{
for (j = 0; j < nfacemodestotal; ++j)
{
InvR.SetValue(
edgemodearray[i], facemodearray[j],
-R(edgemodearray[i], facemodearray[j]));
}
}
for (i = 0; i < nCoeffs; ++i)
{
InvR.SetValue(i, i, 1.0);
}
return m_inversetransformationmatrix;
}
DNekMatSharedPtr Nektar::LocalRegions::Expansion3D::v_BuildTransformationMatrix ( const DNekScalMatSharedPtr r_bnd,
const StdRegions::MatrixType  matrixType 
)
protectedvirtual

The matrix component of $\mathbf{R}$ is given by

\[ \mathbf{R^{T}_{v}}= -\mathbf{S}^{-1}_{ef,ef}\mathbf{S}^{T}_{v,ef}\]

For every vertex mode we extract the submatrices from statically condensed matrix $\mathbf{S}$ corresponding to the coupling between the attached edges and faces of a vertex ( $\mathbf{S_{ef,ef}}$). This matrix is then inverted and multiplied by the submatrix representing the coupling between a vertex and the attached edges and faces ( $\mathbf{S_{v,ef}}$).

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1259 of file Expansion3D.cpp.

References ErrorUtil::efatal, Nektar::eFULL, Nektar::StdRegions::ePreconR, Nektar::StdRegions::ePreconRMass, Nektar::StdRegions::ePreconRT, Nektar::StdRegions::ePreconRTMass, Nektar::StdRegions::StdExpansion::GetEdgeInverseBoundaryMap(), Nektar::StdRegions::StdExpansion::GetEdgeNcoeffs(), Nektar::StdRegions::StdExpansion::GetFaceIntNcoeffs(), Nektar::StdRegions::StdExpansion::GetFaceInverseBoundaryMap(), GetGeom3D(), Nektar::StdRegions::StdExpansion::GetNedges(), Nektar::StdRegions::StdExpansion::GetNverts(), Nektar::StdRegions::StdExpansion::GetVertexMap(), NEKERROR, Nektar::NullDNekMatSharedPtr, Nektar::StdRegions::StdExpansion::NumBndryCoeffs(), and Vmath::Vcopy().

{
int nVerts, nEdges;
int eid, fid, vid, n, i;
int nBndCoeffs = NumBndryCoeffs();
// Get geometric information about this element
nVerts = GetNverts();
nEdges = GetNedges();
/*************************************/
/* Vetex-edge & vertex-face matrices */
/*************************************/
/**
* The matrix component of \f$\mathbf{R}\f$ is given by \f[
* \mathbf{R^{T}_{v}}=
* -\mathbf{S}^{-1}_{ef,ef}\mathbf{S}^{T}_{v,ef}\f]
*
* For every vertex mode we extract the submatrices from statically
* condensed matrix \f$\mathbf{S}\f$ corresponding to the coupling
* between the attached edges and faces of a vertex
* (\f$\mathbf{S_{ef,ef}}\f$). This matrix is then inverted and
* multiplied by the submatrix representing the coupling between a
* vertex and the attached edges and faces
* (\f$\mathbf{S_{v,ef}}\f$).
*/
int nmodes;
int m;
NekDouble VertexEdgeFaceValue;
// The number of connected edges/faces is 3 (for all elements)
int nConnectedEdges = 3;
int nConnectedFaces = 3;
// Location in the matrix
Array<OneD, Array<OneD, unsigned int> >
MatEdgeLocation(nConnectedEdges);
Array<OneD, Array<OneD, unsigned int> >
MatFaceLocation(nConnectedFaces);
// Define storage for vertex transpose matrix and zero all entries
MatrixStorage storage = eFULL;
DNekMatSharedPtr m_transformationmatrix;
DNekMatSharedPtr m_transposedtransformationmatrix;
m_transformationmatrix =
MemoryManager<DNekMat>::AllocateSharedPtr(
nBndCoeffs, nBndCoeffs, 0.0, storage);
m_transposedtransformationmatrix =
MemoryManager<DNekMat>::AllocateSharedPtr(
nBndCoeffs, nBndCoeffs, 0.0, storage);
DNekMat &R = (*m_transformationmatrix);
DNekMat &RT = (*m_transposedtransformationmatrix);
// Build the vertex-edge/face transform matrix: This matrix is
// constructed from the submatrices corresponding to the couping
// between each vertex and the attached edges/faces
for (vid = 0; vid < nVerts; ++vid)
{
// Row and column size of the vertex-edge/face matrix
int efRow =
GetEdgeNcoeffs (geom->GetVertexEdgeMap(vid, 0)) +
GetEdgeNcoeffs (geom->GetVertexEdgeMap(vid, 1)) +
GetEdgeNcoeffs (geom->GetVertexEdgeMap(vid, 2)) +
GetFaceIntNcoeffs(geom->GetVertexFaceMap(vid, 0)) +
GetFaceIntNcoeffs(geom->GetVertexFaceMap(vid, 1)) +
GetFaceIntNcoeffs(geom->GetVertexFaceMap(vid, 2)) - 6;
int nedgemodesconnected =
GetEdgeNcoeffs (geom->GetVertexEdgeMap(vid, 0)) +
GetEdgeNcoeffs (geom->GetVertexEdgeMap(vid, 1)) +
GetEdgeNcoeffs (geom->GetVertexEdgeMap(vid, 2)) - 6;
Array<OneD, unsigned int> edgemodearray(nedgemodesconnected);
int nfacemodesconnected =
GetFaceIntNcoeffs(geom->GetVertexFaceMap(vid, 0)) +
GetFaceIntNcoeffs(geom->GetVertexFaceMap(vid, 1)) +
GetFaceIntNcoeffs(geom->GetVertexFaceMap(vid, 2));
Array<OneD, unsigned int> facemodearray(nfacemodesconnected);
int offset = 0;
// Create array of edge modes
for (eid = 0; eid < nConnectedEdges; ++eid)
{
MatEdgeLocation[eid] = GetEdgeInverseBoundaryMap(
geom->GetVertexEdgeMap(vid, eid));
nmodes = MatEdgeLocation[eid].num_elements();
if (nmodes)
{
Vmath::Vcopy(nmodes, &MatEdgeLocation[eid][0],
1, &edgemodearray[offset], 1);
}
offset += nmodes;
}
offset = 0;
// Create array of face modes
for (fid = 0; fid < nConnectedFaces; ++fid)
{
MatFaceLocation[fid] = GetFaceInverseBoundaryMap(
geom->GetVertexFaceMap(vid, fid));
nmodes = MatFaceLocation[fid].num_elements();
if (nmodes)
{
Vmath::Vcopy(nmodes, &MatFaceLocation[fid][0],
1, &facemodearray[offset], 1);
}
offset += nmodes;
}
DNekMatSharedPtr m_vertexedgefacetransformmatrix =
MemoryManager<DNekMat>::AllocateSharedPtr(
1, efRow, 0.0, storage);
DNekMat &Sveft = (*m_vertexedgefacetransformmatrix);
DNekMatSharedPtr m_vertexedgefacecoupling =
MemoryManager<DNekMat>::AllocateSharedPtr(
1, efRow, 0.0, storage);
DNekMat &Svef = (*m_vertexedgefacecoupling);
// Vertex-edge coupling
for (n = 0; n < nedgemodesconnected; ++n)
{
// Matrix value for each coefficient location
VertexEdgeFaceValue = (*r_bnd)(GetVertexMap(vid),
edgemodearray[n]);
// Set the value in the vertex edge/face matrix
Svef.SetValue(0, n, VertexEdgeFaceValue);
}
// Vertex-face coupling
for (n = 0; n < nfacemodesconnected; ++n)
{
// Matrix value for each coefficient location
VertexEdgeFaceValue = (*r_bnd)(GetVertexMap(vid),
facemodearray[n]);
// Set the value in the vertex edge/face matrix
Svef.SetValue(0, n + nedgemodesconnected, VertexEdgeFaceValue);
}
/*
* Build the edge-face transform matrix: This matrix is
* constructed from the submatrices corresponding to the couping
* between the edges and faces on the attached faces/edges of a
* vertex.
*/
// Allocation of matrix to store edge/face-edge/face coupling
DNekMatSharedPtr m_edgefacecoupling =
MemoryManager<DNekMat>::AllocateSharedPtr(
efRow, efRow, 0.0, storage);
DNekMat &Sefef = (*m_edgefacecoupling);
NekDouble EdgeEdgeValue, FaceFaceValue;
// Edge-edge coupling (S_{ee})
for (m = 0; m < nedgemodesconnected; ++m)
{
for (n = 0; n < nedgemodesconnected; ++n)
{
// Matrix value for each coefficient location
EdgeEdgeValue = (*r_bnd)(edgemodearray[n],
edgemodearray[m]);
// Set the value in the vertex edge/face matrix
Sefef.SetValue(n, m, EdgeEdgeValue);
}
}
// Face-face coupling (S_{ff})
for (n = 0; n < nfacemodesconnected; ++n)
{
for (m = 0; m < nfacemodesconnected; ++m)
{
// Matrix value for each coefficient location
FaceFaceValue = (*r_bnd)(facemodearray[n],
facemodearray[m]);
// Set the value in the vertex edge/face matrix
Sefef.SetValue(nedgemodesconnected + n,
nedgemodesconnected + m, FaceFaceValue);
}
}
// Edge-face coupling (S_{ef} and trans(S_{ef}))
for (n = 0; n < nedgemodesconnected; ++n)
{
for (m = 0; m < nfacemodesconnected; ++m)
{
// Matrix value for each coefficient location
FaceFaceValue = (*r_bnd)(edgemodearray[n],
facemodearray[m]);
// Set the value in the vertex edge/face matrix
Sefef.SetValue(
n, nedgemodesconnected + m, FaceFaceValue);
// and transpose
Sefef.SetValue(
nedgemodesconnected + m, n, FaceFaceValue);
}
}
// Invert edge-face coupling matrix
if (efRow)
{
Sefef.Invert();
//R_{v}=-S_{v,ef}inv(S_{ef,ef})
Sveft = -Svef * Sefef;
}
// Populate R with R_{ve} components
for (n = 0; n < edgemodearray.num_elements(); ++n)
{
RT.SetValue(edgemodearray[n], GetVertexMap(vid),
Sveft(0, n));
R.SetValue(GetVertexMap(vid), edgemodearray[n],
Sveft(0, n));
}
// Populate R with R_{vf} components
for (n = 0; n < facemodearray.num_elements(); ++n)
{
RT.SetValue(facemodearray[n], GetVertexMap(vid),
Sveft(0, n + nedgemodesconnected));
R.SetValue(GetVertexMap(vid), facemodearray[n],
Sveft(0, n + nedgemodesconnected));
}
}
/********************/
/* edge-face matrix */
/********************/
/*
* The matrix component of \f$\mathbf{R}\f$ is given by \f[
* \mathbf{R^{T}_{ef}}=-\mathbf{S}^{-1}_{ff}\mathbf{S}^{T}_{ef}\f]
*
* For each edge extract the submatrices from statically condensed
* matrix \f$\mathbf{S}\f$ corresponding to inner products of modes
* on the two attached faces within themselves as well as the
* coupling matrix between the two faces
* (\f$\mathbf{S}_{ff}\f$). This matrix of face coupling is then
* inverted and multiplied by the submatrices of corresponding to
* the coupling between the edge and attached faces
* (\f$\mathbf{S}_{ef}\f$).
*/
NekDouble EdgeFaceValue, FaceFaceValue;
int efCol, efRow, nedgemodes;
// Number of attached faces is always 2
nConnectedFaces = 2;
// Location in the matrix
MatEdgeLocation = Array<OneD, Array<OneD, unsigned int> >
(nEdges);
MatFaceLocation = Array<OneD, Array<OneD, unsigned int> >
(nConnectedFaces);
// Build the edge/face transform matrix: This matrix is constructed
// from the submatrices corresponding to the couping between a
// specific edge and the two attached faces.
for (eid = 0; eid < nEdges; ++eid)
{
// Row and column size of the vertex-edge/face matrix
efCol = GetFaceIntNcoeffs(geom->GetEdgeFaceMap(eid, 0)) +
GetFaceIntNcoeffs(geom->GetEdgeFaceMap(eid, 1));
efRow = GetEdgeNcoeffs(eid) - 2;
// Edge-face coupling matrix
DNekMatSharedPtr m_efedgefacecoupling =
MemoryManager<DNekMat>::AllocateSharedPtr(
efRow, efCol, 0.0, storage);
DNekMat &Mef = (*m_efedgefacecoupling);
// Face-face coupling matrix
DNekMatSharedPtr m_effacefacecoupling =
MemoryManager<DNekMat>::AllocateSharedPtr(
efCol, efCol, 0.0, storage);
DNekMat &Meff = (*m_effacefacecoupling);
// Edge-face transformation matrix
DNekMatSharedPtr m_edgefacetransformmatrix =
MemoryManager<DNekMat>::AllocateSharedPtr(
efRow, efCol, 0.0, storage);
DNekMat &Meft = (*m_edgefacetransformmatrix);
int nfacemodesconnected =
GetFaceIntNcoeffs(geom->GetEdgeFaceMap(eid, 0)) +
GetFaceIntNcoeffs(geom->GetEdgeFaceMap(eid, 1));
Array<OneD, unsigned int>
facemodearray(nfacemodesconnected);
// Create array of edge modes
Array<OneD, unsigned int> inedgearray
nedgemodes = GetEdgeNcoeffs(eid) - 2;
Array<OneD, unsigned int> edgemodearray(nedgemodes);
if (nedgemodes)
{
Vmath::Vcopy(nedgemodes, &inedgearray[0],
1, &edgemodearray[0], 1);
}
int offset = 0;
// Create array of face modes
for (fid = 0; fid < nConnectedFaces; ++fid)
{
MatFaceLocation[fid] = GetFaceInverseBoundaryMap(
geom->GetEdgeFaceMap(eid, fid));
nmodes = MatFaceLocation[fid].num_elements();
if (nmodes)
{
Vmath::Vcopy(nmodes, &MatFaceLocation[fid][0],
1, &facemodearray[offset], 1);
}
offset += nmodes;
}
// Edge-face coupling
for (n = 0; n < nedgemodes; ++n)
{
for (m = 0; m < nfacemodesconnected; ++m)
{
// Matrix value for each coefficient location
EdgeFaceValue = (*r_bnd)(edgemodearray[n],
facemodearray[m]);
// Set the value in the edge/face matrix
Mef.SetValue(n, m, EdgeFaceValue);
}
}
// Face-face coupling
for (n = 0; n < nfacemodesconnected; ++n)
{
for (m = 0; m < nfacemodesconnected; ++m)
{
// Matrix value for each coefficient location
FaceFaceValue = (*r_bnd)(facemodearray[n],
facemodearray[m]);
// Set the value in the vertex edge/face matrix
Meff.SetValue(n, m, FaceFaceValue);
}
}
if (efCol)
{
// Invert edge-face coupling matrix
Meff.Invert();
// trans(R_{ef})=-S_{ef}*(inv(S_{ff})
Meft = -Mef * Meff;
}
//Populate transformation matrix with Meft
for (n = 0; n < Meft.GetRows(); ++n)
{
for (m = 0; m < Meft.GetColumns(); ++m)
{
R.SetValue(edgemodearray[n], facemodearray[m],
Meft(n, m));
RT.SetValue(facemodearray[m], edgemodearray[n],
Meft(n, m));
}
}
}
for (i = 0; i < R.GetRows(); ++i)
{
R.SetValue(i, i, 1.0);
RT.SetValue(i, i, 1.0);
}
if ((matrixType == StdRegions::ePreconR)||
(matrixType == StdRegions::ePreconRMass))
{
return m_transformationmatrix;
}
else if ((matrixType == StdRegions::ePreconRT)||
(matrixType == StdRegions::ePreconRTMass))
{
return m_transposedtransformationmatrix;
}
else
{
NEKERROR(ErrorUtil::efatal, "unkown matrix type" );
}
}
DNekMatSharedPtr Nektar::LocalRegions::Expansion3D::v_BuildVertexMatrix ( const DNekScalMatSharedPtr r_bnd)
protectedvirtual

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1228 of file Expansion3D.cpp.

References Nektar::eFULL, Nektar::StdRegions::StdExpansion::GetNverts(), and Nektar::StdRegions::StdExpansion::GetVertexMap().

{
MatrixStorage storage = eFULL;
DNekMatSharedPtr m_vertexmatrix;
int nVerts, vid1, vid2, vMap1, vMap2;
NekDouble VertexValue;
nVerts = GetNverts();
m_vertexmatrix =
MemoryManager<DNekMat>::AllocateSharedPtr(
nVerts, nVerts, 0.0, storage);
DNekMat &VertexMat = (*m_vertexmatrix);
for (vid1 = 0; vid1 < nVerts; ++vid1)
{
vMap1 = GetVertexMap(vid1,true);
for (vid2 = 0; vid2 < nVerts; ++vid2)
{
vMap2 = GetVertexMap(vid2,true);
VertexValue = (*r_bnd)(vMap1, vMap2);
VertexMat.SetValue(vid1, vid2, VertexValue);
}
}
return m_vertexmatrix;
}
void Nektar::LocalRegions::Expansion3D::v_DGDeriv ( const int  dir,
const Array< OneD, const NekDouble > &  incoeffs,
Array< OneD, ExpansionSharedPtr > &  FaceExp,
Array< OneD, Array< OneD, NekDouble > > &  faceCoeffs,
Array< OneD, NekDouble > &  out_d 
)
protectedvirtual

Evaluate coefficients of weak deriviative in the direction dir given the input coefficicents incoeffs and the imposed boundary values in EdgeExp (which will have its phys space updated).

Reimplemented from Nektar::LocalRegions::Expansion.

Definition at line 1064 of file Expansion3D.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().

{
int ncoeffs = GetNcoeffs();
DNekScalMat &Dmat = *GetLocMatrix(DerivType[dir]);
Array<OneD, NekDouble> coeffs = incoeffs;
DNekVec Coeffs (ncoeffs,coeffs, eWrapper);
Coeffs = Transpose(Dmat)*Coeffs;
Vmath::Neg(ncoeffs, coeffs,1);
// Add the boundary integral including the relevant part of
// the normal
AddNormTraceInt(dir, FaceExp, faceCoeffs, coeffs);
DNekVec Out_d (ncoeffs,out_d,eWrapper);
Out_d = InvMass*Coeffs;
}
DNekMatSharedPtr Nektar::LocalRegions::Expansion3D::v_GenMatrix ( const StdRegions::StdMatrixKey mkey)
protectedvirtual

Computes matrices needed for the HDG formulation. References to equations relate to the following paper (with a suitable changes in formulation to adapt to 3D): 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 NOTE: VARIABLE COEFFICIENTS CASE IS NOT IMPLEMENTED

Reimplemented from Nektar::StdRegions::StdExpansion.

Reimplemented in Nektar::LocalRegions::HexExp, Nektar::LocalRegions::PrismExp, Nektar::LocalRegions::TetExp, and Nektar::LocalRegions::PyrExp.

Definition at line 380 of file Expansion3D.cpp.

References AddHDGHelmholtzFaceTerms(), AddNormTraceInt(), ASSERTL0, ASSERTL1, Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::eFaceToElement, Nektar::StdRegions::eFactorLambda, Nektar::StdRegions::eFactorTau, Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::StdRegions::eHybridDGHelmholtz, Nektar::StdRegions::eHybridDGLamToQ0, Nektar::StdRegions::eHybridDGLamToQ1, Nektar::StdRegions::eHybridDGLamToQ2, Nektar::StdRegions::eHybridDGLamToU, Nektar::StdRegions::eInvHybridDGHelmholtz, Nektar::StdRegions::eInvLaplacianWithUnityMean, Nektar::StdRegions::eInvMass, Nektar::StdRegions::eLaplacian, Nektar::StdRegions::eMass, Nektar::StdRegions::eVarCoeffD00, Nektar::StdRegions::eWeakDeriv0, Nektar::StdRegions::eWeakDeriv1, Nektar::StdRegions::eWeakDeriv2, Nektar::eWrapper, Vmath::Fill(), Nektar::StdRegions::StdExpansion::GetBasisNumModes(), Nektar::StdRegions::StdMatrixKey::GetConstFactor(), Nektar::StdRegions::StdMatrixKey::GetConstFactors(), Nektar::StdRegions::StdExpansion::GetCoordim(), GetFaceExp(), Nektar::StdRegions::StdExpansion::GetFaceNcoeffs(), Nektar::StdRegions::StdExpansion::GetFaceNormal(), Nektar::StdRegions::StdExpansion::GetForient(), Nektar::StdRegions::StdExpansion::GetIndexMap(), Nektar::LocalRegions::Expansion::GetLocMatrix(), Nektar::StdRegions::StdMatrixKey::GetMatrixType(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::GetNfaces(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::StdRegions::StdMatrixKey::GetVarCoeffs(), Nektar::StdRegions::StdMatrixKey::HasVarCoeff(), Nektar::StdRegions::StdExpansion::IProductWRTBase(), Nektar::StdRegions::StdExpansion::IsBoundaryInteriorExpansion(), Nektar::StdRegions::StdExpansion::m_ncoeffs, Nektar::StdRegions::StdExpansion3D::m_negatedNormals, Vmath::Neg(), Nektar::StdRegions::StdExpansion::NumDGBndryCoeffs(), SetFaceToGeomOrientation(), SetTraceToGeomOrientation(), sign, Vmath::Svtvp(), Nektar::Transpose(), Vmath::Vcopy(), Vmath::Vmul(), Vmath::Vvtvp(), and Vmath::Zero().

{
//Variable coefficients are not implemented/////////
ASSERTL1(!mkey.HasVarCoeff(StdRegions::eVarCoeffD00),
"Matrix construction is not implemented for variable "
"coefficients at the moment");
////////////////////////////////////////////////////
DNekMatSharedPtr returnval;
switch(mkey.GetMatrixType())
{
// (Z^e)^{-1} (Eqn. 33, P22)
{
"HybridDGHelmholtz matrix not set up "
"for non boundary-interior expansions");
int i,j,k;
NekDouble lambdaval = mkey.GetConstFactor(StdRegions::eFactorLambda);
NekDouble tau = mkey.GetConstFactor(StdRegions::eFactorTau);
int ncoeffs = GetNcoeffs();
int nfaces = GetNfaces();
Array<OneD,unsigned int> fmap;
Array<OneD,int> sign;
int order_f, coordim = GetCoordim();
returnval = MemoryManager<DNekMat>::AllocateSharedPtr(ncoeffs,ncoeffs);
DNekMat &Mat = *returnval;
Vmath::Zero(ncoeffs*ncoeffs,Mat.GetPtr(),1);
// StdRegions::VarCoeffType Coeffs[3] = {StdRegions::eVarCoeffD00,
// StdRegions::eVarCoeffD11,
// StdRegions::eVarCoeffD22};
for(i=0; i < coordim; ++i)
{
DNekScalMat &Dmat = *GetLocMatrix(DerivType[i]);
Mat = Mat + Dmat*invMass*Transpose(Dmat);
/*
if(mkey.HasVarCoeff(Coeffs[i]))
{
MatrixKey DmatkeyL(DerivType[i], DetExpansionType(), *this,
StdRegions::NullConstFactorMap,
mkey.GetVarCoeffAsMap(Coeffs[i]));
MatrixKey DmatkeyR(DerivType[i], DetExpansionType(), *this);
DNekScalMat &DmatL = *GetLocMatrix(DmatkeyL);
DNekScalMat &DmatR = *GetLocMatrix(DmatkeyR);
Mat = Mat + DmatL*invMass*Transpose(DmatR);
}
else
{
DNekScalMat &Dmat = *GetLocMatrix(DerivType[i]);
Mat = Mat + Dmat*invMass*Transpose(Dmat);
}
*/
}
// Add Mass Matrix Contribution for Helmholtz problem
Mat = Mat + lambdaval*Mass;
// Add tau*E_l using elemental mass matrices on each edge
for(i = 0; i < nfaces; ++i)
{
FaceExp = GetFaceExp(i);
order_f = FaceExp->GetNcoeffs();
StdRegions::IndexMapKey ikey(
// @TODO: Document
/*
StdRegions::VarCoeffMap edgeVarCoeffs;
if (mkey.HasVarCoeff(StdRegions::eVarCoeffD00))
{
Array<OneD, NekDouble> mu(nq);
GetPhysEdgeVarCoeffsFromElement(
i, EdgeExp2,
mkey.GetVarCoeff(StdRegions::eVarCoeffD00), mu);
edgeVarCoeffs[StdRegions::eVarCoeffMass] = mu;
}
DNekScalMat &eMass = *EdgeExp->GetLocMatrix(
StdRegions::eMass,
StdRegions::NullConstFactorMap, edgeVarCoeffs);
*/
DNekScalMat &eMass = *FaceExp->GetLocMatrix(StdRegions::eMass);
for(j = 0; j < order_f; ++j)
{
for(k = 0; k < order_f; ++k)
{
Mat((*map)[j].index,(*map)[k].index) +=
tau*(*map)[j].sign*(*map)[k].sign*eMass(j,k);
}
}
}
break;
}
// U^e (P22)
{
int i,j,k;
int nbndry = NumDGBndryCoeffs();
int ncoeffs = GetNcoeffs();
int nfaces = GetNfaces();
NekDouble tau = mkey.GetConstFactor(StdRegions::eFactorTau);
Array<OneD,NekDouble> lambda(nbndry);
DNekVec Lambda(nbndry,lambda,eWrapper);
Array<OneD,NekDouble> ulam(ncoeffs);
DNekVec Ulam(ncoeffs,ulam,eWrapper);
Array<OneD,NekDouble> f(ncoeffs);
DNekVec F(ncoeffs,f,eWrapper);
// declare matrix space
returnval = MemoryManager<DNekMat>::AllocateSharedPtr(ncoeffs,nbndry);
DNekMat &Umat = *returnval;
// Z^e matrix
MatrixKey newkey(StdRegions::eInvHybridDGHelmholtz, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
DNekScalMat &invHmat = *GetLocMatrix(newkey);
Array<OneD,unsigned int> fmap;
Array<OneD,int> sign;
//alternative way to add boundary terms contribution
int bndry_cnt = 0;
for(i = 0; i < nfaces; ++i)
{
FaceExp = GetFaceExp(i);//temporary, need to rewrite AddHDGHelmholtzFaceTerms
int nface = GetFaceNcoeffs(i);
Array<OneD, NekDouble> face_lambda(nface);
const Array<OneD, const Array<OneD, NekDouble> > normals
for(j = 0; j < nface; ++j)
{
Vmath::Zero(nface,&face_lambda[0],1);
Vmath::Zero(ncoeffs,&f[0],1);
face_lambda[j] = 1.0;
SetFaceToGeomOrientation(i, face_lambda);
Array<OneD, NekDouble> tmp(FaceExp->GetTotPoints());
FaceExp->BwdTrans(face_lambda, tmp);
AddHDGHelmholtzFaceTerms(tau, i, tmp, mkey.GetVarCoeffs(), f);
Ulam = invHmat*F; // generate Ulam from lambda
// fill column of matrix
for(k = 0; k < ncoeffs; ++k)
{
Umat(k,bndry_cnt) = Ulam[k];
}
++bndry_cnt;
}
}
//// Set up face expansions from local geom info
//for(i = 0; i < nfaces; ++i)
//{
// FaceExp[i] = GetFaceExp(i);
//}
//
//// for each degree of freedom of the lambda space
//// calculate Umat entry
//// Generate Lambda to U_lambda matrix
//for(j = 0; j < nbndry; ++j)
//{
// // standard basis vectors e_j
// Vmath::Zero(nbndry,&lambda[0],1);
// Vmath::Zero(ncoeffs,&f[0],1);
// lambda[j] = 1.0;
//
// //cout << Lambda;
// SetTraceToGeomOrientation(lambda);
// //cout << Lambda << endl;
//
// // Compute F = [I D_1 M^{-1} D_2 M^{-1}] C e_j
// AddHDGHelmholtzTraceTerms(tau, lambda, FaceExp, mkey.GetVarCoeffs(), f);
//
// // Compute U^e_j
// Ulam = invHmat*F; // generate Ulam from lambda
//
// // fill column of matrix
// for(k = 0; k < ncoeffs; ++k)
// {
// Umat(k,j) = Ulam[k];
// }
//}
}
break;
// Q_0, Q_1, Q_2 matrices (P23)
// Each are a product of a row of Eqn 32 with the C matrix.
// Rather than explicitly computing all of Eqn 32, we note each
// row is almost a multiple of U^e, so use that as our starting
// point.
{
int i,j,k,dir;
int nbndry = NumDGBndryCoeffs();
//int nquad = GetNumPoints(0);
int ncoeffs = GetNcoeffs();
int nfaces = GetNfaces();
Array<OneD,NekDouble> lambda(nbndry);
DNekVec Lambda(nbndry,lambda,eWrapper);
Array<OneD, ExpansionSharedPtr> FaceExp(nfaces);
Array<OneD,NekDouble> ulam(ncoeffs);
DNekVec Ulam(ncoeffs,ulam,eWrapper);
Array<OneD,NekDouble> f(ncoeffs);
DNekVec F(ncoeffs,f,eWrapper);
// declare matrix space
returnval = MemoryManager<DNekMat>::AllocateSharedPtr(ncoeffs,nbndry);
DNekMat &Qmat = *returnval;
// Lambda to U matrix
MatrixKey lamToUkey(StdRegions::eHybridDGLamToU, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
DNekScalMat &lamToU = *GetLocMatrix(lamToUkey);
// Inverse mass matrix
for(i = 0; i < nfaces; ++i)
{
FaceExp[i] = GetFaceExp(i);
}
//Weak Derivative matrix
switch(mkey.GetMatrixType())
{
dir = 0;
break;
dir = 1;
break;
dir = 2;
break;
default:
ASSERTL0(false,"Direction not known");
break;
}
// for each degree of freedom of the lambda space
// calculate Qmat entry
// Generate Lambda to Q_lambda matrix
for(j = 0; j < nbndry; ++j)
{
Vmath::Zero(nbndry,&lambda[0],1);
lambda[j] = 1.0;
// for lambda[j] = 1 this is the solution to ulam
for(k = 0; k < ncoeffs; ++k)
{
Ulam[k] = lamToU(k,j);
}
// -D^T ulam
Vmath::Neg(ncoeffs,&ulam[0],1);
F = Transpose(*Dmat)*Ulam;
// Add the C terms resulting from the I's on the
// diagonals of Eqn 32
AddNormTraceInt(dir,lambda,FaceExp,f,mkey.GetVarCoeffs());
// finally multiply by inverse mass matrix
Ulam = invMass*F;
// fill column of matrix (Qmat is in column major format)
Vmath::Vcopy(ncoeffs,&ulam[0],1,&(Qmat.GetPtr())[0]+j*ncoeffs,1);
}
}
break;
// Matrix K (P23)
{
int i,j,f,cnt;
int order_f, nquad_f;
int nbndry = NumDGBndryCoeffs();
int nfaces = GetNfaces();
NekDouble tau = mkey.GetConstFactor(StdRegions::eFactorTau);
Array<OneD,NekDouble> work, varcoeff_work;
Array<OneD,const Array<OneD, NekDouble> > normals;
Array<OneD, ExpansionSharedPtr> FaceExp(nfaces);
Array<OneD, NekDouble> lam(nbndry);
Array<OneD,unsigned int> fmap;
Array<OneD, int> sign;
// declare matrix space
returnval = MemoryManager<DNekMat>::AllocateSharedPtr(nbndry, nbndry);
DNekMat &BndMat = *returnval;
// Matrix to map Lambda to U
MatrixKey LamToUkey(StdRegions::eHybridDGLamToU, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
DNekScalMat &LamToU = *GetLocMatrix(LamToUkey);
// Matrix to map Lambda to Q0
MatrixKey LamToQ0key(StdRegions::eHybridDGLamToQ0, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
LamToQ[0] = GetLocMatrix(LamToQ0key);
// Matrix to map Lambda to Q1
MatrixKey LamToQ1key(StdRegions::eHybridDGLamToQ1, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
LamToQ[1] = GetLocMatrix(LamToQ1key);
// Matrix to map Lambda to Q2
MatrixKey LamToQ2key(StdRegions::eHybridDGLamToQ2, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
LamToQ[2] = GetLocMatrix(LamToQ2key);
// Set up edge segment expansions from local geom info
for(i = 0; i < nfaces; ++i)
{
FaceExp[i] = GetFaceExp(i);
}
// Set up matrix derived from <mu, Q_lam.n - \tau (U_lam - Lam) >
for(i = 0; i < nbndry; ++i)
{
cnt = 0;
Vmath::Zero(nbndry,lam,1);
lam[i] = 1.0;
for(f = 0; f < nfaces; ++f)
{
order_f = FaceExp[f]->GetNcoeffs();
nquad_f = FaceExp[f]->GetNumPoints(0)*FaceExp[f]->GetNumPoints(1);
normals = GetFaceNormal(f);
work = Array<OneD,NekDouble>(nquad_f);
varcoeff_work = Array<OneD, NekDouble>(nquad_f);
StdRegions::IndexMapKey ikey(
// @TODO Variable coefficients
/*
StdRegions::VarCoeffType VarCoeff[3] = {StdRegions::eVarCoeffD00,
StdRegions::eVarCoeffD11,
StdRegions::eVarCoeffD22};
const StdRegions::VarCoeffMap &varcoeffs = mkey.GetVarCoeffs();
StdRegions::VarCoeffMap::const_iterator x;
*/
// Q0 * n0 (BQ_0 terms)
Array<OneD, NekDouble> faceCoeffs(order_f);
Array<OneD, NekDouble> facePhys (nquad_f);
for(j = 0; j < order_f; ++j)
{
faceCoeffs[j] = (*map)[j].sign*(*LamToQ[0])((*map)[j].index,i);
}
FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
// @TODO Variable coefficients
// Multiply by variable coefficient
/*
if ((x = varcoeffs.find(VarCoeff[0])) != varcoeffs.end())
{
GetPhysEdgeVarCoeffsFromElement(e,EdgeExp[e],x->second,varcoeff_work);
Vmath::Vmul(nquad_e,varcoeff_work,1,EdgeExp[e]->GetPhys(),1,EdgeExp[e]->UpdatePhys(),1);
}
*/
Vmath::Vmul(nquad_f, normals[0], 1, facePhys, 1, work, 1);
// Q1 * n1 (BQ_1 terms)
for(j = 0; j < order_f; ++j)
{
faceCoeffs[j] = (*map)[j].sign*(*LamToQ[1])((*map)[j].index,i);
}
FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
// @TODO Variable coefficients
// Multiply by variable coefficients
/*
if ((x = varcoeffs.find(VarCoeff[1])) != varcoeffs.end())
{
GetPhysEdgeVarCoeffsFromElement(e,EdgeExp[e],x->second,varcoeff_work);
Vmath::Vmul(nquad_e,varcoeff_work,1,EdgeExp[e]->GetPhys(),1,EdgeExp[e]->UpdatePhys(),1);
}
*/
Vmath::Vvtvp(nquad_f, normals[1], 1, facePhys, 1, work, 1, work, 1);
// Q2 * n2 (BQ_2 terms)
for(j = 0; j < order_f; ++j)
{
faceCoeffs[j] = (*map)[j].sign*(*LamToQ[2])((*map)[j].index,i);
}
FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
// @TODO Variable coefficients
// Multiply by variable coefficients
/*
if ((x = varcoeffs.find(VarCoeff[2])) != varcoeffs.end())
{
GetPhysEdgeVarCoeffsFromElement(e,EdgeExp[e],x->second,varcoeff_work);
Vmath::Vmul(nquad_e,varcoeff_work,1,EdgeExp[e]->GetPhys(),1,EdgeExp[e]->UpdatePhys(),1);
}
*/
Vmath::Vvtvp(nquad_f, normals[2], 1, facePhys, 1,
work, 1, work, 1);
{
Vmath::Neg(nquad_f, work, 1);
}
// - tau (ulam - lam)
// Corresponds to the G and BU terms.
for(j = 0; j < order_f; ++j)
{
faceCoeffs[j] = (*map)[j].sign*LamToU((*map)[j].index,i) - lam[cnt+j];
}
FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
// @TODO Variable coefficients
// Multiply by variable coefficients
/*
if ((x = varcoeffs.find(VarCoeff[0])) != varcoeffs.end())
{
GetPhysEdgeVarCoeffsFromElement(e,FaceExp[f],x->second,varcoeff_work);
Vmath::Vmul(nquad_f,varcoeff_work,1,FaceExp[f]->GetPhys(),1,FaceExp[f]->UpdatePhys(),1);
}
*/
Vmath::Svtvp(nquad_f, -tau, facePhys, 1,
work, 1, work, 1);
// @TODO Add variable coefficients
FaceExp[f]->IProductWRTBase(work, faceCoeffs);
SetFaceToGeomOrientation(f, faceCoeffs);
for(j = 0; j < order_f; ++j)
{
BndMat(cnt+j,i) = faceCoeffs[j];
}
cnt += order_f;
}
}
}
break;
//HDG postprocessing
{
MatrixKey lapkey(StdRegions::eLaplacian, DetShapeType(), *this, mkey.GetConstFactors(), mkey.GetVarCoeffs());
DNekScalMat &LapMat = *GetLocMatrix(lapkey);
returnval = MemoryManager<DNekMat>::AllocateSharedPtr(LapMat.GetRows(),LapMat.GetColumns());
DNekMatSharedPtr lmat = returnval;
(*lmat) = LapMat;
// replace first column with inner product wrt 1
int nq = GetTotPoints();
Array<OneD, NekDouble> tmp(nq);
Array<OneD, NekDouble> outarray(m_ncoeffs);
Vmath::Fill(nq,1.0,tmp,1);
IProductWRTBase(tmp, outarray);
Vmath::Vcopy(m_ncoeffs,&outarray[0],1,
&(lmat->GetPtr())[0],1);
//cout << endl << *lmat << endl;
lmat->Invert();
}
break;
default:
ASSERTL0(false,"This matrix type cannot be generated from this class");
break;
}
return returnval;
}
Array< OneD, unsigned int > Nektar::LocalRegions::Expansion3D::v_GetEdgeInverseBoundaryMap ( int  eid)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1806 of file Expansion3D.cpp.

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

{
int n, j;
int nEdgeCoeffs;
int nBndCoeffs = NumBndryCoeffs();
Array<OneD, unsigned int> bmap(nBndCoeffs);
// Map from full system to statically condensed system (i.e reverse
// GetBoundaryMap)
map<int, int> invmap;
for (j = 0; j < nBndCoeffs; ++j)
{
invmap[bmap[j]] = j;
}
// Number of interior edge coefficients
nEdgeCoeffs = GetEdgeNcoeffs(eid) - 2;
Array<OneD, unsigned int> edgemaparray(nEdgeCoeffs);
geom->GetEorient(eid);
Array<OneD, unsigned int> maparray =
Array<OneD, unsigned int>(nEdgeCoeffs);
Array<OneD, int> signarray =
Array<OneD, int>(nEdgeCoeffs, 1);
// maparray is the location of the edge within the matrix
GetEdgeInteriorMap(eid, eOrient, maparray, signarray);
for (n = 0; n < nEdgeCoeffs; ++n)
{
edgemaparray[n] = invmap[maparray[n]];
}
return edgemaparray;
}
Array< OneD, unsigned int > Nektar::LocalRegions::Expansion3D::v_GetFaceInverseBoundaryMap ( int  fid,
StdRegions::Orientation  faceOrient = StdRegions::eNoOrientation 
)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1849 of file Expansion3D.cpp.

References Nektar::StdRegions::eNoOrientation, Nektar::StdRegions::StdExpansion::GetBoundaryMap(), Nektar::StdRegions::StdExpansion::GetFaceInteriorMap(), Nektar::StdRegions::StdExpansion::GetFaceIntNcoeffs(), Nektar::StdRegions::StdExpansion::GetForient(), and Nektar::StdRegions::StdExpansion::NumBndryCoeffs().

{
int n, j;
int nFaceCoeffs;
int nBndCoeffs = NumBndryCoeffs();
Array<OneD, unsigned int> bmap(nBndCoeffs);
// Map from full system to statically condensed system (i.e reverse
// GetBoundaryMap)
map<int, int> reversemap;
for (j = 0; j < bmap.num_elements(); ++j)
{
reversemap[bmap[j]] = j;
}
// Number of interior face coefficients
nFaceCoeffs = GetFaceIntNcoeffs(fid);
Array<OneD, unsigned int> facemaparray(nFaceCoeffs);
Array<OneD, unsigned int> maparray =
Array<OneD, unsigned int>(nFaceCoeffs);
Array<OneD, int> signarray =
Array<OneD, int>(nFaceCoeffs, 1);
if(faceOrient == StdRegions::eNoOrientation)
{
fOrient = GetForient(fid);
}
else
{
fOrient = faceOrient;
}
// maparray is the location of the face within the matrix
GetFaceInteriorMap(fid, fOrient, maparray, signarray);
for (n = 0; n < nFaceCoeffs; ++n)
{
facemaparray[n] = reversemap[maparray[n]];
}
return facemaparray;
}
StdRegions::Orientation Nektar::LocalRegions::Expansion3D::v_GetForient ( int  face)
protectedvirtual

Reimplemented from Nektar::StdRegions::StdExpansion.

Definition at line 1897 of file Expansion3D.cpp.

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

{
return m_geom->GetForient(face);
}

Member Data Documentation

std::vector<Expansion2DWeakPtr> Nektar::LocalRegions::Expansion3D::m_faceExp
private
std::vector<bool> Nektar::LocalRegions::Expansion3D::m_requireNeg
private

Definition at line 146 of file Expansion3D.h.

Referenced by v_AddFaceNormBoundaryInt().