Nektar++
Expansion2D.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File Expansion2D.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 Expansion2D routines
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef EXPANSION2D_H
36 #define EXPANSION2D_H
37 
38 #include <boost/core/ignore_unused.hpp>
39 
42 #include <LocalRegions/MatrixKey.h>
45 
46 namespace Nektar
47 {
48 namespace LocalRegions
49 {
50 class Expansion3D;
51 typedef std::shared_ptr<Expansion3D> Expansion3DSharedPtr;
52 typedef std::weak_ptr<Expansion3D> Expansion3DWeakPtr;
53 
54 class Expansion2D;
55 typedef std::shared_ptr<Expansion2D> Expansion2DSharedPtr;
56 typedef std::weak_ptr<Expansion2D> Expansion2DWeakPtr;
57 typedef std::vector<Expansion2DSharedPtr> Expansion2DVector;
58 
59 class Expansion2D : virtual public Expansion,
60  virtual public StdRegions::StdExpansion2D
61 {
62 public:
64 
66  {
67  }
68 
70  CreateMatrix(const MatrixKey &mkey);
71 
74  Array<OneD, NekDouble> &inout);
75 
77 
79 
80  inline void AddNormTraceInt(const int dir,
82  Array<OneD, Array<OneD, NekDouble>> &edgeCoeffs,
83  Array<OneD, NekDouble> &outarray);
84 
85  inline void AddNormTraceInt(const int dir,
88  Array<OneD, NekDouble> &outarray,
89  const StdRegions::VarCoeffMap &varcoeffs);
90 
91  inline void AddEdgeBoundaryInt(
92  const int edge, ExpansionSharedPtr &EdgeExp,
95 
96  inline void AddHDGHelmholtzEdgeTerms(
97  const NekDouble tau, const int edge,
99  Array<OneD, NekDouble> &edgePhys,
100  const StdRegions::VarCoeffMap &dirForcing,
101  Array<OneD, NekDouble> &outarray);
102 
103  inline void AddHDGHelmholtzTraceTerms(
104  const NekDouble tau, const Array<OneD, const NekDouble> &inarray,
106  const StdRegions::VarCoeffMap &dirForcing,
107  Array<OneD, NekDouble> &outarray);
108 
110 
112  const int nvert, const StdRegions::Orientation orient, const int nq0,
113  Array<OneD, int> &idmap);
114 
116  virtual void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp);
117 
118 protected:
119  std::vector<bool> m_requireNeg;
120 
122  const int dir, const int shapedim,
123  const StdRegions::VarCoeffMap &varcoeffs);
124 
126  const int dir, const StdRegions::VarCoeffMap &varcoeffs);
127 
129  const int dir, const StdRegions::VarCoeffMap &varcoeffs);
130 
131  // Hybridized DG routines
132  virtual void v_DGDeriv(const int dir,
133  const Array<OneD, const NekDouble> &incoeffs,
135  Array<OneD, Array<OneD, NekDouble>> &edgeCoeffs,
136  Array<OneD, NekDouble> &out_d);
137 
138  virtual void v_AddEdgeNormBoundaryInt(
139  const int edge, const ExpansionSharedPtr &EdgeExp,
142  Array<OneD, NekDouble> &outarray);
143 
144  virtual void v_AddEdgeNormBoundaryInt(
145  const int edge, const ExpansionSharedPtr &EdgeExp,
147  Array<OneD, NekDouble> &outarray);
148 
149  virtual void v_AddRobinMassMatrix(
150  const int edgeid, const Array<OneD, const NekDouble> &primCoeffs,
151  DNekMatSharedPtr &inoutmat);
152 
153  virtual void v_AddRobinTraceContribution(
154  const int traceid, const Array<OneD, const NekDouble> &primCoeffs,
155  const Array<OneD, NekDouble> &incoeffs, Array<OneD, NekDouble> &coeffs);
156 
158  const DNekScalMatSharedPtr &r_bnd);
159 
161  const int edge, ExpansionSharedPtr &EdgeExp,
162  const Array<OneD, const NekDouble> &varcoeff,
163  Array<OneD, NekDouble> &outarray);
164 
166  const int dir, const int edge, ExpansionSharedPtr &EdgeExp_e,
167  const Array<OneD, const Array<OneD, NekDouble>> &normals,
168  const StdRegions::VarCoeffMap &varcoeffs);
169 
171  Array<OneD, int> &idmap, const int nq0,
172  const int nq1);
173 
174  virtual void v_SetUpPhysNormals(const int edge);
175  virtual NekDouble v_VectorFlux(
176  const Array<OneD, Array<OneD, NekDouble>> &vec);
177  virtual void v_TraceNormLen(const int traceid, NekDouble &h, NekDouble &p);
178 };
179 
181 {
182  return std::dynamic_pointer_cast<SpatialDomains::Geometry2D>(m_geom);
183 }
184 } // namespace LocalRegions
185 } // namespace Nektar
186 
187 #endif
#define LOCAL_REGIONS_EXPORT
virtual void v_AddRobinTraceContribution(const int traceid, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs)
std::vector< bool > m_requireNeg
Definition: Expansion2D.h:119
Array< OneD, NekDouble > v_GetnEdgecdotMF(const int dir, const int edge, ExpansionSharedPtr &EdgeExp_e, const Array< OneD, const Array< OneD, NekDouble >> &normals, const StdRegions::VarCoeffMap &varcoeffs)
virtual Array< OneD, NekDouble > v_GetMFDiv(const int dir, const StdRegions::VarCoeffMap &varcoeffs)
void SetTraceToGeomOrientation(Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, NekDouble > &inout)
virtual void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp)
void ReOrientEdgePhysMap(const int nvert, const StdRegions::Orientation orient, const int nq0, Array< OneD, int > &idmap)
void v_ReOrientTracePhysMap(const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1)
virtual void v_AddEdgeNormBoundaryInt(const int edge, const ExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: Expansion2D.cpp:59
virtual Array< OneD, NekDouble > v_GetMFMag(const int dir, const StdRegions::VarCoeffMap &varcoeffs)
Array< OneD, unsigned int > GetTraceInverseBoundaryMap(int eid)
virtual void v_SetUpPhysNormals(const int edge)
virtual void v_TraceNormLen(const int traceid, NekDouble &h, NekDouble &p)
virtual void v_AddRobinMassMatrix(const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
Expansion2D(SpatialDomains::Geometry2DSharedPtr pGeom)
Definition: Expansion2D.cpp:54
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
virtual Array< OneD, NekDouble > v_GetMF(const int dir, const int shapedim, const StdRegions::VarCoeffMap &varcoeffs)
SpatialDomains::Geometry2DSharedPtr GetGeom2D() const
Definition: Expansion2D.h:180
void AddHDGHelmholtzEdgeTerms(const NekDouble tau, const int edge, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, NekDouble > &edgePhys, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
void AddNormTraceInt(const int dir, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble >> &edgeCoeffs, Array< OneD, NekDouble > &outarray)
void GetPhysEdgeVarCoeffsFromElement(const int edge, ExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &varcoeff, Array< OneD, NekDouble > &outarray)
void AddEdgeBoundaryInt(const int edge, ExpansionSharedPtr &EdgeExp, Array< OneD, NekDouble > &edgePhys, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
virtual DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
virtual NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble >> &vec)
virtual void v_DGDeriv(const int dir, const Array< OneD, const NekDouble > &incoeffs, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble >> &edgeCoeffs, Array< OneD, NekDouble > &out_d)
void AddHDGHelmholtzTraceTerms(const NekDouble tau, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
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< Expansion2DSharedPtr > Expansion2DVector
Definition: Expansion2D.h:57
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry.h:65
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