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 
44 
45 namespace Nektar
46 {
47  namespace LocalRegions
48  {
49  class Expansion3D;
50  typedef std::shared_ptr<Expansion3D> Expansion3DSharedPtr;
51  typedef std::weak_ptr<Expansion3D> Expansion3DWeakPtr;
52 
53  class Expansion2D;
54  typedef std::shared_ptr<Expansion2D> Expansion2DSharedPtr;
55  typedef std::weak_ptr<Expansion2D> Expansion2DWeakPtr;
56  typedef std::vector< Expansion2DSharedPtr > Expansion2DVector;
57 
58  class Expansion2D: virtual public Expansion,
59  virtual public StdRegions::StdExpansion2D
60  {
61  public:
62  LOCAL_REGIONS_EXPORT Expansion2D(SpatialDomains::
63  Geometry2DSharedPtr pGeom);
64 
66 
69  Array<OneD, NekDouble> &inout);
70 
73 
74  inline void AddNormTraceInt(
75  const int dir,
77  Array<OneD, Array<OneD, NekDouble> > &edgeCoeffs,
78  Array<OneD, NekDouble> &outarray);
79 
80  inline void AddNormTraceInt(
81  const int dir,
84  Array<OneD, NekDouble> &outarray,
85  const StdRegions::VarCoeffMap &varcoeffs);
86 
87  inline void AddEdgeBoundaryInt(
88  const int edge,
89  ExpansionSharedPtr &EdgeExp,
90  Array<OneD, NekDouble> &edgePhys,
91  Array<OneD, NekDouble> &outarray,
92  const StdRegions::VarCoeffMap &varcoeffs = StdRegions::
94 
95  inline void AddHDGHelmholtzEdgeTerms(
96  const NekDouble tau,
97  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,
105  const Array<OneD, const NekDouble> &inarray,
107  const StdRegions::VarCoeffMap &dirForcing,
108  Array<OneD, NekDouble> &outarray);
109 
111 
113  const int nvert,
114  const StdRegions::Orientation orient,
115  const int nq0,
116  Array<OneD, int> &idmap);
117 
118  protected:
119  std::vector<Expansion1DWeakPtr> m_edgeExp;
120  std::vector<bool> m_requireNeg;
121  std::map<int, NormalVector> m_edgeNormals;
126 
128  const int dir,
129  const int shapedim,
130  const StdRegions::VarCoeffMap &varcoeffs);
131 
133  const int dir,
134  const StdRegions::VarCoeffMap &varcoeffs);
135 
137  const int dir,
138  const StdRegions::VarCoeffMap &varcoeffs);
139 
141  const StdRegions::StdMatrixKey &mkey);
142 
143  // Hybridized DG routines
144  virtual void v_DGDeriv(
145  const int dir,
146  const Array<OneD, const NekDouble> &incoeffs,
148  Array<OneD, Array<OneD, NekDouble> > &edgeCoeffs,
149  Array<OneD, NekDouble> &out_d);
150 
151  virtual void v_AddEdgeNormBoundaryInt(
152  const int edge,
153  const ExpansionSharedPtr &EdgeExp,
156  Array<OneD, NekDouble> &outarray);
157 
158  virtual void v_AddEdgeNormBoundaryInt(
159  const int edge,
160  const ExpansionSharedPtr &EdgeExp,
162  Array<OneD, NekDouble> &outarray);
163 
164  virtual void v_AddRobinMassMatrix(
165  const int edgeid,
166  const Array<OneD, const NekDouble > &primCoeffs,
167  DNekMatSharedPtr &inoutmat);
168 
169  virtual void v_AddRobinTraceContribution(
170  const int traceid,
171  const Array<OneD, const NekDouble> &primCoeffs,
172  const Array<OneD, NekDouble> &incoeffs,
173  Array<OneD, NekDouble> &coeffs);
174 
176  const DNekScalMatSharedPtr &r_bnd);
177 
179  const int edge,
180  ExpansionSharedPtr &EdgeExp,
181  const Array<OneD, const NekDouble> &varcoeff,
182  Array<OneD,NekDouble> &outarray);
183 
185  const int dir,
186  const int edge,
187  ExpansionSharedPtr &EdgeExp_e,
188  const Array<OneD, const Array<OneD, NekDouble> > &normals,
189  const StdRegions::VarCoeffMap &varcoeffs);
190 
192  (const StdRegions::Orientation orient,
193  Array<OneD, int> &idmap,
194  const int nq0, const int nq1);
195 
196  virtual void v_SetUpPhysNormals (const int edge);
197  virtual const NormalVector &v_GetTraceNormal(const int edge) const;
198  virtual NekDouble v_VectorFlux(
199  const Array<OneD, Array<OneD, NekDouble > > &vec);
200  };
201 
202 
205  {
206  return std::dynamic_pointer_cast<SpatialDomains::
207  Geometry2D>(m_geom);
208  }
209  } //end of namespace
210 } //end of namespace
211 
212 #endif
#define LOCAL_REGIONS_EXPORT
virtual void v_DGDeriv(const int dir, const Array< OneD, const NekDouble > &incoeffs, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &edgeCoeffs, Array< OneD, NekDouble > &out_d)
virtual void v_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:120
Expansion3DWeakPtr m_elementRight
Definition: Expansion2D.h:123
virtual Array< OneD, NekDouble > v_GetMFDiv(const int dir, const StdRegions::VarCoeffMap &varcoeffs)
void SetTraceToGeomOrientation(Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, NekDouble > &inout)
void ReOrientEdgePhysMap(const int nvert, const StdRegions::Orientation orient, const int nq0, Array< OneD, int > &idmap)
virtual const NormalVector & v_GetTraceNormal(const int edge) const
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)
Definition: Expansion2D.cpp:56
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_AddRobinMassMatrix(const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
std::vector< Expansion1DWeakPtr > m_edgeExp
Definition: Expansion2D.h:119
Expansion2D(SpatialDomains::Geometry2DSharedPtr pGeom)
Definition: Expansion2D.cpp:51
void AddNormTraceInt(const int dir, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &edgeCoeffs, Array< OneD, NekDouble > &outarray)
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:204
void AddHDGHelmholtzEdgeTerms(const NekDouble tau, const int edge, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, NekDouble > &edgePhys, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
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 NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &vec)
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)
Expansion3DWeakPtr m_elementLeft
Definition: Expansion2D.h:122
std::map< int, NormalVector > m_edgeNormals
Definition: Expansion2D.h:121
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::vector< Expansion2DSharedPtr > Expansion2DVector
Definition: Expansion2D.h:56
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:51
std::shared_ptr< Expansion3D > Expansion3DSharedPtr
Definition: Expansion2D.h:49
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry.h:65
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:272
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:273
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:69
double NekDouble