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
43
45{
46class Expansion3D;
47typedef std::shared_ptr<Expansion3D> Expansion3DSharedPtr;
48typedef std::weak_ptr<Expansion3D> Expansion3DWeakPtr;
49
50class Expansion2D;
51typedef std::shared_ptr<Expansion2D> Expansion2DSharedPtr;
52typedef std::weak_ptr<Expansion2D> Expansion2DWeakPtr;
53typedef std::vector<Expansion2DSharedPtr> Expansion2DVector;
54
55class Expansion2D : virtual public Expansion,
56 virtual public StdRegions::StdExpansion2D
57{
58public:
60
61 LOCAL_REGIONS_EXPORT ~Expansion2D() override = default;
62
64 CreateMatrix(const MatrixKey &mkey);
65
69
71 int eid);
72
73 inline void AddNormTraceInt(const int dir,
75 Array<OneD, Array<OneD, NekDouble>> &edgeCoeffs,
76 Array<OneD, NekDouble> &outarray);
77
78 inline void AddNormTraceInt(const int dir,
81 Array<OneD, NekDouble> &outarray,
82 const StdRegions::VarCoeffMap &varcoeffs);
83
84 inline void AddEdgeBoundaryInt(
85 const int edge, ExpansionSharedPtr &EdgeExp,
88
89 inline void AddHDGHelmholtzEdgeTerms(
90 const NekDouble tau, const int edge,
92 Array<OneD, NekDouble> &edgePhys,
93 const StdRegions::VarCoeffMap &dirForcing,
94 Array<OneD, NekDouble> &outarray);
95
96 inline void AddHDGHelmholtzTraceTerms(
97 const NekDouble tau, const Array<OneD, const NekDouble> &inarray,
99 const StdRegions::VarCoeffMap &dirForcing,
100 Array<OneD, NekDouble> &outarray);
101
103
105 const int nvert, const StdRegions::Orientation orient, const int nq0,
106 Array<OneD, int> &idmap);
107
109 void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp) override;
110
111protected:
112 std::vector<bool> m_requireNeg;
113
114 // Hybridized DG routines
115 void v_DGDeriv(const int dir, const Array<OneD, const NekDouble> &incoeffs,
117 Array<OneD, Array<OneD, NekDouble>> &edgeCoeffs,
118 Array<OneD, NekDouble> &out_d) override;
119
120 void v_AddEdgeNormBoundaryInt(const int edge,
121 const ExpansionSharedPtr &EdgeExp,
124 Array<OneD, NekDouble> &outarray) override;
125
126 void v_AddEdgeNormBoundaryInt(const int edge,
127 const ExpansionSharedPtr &EdgeExp,
129 Array<OneD, NekDouble> &outarray) override;
130
131 void v_AddRobinMassMatrix(const int edgeid,
132 const Array<OneD, const NekDouble> &primCoeffs,
133 DNekMatSharedPtr &inoutmat) override;
134
136 const int traceid, const Array<OneD, const NekDouble> &primCoeffs,
137 const Array<OneD, NekDouble> &incoeffs,
138 Array<OneD, NekDouble> &coeffs) override;
139
141 const DNekScalMatSharedPtr &r_bnd) override;
142
144 Array<OneD, int> &idmap, const int nq0,
145 const int nq1) override;
146
147 void v_SetUpPhysNormals(const int edge) override;
149 const Array<OneD, Array<OneD, NekDouble>> &vec) override;
150 void v_TraceNormLen(const int traceid, NekDouble &h, NekDouble &p) override;
151
152private:
154 const int edge, ExpansionSharedPtr &EdgeExp,
155 const Array<OneD, const NekDouble> &varcoeff,
156 Array<OneD, NekDouble> &outarray);
157
159 const int dir, const int edge, ExpansionSharedPtr &EdgeExp_e,
160 const Array<OneD, const Array<OneD, NekDouble>> &normals,
161 const StdRegions::VarCoeffMap &varcoeffs);
162};
163
165{
166 return std::dynamic_pointer_cast<SpatialDomains::Geometry2D>(m_geom);
167}
168} // namespace Nektar::LocalRegions
169
170#endif
#define LOCAL_REGIONS_EXPORT
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
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
std::vector< bool > m_requireNeg
Definition: Expansion2D.h:112
void v_AddRobinTraceContribution(const int traceid, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs) override
void v_SetUpPhysNormals(const int edge) override
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)
DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd) override
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:55
Array< OneD, unsigned int > GetTraceInverseBoundaryMap(int eid)
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:50
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:164
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 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
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)
void AddHDGHelmholtzTraceTerms(const NekDouble tau, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp) override
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:273
std::weak_ptr< Expansion2D > Expansion2DWeakPtr
Definition: Expansion1D.h:47
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:66
std::shared_ptr< Expansion2D > Expansion2DSharedPtr
Definition: Expansion1D.h:46
std::weak_ptr< Expansion3D > Expansion3DWeakPtr
Definition: Expansion2D.h:48
std::shared_ptr< Expansion3D > Expansion3DSharedPtr
Definition: Expansion2D.h:47
std::vector< Expansion2DSharedPtr > Expansion2DVector
Definition: Expansion2D.h:53
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry.h:62
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:347
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:346
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble