Nektar++
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:
61 {
62 }
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, Array<OneD, int> &idmap,
94 const int nq0, const int nq1) override;
95
97 const Array<OneD, const Array<OneD, NekDouble>> &Fvec,
98 Array<OneD, NekDouble> &outarray) override;
99
101 int eid);
102
104 int fid,
106 int P1 = -1, int P2 = -1);
107
112
114 CreateMatrix(const MatrixKey &mkey);
115
116protected:
117 std::map<int, NormalVector> m_faceNormals;
118 void v_DGDeriv(const int dir, const Array<OneD, const NekDouble> &incoeffs,
120 Array<OneD, Array<OneD, NekDouble>> &faceCoeffs,
121 Array<OneD, NekDouble> &out_d) override;
123 void v_AddFaceNormBoundaryInt(const int face,
124 const ExpansionSharedPtr &FaceExp,
126 Array<OneD, NekDouble> &outarray) override;
127
128 void v_AddRobinMassMatrix(const int face,
129 const Array<OneD, const NekDouble> &primCoeffs,
130 DNekMatSharedPtr &inoutmat) override;
131
132 StdRegions::Orientation v_GetTraceOrient(int face) override;
133
134 void v_GetTracePhysVals(const int face,
136 const Array<OneD, const NekDouble> &inarray,
137 Array<OneD, NekDouble> &outarray,
138 StdRegions::Orientation orient) override;
139
140 void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp) override;
141
143 const int face, ExpansionSharedPtr &FaceExp,
144 const Array<OneD, const NekDouble> &varcoeff,
145 Array<OneD, NekDouble> &outarray);
146
147 //-----------------------------
148 // Low Energy Basis functions
149 //-----------------------------
150
152 const DNekScalMatSharedPtr &r_bnd,
153 const StdRegions::MatrixType matrixType) override;
154
156 const DNekScalMatSharedPtr &transformationmatrix) override;
157
159 v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd) override;
160
161 LOCAL_REGIONS_EXPORT void v_TraceNormLen(const int traceid, NekDouble &h,
162 NekDouble &p) override;
163
164private:
165 // Do not add members here since it may lead to conflicts.
166 // Only use this class for member functions
167
168 std::vector<bool> m_requireNeg;
169
171 const int dir, const int face, ExpansionSharedPtr &FaceExp_f,
172 const Array<OneD, const Array<OneD, NekDouble>> &normals,
173 const StdRegions::VarCoeffMap &varcoeffs);
174};
175
177{
178 return std::dynamic_pointer_cast<SpatialDomains::Geometry3D>(m_geom);
179}
180} // namespace Nektar::LocalRegions
181
182#endif
#define LOCAL_REGIONS_EXPORT
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
Expansion3D(SpatialDomains::Geometry3DSharedPtr pGeom)
Definition: Expansion3D.h:59
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
Definition: Expansion3D.h:168
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)
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
void v_ReOrientTracePhysMap(const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1) override
void v_NormVectorIProductWRTBase(const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray) override
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap(int eid)
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
std::map< int, NormalVector > m_faceNormals
Definition: Expansion3D.h:117
SpatialDomains::Geometry3DSharedPtr GetGeom3D() const
Definition: Expansion3D.h:176
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 AddHDGHelmholtzFaceTerms(const NekDouble tau, const int edge, Array< OneD, NekDouble > &facePhys, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
Definition: Expansion3D.cpp:50
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 local face orien...
void SetFaceToGeomOrientation(const int face, Array< OneD, NekDouble > &inout)
Align face orientation with the geometry orientation.
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< Expansion3DSharedPtr > Expansion3DVector
Definition: Expansion3D.h:53
std::shared_ptr< Geometry3D > Geometry3DSharedPtr
Definition: Geometry3D.h:50
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:376
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:375
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble