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
43namespace Nektar
44{
45namespace LocalRegions
46{
47
48class Expansion2D;
49typedef std::shared_ptr<Expansion2D> Expansion2DSharedPtr;
50typedef std::weak_ptr<Expansion2D> Expansion2DWeakPtr;
51
52class Expansion3D;
53typedef std::shared_ptr<Expansion3D> Expansion3DSharedPtr;
54typedef std::weak_ptr<Expansion3D> Expansion3DWeakPtr;
55typedef std::vector<Expansion3DSharedPtr> Expansion3DVector;
56
57class Expansion3D : virtual public Expansion,
58 virtual public StdRegions::StdExpansion3D
59{
60public:
63 {
64 }
65 LOCAL_REGIONS_EXPORT virtual ~Expansion3D() override = default;
66
70 const int face, Array<OneD, NekDouble> &inout);
71 inline void AddHDGHelmholtzFaceTerms(
72 const NekDouble tau, const int edge, Array<OneD, NekDouble> &facePhys,
73 const StdRegions::VarCoeffMap &dirForcing,
74 Array<OneD, NekDouble> &outarray);
75
76 inline void AddNormTraceInt(const int dir,
78 Array<OneD, Array<OneD, NekDouble>> &faceCoeffs,
79 Array<OneD, NekDouble> &outarray);
80
81 inline void AddNormTraceInt(const int dir,
84 Array<OneD, NekDouble> &outarray,
85 const StdRegions::VarCoeffMap &varcoeffs);
86
87 inline void AddFaceBoundaryInt(
88 const int face, ExpansionSharedPtr &FaceExp,
91
93
95 const StdRegions::Orientation orient, Array<OneD, int> &idmap,
96 const int nq0, const int nq1) override;
97
99 const Array<OneD, const Array<OneD, NekDouble>> &Fvec,
100 Array<OneD, NekDouble> &outarray) override;
101
103 int eid);
104
106 int fid,
108 int P1 = -1, int P2 = -1);
109
114
116 CreateMatrix(const MatrixKey &mkey);
117
118protected:
119 std::map<int, NormalVector> m_faceNormals;
120 virtual void v_DGDeriv(const int dir,
121 const Array<OneD, const NekDouble> &incoeffs,
123 Array<OneD, Array<OneD, NekDouble>> &faceCoeffs,
124 Array<OneD, NekDouble> &out_d) override;
126 const StdRegions::StdMatrixKey &mkey) override;
127 virtual void v_AddFaceNormBoundaryInt(
128 const int face, const ExpansionSharedPtr &FaceExp,
130 Array<OneD, NekDouble> &outarray) override;
131
132 virtual void v_AddRobinMassMatrix(
133 const int face, const Array<OneD, const NekDouble> &primCoeffs,
134 DNekMatSharedPtr &inoutmat) override;
135
136 virtual StdRegions::Orientation v_GetTraceOrient(int face) override;
137
138 virtual void v_GetTracePhysVals(
139 const int face, const StdRegions::StdExpansionSharedPtr &FaceExp,
140 const Array<OneD, const NekDouble> &inarray,
141 Array<OneD, NekDouble> &outarray,
142 StdRegions::Orientation orient) override;
143
144 virtual void v_GenTraceExp(const int traceid,
145 ExpansionSharedPtr &exp) override;
146
148 const int face, ExpansionSharedPtr &FaceExp,
149 const Array<OneD, const NekDouble> &varcoeff,
150 Array<OneD, NekDouble> &outarray);
151
152 //-----------------------------
153 // Low Energy Basis functions
154 //-----------------------------
155
157 const DNekScalMatSharedPtr &r_bnd,
158 const StdRegions::MatrixType matrixType) override;
159
161 const DNekScalMatSharedPtr &transformationmatrix) override;
162
164 const DNekScalMatSharedPtr &r_bnd) override;
165
166 LOCAL_REGIONS_EXPORT virtual void v_TraceNormLen(const int traceid,
167 NekDouble &h,
168 NekDouble &p) override;
169
170private:
171 // Do not add members here since it may lead to conflicts.
172 // Only use this class for member functions
173
174 std::vector<bool> m_requireNeg;
175
177 const int dir, const int face, ExpansionSharedPtr &FaceExp_f,
178 const Array<OneD, const Array<OneD, NekDouble>> &normals,
179 const StdRegions::VarCoeffMap &varcoeffs);
180};
181
183{
184 return std::dynamic_pointer_cast<SpatialDomains::Geometry3D>(m_geom);
185}
186} // namespace LocalRegions
187} // namespace Nektar
188
189#endif
#define LOCAL_REGIONS_EXPORT
virtual DNekMatSharedPtr v_BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType) override
virtual void v_AddRobinMassMatrix(const int face, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat) override
Expansion3D(SpatialDomains::Geometry3DSharedPtr pGeom)
Definition: Expansion3D.h:61
void SetTraceToGeomOrientation(Array< OneD, NekDouble > &inout)
Align trace orientation with the geometry orientation.
virtual 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...
virtual 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)
virtual ~Expansion3D() override=default
std::vector< bool > m_requireNeg
Definition: Expansion3D.h:174
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)
virtual 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)
virtual 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)
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
std::map< int, NormalVector > m_faceNormals
Definition: Expansion3D.h:119
SpatialDomains::Geometry3DSharedPtr GetGeom3D() const
Definition: Expansion3D.h:182
virtual void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp) override
virtual 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:54
virtual DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd) override
virtual 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: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< Expansion3DSharedPtr > Expansion3DVector
Definition: Expansion3D.h:55
std::shared_ptr< Geometry3D > Geometry3DSharedPtr
Definition: Geometry3D.h:53
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
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