Nektar++
Loading...
Searching...
No Matches
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
110 Array<OneD, Array<OneD, NekDouble>> &d0factors,
111 Array<OneD, Array<OneD, NekDouble>> &d1factors) override;
112
113protected:
114 std::vector<bool> m_requireNeg;
115
116 //----------------------------
117 // Differentiation Methods
118 //----------------------------
120 const int dir, const Array<OneD, const NekDouble> &inarray,
121 Array<OneD, NekDouble> &outarray) override;
123 const Array<OneD, const NekDouble> &inarray,
127 const Array<OneD, const NekDouble> &inarray,
128 const Array<OneD, const NekDouble> &direction,
129 Array<OneD, NekDouble> &out) override;
130
132 const Array<OneD, const NekDouble> &inarray,
133 Array<OneD, NekDouble> &outarray) override;
134
135 // Hybridized DG routines
136 void v_DGDeriv(const int dir, const Array<OneD, const NekDouble> &incoeffs,
138 Array<OneD, Array<OneD, NekDouble>> &edgeCoeffs,
139 Array<OneD, NekDouble> &out_d) override;
140
142
143 void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp) override;
144
145 void v_AddEdgeNormBoundaryInt(const int edge,
146 const ExpansionSharedPtr &EdgeExp,
149 Array<OneD, NekDouble> &outarray) override;
150
151 void v_AddEdgeNormBoundaryInt(const int edge,
152 const ExpansionSharedPtr &EdgeExp,
154 Array<OneD, NekDouble> &outarray) override;
155
156 void v_AddRobinMassMatrix(const int edgeid,
157 const Array<OneD, const NekDouble> &primCoeffs,
158 DNekMatSharedPtr &inoutmat) override;
159
161 const int traceid, const Array<OneD, const NekDouble> &primCoeffs,
162 const Array<OneD, NekDouble> &incoeffs,
163 Array<OneD, NekDouble> &coeffs) override;
164
166 const DNekScalMatSharedPtr &r_bnd) override;
167
170 Array<OneD, NekDouble> &out, const int nq0,
171 const int nq1, bool Forwards) override;
172
173 void v_SetUpPhysNormals(const int edge) override;
175 const Array<OneD, Array<OneD, NekDouble>> &vec) override;
176 void v_TraceNormLen(const int traceid, NekDouble &h, NekDouble &p) override;
177
178private:
180 const int edge, ExpansionSharedPtr &EdgeExp,
181 const Array<OneD, const NekDouble> &varcoeff,
182 Array<OneD, NekDouble> &outarray);
183
185 const int dir, const int edge, ExpansionSharedPtr &EdgeExp_e,
186 const Array<OneD, const Array<OneD, NekDouble>> &normals,
187 const StdRegions::VarCoeffMap &varcoeffs);
188};
189
191{
192 return static_cast<SpatialDomains::Geometry2D *>(m_geom);
193}
194} // namespace Nektar::LocalRegions
195
196#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
SpatialDomains::Geometry2D * GetGeom2D() const
std::vector< bool > m_requireNeg
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
void v_ReOrientTracePhysVals(const StdRegions::Orientation orient, const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out, const int nq0, const int nq1, bool Forwards) 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 v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &out) override
Physical derivative along a direction vector.
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)
Array< OneD, unsigned int > GetTraceInverseBoundaryMap(int eid)
void v_NormalTraceDerivFactors(Array< OneD, Array< OneD, NekDouble > > &factors, Array< OneD, Array< OneD, NekDouble > > &d0factors, Array< OneD, Array< OneD, NekDouble > > &d1factors) override
: This method gets all of the factors which are required as part of the Gradient Jump Penalty (GJP) s...
void AddNormTraceInt(const int dir, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &edgeCoeffs, Array< OneD, NekDouble > &outarray)
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_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculates the inner product of a given function f with the different modes of the expansion.
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_PhysDeriv(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculate the derivative of the physical points in a given direction.
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::Geometry * m_geom
Definition Expansion.h:306
2D geometry information
Definition Geometry2D.h:50
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
static VarCoeffMap NullVarCoeffMap
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
static Array< OneD, NekDouble > NullNekDouble1DArray
std::shared_ptr< DNekMat > DNekMatSharedPtr