Nektar++
Loading...
Searching...
No Matches
Expansion3D.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: Expansion3D.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 Expansion3D routines
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef EXPANSION3D_H
36#define EXPANSION3D_H
37
42
44{
45
46class Expansion2D;
47typedef std::shared_ptr<Expansion2D> Expansion2DSharedPtr;
48typedef std::weak_ptr<Expansion2D> Expansion2DWeakPtr;
49
50class Expansion3D;
51typedef std::shared_ptr<Expansion3D> Expansion3DSharedPtr;
52typedef std::weak_ptr<Expansion3D> Expansion3DWeakPtr;
53typedef std::vector<Expansion3DSharedPtr> Expansion3DVector;
54
55class Expansion3D : virtual public Expansion,
56 virtual public StdRegions::StdExpansion3D
57{
58public:
63 LOCAL_REGIONS_EXPORT ~Expansion3D() override = default;
64
68 const int face, Array<OneD, NekDouble> &inout);
69 inline void AddHDGHelmholtzFaceTerms(
70 const NekDouble tau, const int edge, Array<OneD, NekDouble> &facePhys,
71 const StdRegions::VarCoeffMap &dirForcing,
72 Array<OneD, NekDouble> &outarray);
73
74 inline void AddNormTraceInt(const int dir,
76 Array<OneD, Array<OneD, NekDouble>> &faceCoeffs,
77 Array<OneD, NekDouble> &outarray);
78
79 inline void AddNormTraceInt(const int dir,
82 Array<OneD, NekDouble> &outarray,
83 const StdRegions::VarCoeffMap &varcoeffs);
84
85 inline void AddFaceBoundaryInt(
86 const int face, ExpansionSharedPtr &FaceExp,
89
91
93 const StdRegions::Orientation orient,
95 const int nq0, const int nq1, bool Forwards) override;
96
98 const Array<OneD, const Array<OneD, NekDouble>> &Fvec,
99 Array<OneD, NekDouble> &outarray) override;
100
102 int eid);
103
105 int fid,
107 int P1 = -1, int P2 = -1);
108
113
115 CreateMatrix(const MatrixKey &mkey);
116
117 inline void GetTracePhysVals(
118 const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp,
119 const Array<OneD, const NekDouble> &inarray,
120 Array<OneD, NekDouble> &outarray,
122 {
123 v_GetTracePhysVals(trace, TraceExp, inarray, outarray, orient);
124 }
125
127 const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp,
128 const Array<OneD, const NekDouble> &inarray,
129 Array<OneD, NekDouble> &outarray)
130 {
131 v_GetLocTracePhysVals(trace, TraceExp, inarray.data(), outarray);
132 }
133
134protected:
135 std::map<int, NormalVector> m_faceNormals;
136 void v_DGDeriv(const int dir, const Array<OneD, const NekDouble> &incoeffs,
138 Array<OneD, Array<OneD, NekDouble>> &faceCoeffs,
139 Array<OneD, NekDouble> &out_d) override;
140 //-----------------------------
141 // Differentiation Methods
142 //-----------------------------
144 const Array<OneD, const NekDouble> &inarray,
146 Array<OneD, NekDouble> &out_d2) override;
147 using StdExpansion3D::v_PhysDeriv;
149 const Array<OneD, const NekDouble> &inarray,
150 const Array<OneD, const NekDouble> &direction,
151 Array<OneD, NekDouble> &out) override;
152
154 const Array<OneD, const NekDouble> &inarray,
155 Array<OneD, NekDouble> &outarray) override;
156
158 void v_AddFaceNormBoundaryInt(const int face,
159 const ExpansionSharedPtr &FaceExp,
161 Array<OneD, NekDouble> &outarray) override;
162
163 void v_AddRobinMassMatrix(const int face,
164 const Array<OneD, const NekDouble> &primCoeffs,
165 DNekMatSharedPtr &inoutmat) override;
166
167 StdRegions::Orientation v_GetTraceOrient(int face) override;
168
169 void v_GetTracePhysVals(const int face,
171 const Array<OneD, const NekDouble> &inarray,
172 Array<OneD, NekDouble> &outarray,
173 StdRegions::Orientation orient) override;
174
175 void v_GetLocTracePhysVals(const int face,
177 const NekDouble *inarray,
178 Array<OneD, NekDouble> &outarray) override;
179
180 void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp) override;
181
183 const int face, ExpansionSharedPtr &FaceExp,
184 const Array<OneD, const NekDouble> &varcoeff,
185 Array<OneD, NekDouble> &outarray);
186
187 //-----------------------------
188 // Low Energy Basis functions
189 //-----------------------------
190
192 const DNekScalMatSharedPtr &r_bnd,
193 const StdRegions::MatrixType matrixType) override;
194
196 const DNekScalMatSharedPtr &transformationmatrix) override;
197
199 v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd) override;
200
201 LOCAL_REGIONS_EXPORT void v_TraceNormLen(const int traceid, NekDouble &h,
202 NekDouble &p) override;
203
205 Array<OneD, Array<OneD, NekDouble>> &d0factors,
206 Array<OneD, Array<OneD, NekDouble>> &d1factors,
207 Array<OneD, Array<OneD, NekDouble>> &d2factors) override;
208
209private:
210 // Do not add members here since it may lead to conflicts.
211 // Only use this class for member functions
212
213 std::vector<bool> m_requireNeg;
214
216 const int dir, const int face, ExpansionSharedPtr &FaceExp_f,
217 const Array<OneD, const Array<OneD, NekDouble>> &normals,
218 const StdRegions::VarCoeffMap &varcoeffs);
219};
220
222{
223 return static_cast<SpatialDomains::Geometry3D *>(m_geom);
224}
225} // namespace Nektar::LocalRegions
226
227#endif
#define LOCAL_REGIONS_EXPORT
void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculate the inner product of inarray with respect to the elements basis.
DNekMatSharedPtr v_BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType) override
void v_AddRobinMassMatrix(const int face, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat) override
void SetTraceToGeomOrientation(Array< OneD, NekDouble > &inout)
Align trace orientation with the geometry orientation.
void v_DGDeriv(const int dir, const Array< OneD, const NekDouble > &incoeffs, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, Array< OneD, NekDouble > > &faceCoeffs, Array< OneD, NekDouble > &out_d) override
Evaluate coefficients of weak deriviative in the direction dir given the input coefficicents incoeffs...
StdRegions::Orientation v_GetTraceOrient(int face) override
void AddNormTraceInt(const int dir, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, Array< OneD, NekDouble > > &faceCoeffs, Array< OneD, NekDouble > &outarray)
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Array< OneD, unsigned int > GetTraceInverseBoundaryMap(int fid, StdRegions::Orientation faceOrient=StdRegions::eNoOrientation, int P1=-1, int P2=-1)
std::vector< bool > m_requireNeg
void GetInverseBoundaryMaps(Array< OneD, unsigned int > &vmap, Array< OneD, Array< OneD, unsigned int > > &emap, Array< OneD, Array< OneD, unsigned int > > &fmap)
Array< OneD, NekDouble > GetnFacecdotMF(const int dir, const int face, ExpansionSharedPtr &FaceExp_f, const Array< OneD, const Array< OneD, NekDouble > > &normals, const StdRegions::VarCoeffMap &varcoeffs)
void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2) override
Calculate the derivative of the physical points.
void v_GetLocTracePhysVals(const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const NekDouble *inarray, Array< OneD, NekDouble > &outarray) override
Extract the physical values along face face from inarray into outarray following the local elemental ...
DNekMatSharedPtr v_BuildInverseTransformationMatrix(const DNekScalMatSharedPtr &transformationmatrix) override
Build inverse and inverse transposed transformation matrix: and .
void AddFaceBoundaryInt(const int face, ExpansionSharedPtr &FaceExp, Array< OneD, NekDouble > &facePhys, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
void GetPhysFaceVarCoeffsFromElement(const int face, ExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &varcoeff, Array< OneD, NekDouble > &outarray)
void v_TraceNormLen(const int traceid, NekDouble &h, NekDouble &p) override
SpatialDomains::Geometry3D * GetGeom3D() const
void v_NormVectorIProductWRTBase(const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray) override
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap(int eid)
void GetLocTracePhysVals(const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
std::map< int, NormalVector > m_faceNormals
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 v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp) override
void v_AddFaceNormBoundaryInt(const int face, const ExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray) override
void v_NormalTraceDerivFactors(Array< OneD, Array< OneD, NekDouble > > &d0factors, Array< OneD, Array< OneD, NekDouble > > &d1factors, Array< OneD, Array< OneD, NekDouble > > &d2factors) override
: This method gets all of the factors which are required as part of the Gradient Jump Penalty stabili...
void AddHDGHelmholtzFaceTerms(const NekDouble tau, const int edge, Array< OneD, NekDouble > &facePhys, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd) override
void v_GetTracePhysVals(const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient) override
Extract the physical values along face face from inarray into outarray following the face orientation...
void SetFaceToGeomOrientation(const int face, Array< OneD, NekDouble > &inout)
Align face orientation with the geometry orientation.
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
void GetTracePhysVals(const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=StdRegions::eNoOrientation)
Expansion3D(SpatialDomains::Geometry3D *pGeom)
Definition Expansion3D.h:59
SpatialDomains::Geometry * m_geom
Definition Expansion.h:306
3D geometry information
Definition Geometry3D.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< Expansion3DSharedPtr > Expansion3DVector
Definition Expansion3D.h:53
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
static VarCoeffMap NullVarCoeffMap
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekMat > DNekMatSharedPtr