Nektar++
Expansion3D.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: Expansion3D.h
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Header file for Expansion3D routines
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef EXPANSION3D_H
36 #define EXPANSION3D_H
37 
38 #include <LocalRegions/Expansion.h>
42 
43 namespace Nektar
44 {
45 namespace LocalRegions
46 {
47 
48 class Expansion2D;
49 typedef std::shared_ptr<Expansion2D> Expansion2DSharedPtr;
50 typedef std::weak_ptr<Expansion2D> Expansion2DWeakPtr;
51 
52 class Expansion3D;
53 typedef std::shared_ptr<Expansion3D> Expansion3DSharedPtr;
54 typedef std::weak_ptr<Expansion3D> Expansion3DWeakPtr;
55 typedef std::vector<Expansion3DSharedPtr> Expansion3DVector;
56 
57 class Expansion3D : virtual public Expansion,
58  virtual public StdRegions::StdExpansion3D
59 {
60 public:
63  {
64  }
66  {
67  }
68 
70  Array<OneD, NekDouble> &inout);
72  const int face, Array<OneD, NekDouble> &inout);
73  inline void AddHDGHelmholtzFaceTerms(
74  const NekDouble tau, const int edge, Array<OneD, NekDouble> &facePhys,
75  const StdRegions::VarCoeffMap &dirForcing,
76  Array<OneD, NekDouble> &outarray);
77 
78  inline void AddNormTraceInt(const int dir,
80  Array<OneD, Array<OneD, NekDouble>> &faceCoeffs,
81  Array<OneD, NekDouble> &outarray);
82 
83  inline void AddNormTraceInt(const int dir,
86  Array<OneD, NekDouble> &outarray,
87  const StdRegions::VarCoeffMap &varcoeffs);
88 
89  inline void AddFaceBoundaryInt(
90  const int face, ExpansionSharedPtr &FaceExp,
93 
95 
97  const StdRegions::Orientation orient, Array<OneD, int> &idmap,
98  const int nq0, const int nq1);
99 
101  const Array<OneD, const Array<OneD, NekDouble>> &Fvec,
102  Array<OneD, NekDouble> &outarray);
103 
105  int eid);
106 
108  int fid,
110  int P1 = -1, int P2 = -1);
111 
116 
118  CreateMatrix(const MatrixKey &mkey);
119 
120 protected:
121  std::map<int, NormalVector> m_faceNormals;
122  virtual void v_DGDeriv(const int dir,
123  const Array<OneD, const NekDouble> &incoeffs,
125  Array<OneD, Array<OneD, NekDouble>> &faceCoeffs,
126  Array<OneD, NekDouble> &out_d);
128  virtual void v_AddFaceNormBoundaryInt(
129  const int face, const ExpansionSharedPtr &FaceExp,
131  Array<OneD, NekDouble> &outarray);
132 
133  virtual void v_AddRobinMassMatrix(
134  const int face, const Array<OneD, const NekDouble> &primCoeffs,
135  DNekMatSharedPtr &inoutmat);
136 
137  virtual StdRegions::Orientation v_GetTraceOrient(int face);
138 
139  virtual void v_GetTracePhysVals(
140  const int face, const StdRegions::StdExpansionSharedPtr &FaceExp,
141  const Array<OneD, const NekDouble> &inarray,
143 
144  virtual void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp);
145 
147  const int face, ExpansionSharedPtr &FaceExp,
148  const Array<OneD, const NekDouble> &varcoeff,
149  Array<OneD, NekDouble> &outarray);
150 
152  const int dir, const int face, ExpansionSharedPtr &FaceExp_f,
153  const Array<OneD, const Array<OneD, NekDouble>> &normals,
154  const StdRegions::VarCoeffMap &varcoeffs);
155 
156  //-----------------------------
157  // Low Energy Basis functions
158  //-----------------------------
159 
161  const DNekScalMatSharedPtr &r_bnd,
162  const StdRegions::MatrixType matrixType);
163 
165  const DNekScalMatSharedPtr &transformationmatrix);
166 
168  const DNekScalMatSharedPtr &r_bnd);
169 
170  LOCAL_REGIONS_EXPORT virtual void v_TraceNormLen(const int traceid,
171  NekDouble &h,
172  NekDouble &p);
173 
174 private:
175  // Do not add members here since it may lead to conflicts.
176  // Only use this class for member functions
177 
178  std::vector<bool> m_requireNeg;
179 };
180 
182 {
183  return std::dynamic_pointer_cast<SpatialDomains::Geometry3D>(m_geom);
184 }
185 } // namespace LocalRegions
186 } // namespace Nektar
187 
188 #endif
#define LOCAL_REGIONS_EXPORT
void GetInverseBoundaryMaps(Array< OneD, unsigned int > &vmap, Array< OneD, Array< OneD, unsigned int >> &emap, Array< OneD, Array< OneD, unsigned int >> &fmap)
virtual void v_TraceNormLen(const int traceid, NekDouble &h, NekDouble &p)
Expansion3D(SpatialDomains::Geometry3DSharedPtr pGeom)
Definition: Expansion3D.h:61
void SetTraceToGeomOrientation(Array< OneD, NekDouble > &inout)
Align trace orientation with the geometry orientation.
void AddNormTraceInt(const int dir, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, Array< OneD, NekDouble >> &faceCoeffs, Array< OneD, NekDouble > &outarray)
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
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...
Array< OneD, unsigned int > GetTraceInverseBoundaryMap(int fid, StdRegions::Orientation faceOrient=StdRegions::eNoOrientation, int P1=-1, int P2=-1)
virtual DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
std::vector< bool > m_requireNeg
Definition: Expansion3D.h:178
void v_ReOrientTracePhysMap(const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1)
void AddFaceBoundaryInt(const int face, ExpansionSharedPtr &FaceExp, Array< OneD, NekDouble > &facePhys, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
void GetPhysFaceVarCoeffsFromElement(const int face, ExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &varcoeff, Array< OneD, NekDouble > &outarray)
virtual void v_AddFaceNormBoundaryInt(const int face, const ExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
virtual Array< OneD, NekDouble > v_GetnFacecdotMF(const int dir, const int face, ExpansionSharedPtr &FaceExp_f, const Array< OneD, const Array< OneD, NekDouble >> &normals, const StdRegions::VarCoeffMap &varcoeffs)
virtual void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp)
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap(int eid)
std::map< int, NormalVector > m_faceNormals
Definition: Expansion3D.h:121
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
SpatialDomains::Geometry3DSharedPtr GetGeom3D() const
Definition: Expansion3D.h:181
virtual StdRegions::Orientation v_GetTraceOrient(int face)
virtual DNekMatSharedPtr v_BuildInverseTransformationMatrix(const DNekScalMatSharedPtr &transformationmatrix)
Build inverse and inverse transposed transformation matrix: and .
void AddHDGHelmholtzFaceTerms(const NekDouble tau, const int edge, Array< OneD, NekDouble > &facePhys, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
Definition: Expansion3D.cpp:54
void v_NormVectorIProductWRTBase(const Array< OneD, const Array< OneD, NekDouble >> &Fvec, Array< OneD, NekDouble > &outarray)
virtual DNekMatSharedPtr v_BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
void SetFaceToGeomOrientation(const int face, Array< OneD, NekDouble > &inout)
Align face orientation with the geometry orientation.
virtual void v_AddRobinMassMatrix(const int face, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
virtual void v_GetTracePhysVals(const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
Extract the physical values along face face from inarray into outarray following the local face orien...
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:272
std::weak_ptr< Expansion2D > Expansion2DWeakPtr
Definition: Expansion1D.h:49
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
std::shared_ptr< Expansion2D > Expansion2DSharedPtr
Definition: Expansion1D.h:47
std::weak_ptr< Expansion3D > Expansion3DWeakPtr
Definition: Expansion2D.h:52
std::shared_ptr< Expansion3D > Expansion3DSharedPtr
Definition: Expansion2D.h:50
std::vector< Expansion3DSharedPtr > Expansion3DVector
Definition: Expansion3D.h:55
std::shared_ptr< Geometry3D > Geometry3DSharedPtr
Definition: Geometry3D.h:52
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:240
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:241
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble