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
45
46namespace Nektar
47{
48namespace LocalRegions
49{
50class Expansion3D;
51typedef std::shared_ptr<Expansion3D> Expansion3DSharedPtr;
52typedef std::weak_ptr<Expansion3D> Expansion3DWeakPtr;
53
54class Expansion2D;
55typedef std::shared_ptr<Expansion2D> Expansion2DSharedPtr;
56typedef std::weak_ptr<Expansion2D> Expansion2DWeakPtr;
57typedef std::vector<Expansion2DSharedPtr> Expansion2DVector;
58
59class Expansion2D : virtual public Expansion,
60 virtual public StdRegions::StdExpansion2D
61{
62public:
64
65 LOCAL_REGIONS_EXPORT virtual ~Expansion2D() override = default;
66
68 CreateMatrix(const MatrixKey &mkey);
69
73
75 int eid);
76
77 inline void AddNormTraceInt(const int dir,
79 Array<OneD, Array<OneD, NekDouble>> &edgeCoeffs,
80 Array<OneD, NekDouble> &outarray);
81
82 inline void AddNormTraceInt(const int dir,
85 Array<OneD, NekDouble> &outarray,
86 const StdRegions::VarCoeffMap &varcoeffs);
87
88 inline void AddEdgeBoundaryInt(
89 const int edge, ExpansionSharedPtr &EdgeExp,
92
93 inline void AddHDGHelmholtzEdgeTerms(
94 const NekDouble tau, const int edge,
96 Array<OneD, NekDouble> &edgePhys,
97 const StdRegions::VarCoeffMap &dirForcing,
98 Array<OneD, NekDouble> &outarray);
99
100 inline void AddHDGHelmholtzTraceTerms(
101 const NekDouble tau, const Array<OneD, const NekDouble> &inarray,
103 const StdRegions::VarCoeffMap &dirForcing,
104 Array<OneD, NekDouble> &outarray);
105
107
109 const int nvert, const StdRegions::Orientation orient, const int nq0,
110 Array<OneD, int> &idmap);
111
113 const StdRegions::StdMatrixKey &mkey) override;
114 virtual void v_GenTraceExp(const int traceid,
115 ExpansionSharedPtr &exp) override;
116
117protected:
118 std::vector<bool> m_requireNeg;
119
120 // Hybridized DG routines
121 virtual void v_DGDeriv(const int dir,
122 const Array<OneD, const NekDouble> &incoeffs,
124 Array<OneD, Array<OneD, NekDouble>> &edgeCoeffs,
125 Array<OneD, NekDouble> &out_d) override;
126
127 virtual void v_AddEdgeNormBoundaryInt(
128 const int edge, const ExpansionSharedPtr &EdgeExp,
131 Array<OneD, NekDouble> &outarray) override;
132
133 virtual void v_AddEdgeNormBoundaryInt(
134 const int edge, const ExpansionSharedPtr &EdgeExp,
136 Array<OneD, NekDouble> &outarray) override;
137
138 virtual void v_AddRobinMassMatrix(
139 const int edgeid, const Array<OneD, const NekDouble> &primCoeffs,
140 DNekMatSharedPtr &inoutmat) override;
141
142 virtual void v_AddRobinTraceContribution(
143 const int traceid, const Array<OneD, const NekDouble> &primCoeffs,
144 const Array<OneD, NekDouble> &incoeffs,
145 Array<OneD, NekDouble> &coeffs) override;
146
148 const DNekScalMatSharedPtr &r_bnd) override;
149
150 virtual void v_ReOrientTracePhysMap(const StdRegions::Orientation orient,
151 Array<OneD, int> &idmap, const int nq0,
152 const int nq1) override;
153
154 virtual void v_SetUpPhysNormals(const int edge) override;
155 virtual NekDouble v_VectorFlux(
156 const Array<OneD, Array<OneD, NekDouble>> &vec) override;
157 virtual void v_TraceNormLen(const int traceid, NekDouble &h,
158 NekDouble &p) override;
159
160private:
162 const int edge, ExpansionSharedPtr &EdgeExp,
163 const Array<OneD, const NekDouble> &varcoeff,
164 Array<OneD, NekDouble> &outarray);
165
167 const int dir, const int edge, ExpansionSharedPtr &EdgeExp_e,
168 const Array<OneD, const Array<OneD, NekDouble>> &normals,
169 const StdRegions::VarCoeffMap &varcoeffs);
170};
171
173{
174 return std::dynamic_pointer_cast<SpatialDomains::Geometry2D>(m_geom);
175}
176} // namespace LocalRegions
177} // namespace Nektar
178
179#endif
#define LOCAL_REGIONS_EXPORT
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) override
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
std::vector< bool > m_requireNeg
Definition: Expansion2D.h:118
virtual void v_AddRobinTraceContribution(const int traceid, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs) override
virtual void v_SetUpPhysNormals(const int edge) override
virtual void v_AddRobinMassMatrix(const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat) override
Array< OneD, NekDouble > GetnEdgecdotMF(const int dir, const int edge, ExpansionSharedPtr &EdgeExp_e, const Array< OneD, const Array< OneD, NekDouble > > &normals, const StdRegions::VarCoeffMap &varcoeffs)
void SetTraceToGeomOrientation(Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, NekDouble > &inout)
virtual DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd) override
virtual NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &vec) override
void ReOrientEdgePhysMap(const int nvert, const StdRegions::Orientation orient, const int nq0, Array< OneD, int > &idmap)
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: Expansion2D.cpp:59
Array< OneD, unsigned int > GetTraceInverseBoundaryMap(int eid)
virtual void v_ReOrientTracePhysMap(const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1) override
Expansion2D(SpatialDomains::Geometry2DSharedPtr pGeom)
Definition: Expansion2D.cpp:54
void AddNormTraceInt(const int dir, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &edgeCoeffs, Array< OneD, NekDouble > &outarray)
SpatialDomains::Geometry2DSharedPtr GetGeom2D() const
Definition: Expansion2D.h:172
void AddHDGHelmholtzEdgeTerms(const NekDouble tau, const int edge, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, NekDouble > &edgePhys, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
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) override
virtual void v_TraceNormLen(const int traceid, NekDouble &h, NekDouble &p) override
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 ~Expansion2D() override=default
void AddHDGHelmholtzTraceTerms(const NekDouble tau, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
virtual void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp) override
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:275
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:48
std::weak_ptr< Expansion3D > Expansion3DWeakPtr
Definition: Expansion2D.h:52
std::shared_ptr< Expansion3D > Expansion3DSharedPtr
Definition: Expansion2D.h:51
std::vector< Expansion2DSharedPtr > Expansion2DVector
Definition: Expansion2D.h:57
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry.h:65
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:353
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:352
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble