Nektar++
TetExp.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: TetExp.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:
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef TETEXP_H
36 #define TETEXP_H
37 
41 #include <LocalRegions/MatrixKey.h>
42 #include <SpatialDomains/TetGeom.h>
43 #include <StdRegions/StdTetExp.h>
44 
45 namespace Nektar
46 {
47 namespace LocalRegions
48 {
49 
50 class TetExp : virtual public StdRegions::StdTetExp, virtual public Expansion3D
51 {
52 
53 public:
55  const LibUtilities::BasisKey &Bb,
56  const LibUtilities::BasisKey &Bc,
58 
60 
61  LOCAL_REGIONS_EXPORT virtual ~TetExp() override = default;
62 
63 protected:
64  //-----------------------------
65  // Integration Methods
66  //-----------------------------
68  const Array<OneD, const NekDouble> &inarray) override;
69 
70  //-----------------------------
71  // Differentiation Methods
72  //-----------------------------
73  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
74  const Array<OneD, const NekDouble> &inarray,
76  Array<OneD, NekDouble> &out_d2) override;
77 
78  //-----------------------------
79  // Transforms
80  //-----------------------------
81  LOCAL_REGIONS_EXPORT virtual void v_FwdTrans(
82  const Array<OneD, const NekDouble> &inarray,
83  Array<OneD, NekDouble> &outarray) override;
84 
85  //-----------------------------
86  // Inner product functions
87  //-----------------------------
89  const Array<OneD, const NekDouble> &inarray,
90  Array<OneD, NekDouble> &outarray) override;
92  const Array<OneD, const NekDouble> &inarray,
93  Array<OneD, NekDouble> &outarray,
94  bool multiplybyweights = true) override;
96  const int dir, const Array<OneD, const NekDouble> &inarray,
97  Array<OneD, NekDouble> &outarray) override;
99  const int dir, const Array<OneD, const NekDouble> &inarray,
100  Array<OneD, Array<OneD, NekDouble>> &outarray) override;
101 
102  //-----------------------------
103  // Evaluation functions
104  //-----------------------------
106  const Array<OneD, const NekDouble> &Lcoord,
107  const Array<OneD, const NekDouble> &physvals) override;
108 
110  const Array<OneD, const NekDouble> &coords,
111  const Array<OneD, const NekDouble> &physvals) override;
113  const Array<OneD, NekDouble> &coord,
114  const Array<OneD, const NekDouble> &inarray,
115  std::array<NekDouble, 3> &firstOrderDerivs) override;
116 
117  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
118  const Array<OneD, const NekDouble> &Lcoords,
119  Array<OneD, NekDouble> &coords) override;
120 
121  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
122  Array<OneD, NekDouble> &coords_1, Array<OneD, NekDouble> &coords_2,
123  Array<OneD, NekDouble> &coords_3) override;
124 
125  //-----------------------------
126  // Helper functions
127  //-----------------------------
129  const override;
130 
132  void) const override;
133 
135  void) const override;
136 
138  const NekDouble *data, const std::vector<unsigned int> &nummodes,
139  const int mode_offset, NekDouble *coeffs,
140  std::vector<LibUtilities::BasisType> &fromType) override;
141 
143  const int face, Array<OneD, int> &outarray) override;
144 
145  LOCAL_REGIONS_EXPORT void v_ComputeTraceNormal(const int face) override;
146  //-----------------------------
147  // Operator creation functions
148  //-----------------------------
150  const Array<OneD, const NekDouble> &inarray,
151  Array<OneD, NekDouble> &outarray,
152  const StdRegions::StdMatrixKey &mkey) override;
153 
155  const Array<OneD, const NekDouble> &inarray,
156  Array<OneD, NekDouble> &outarray,
157  const StdRegions::StdMatrixKey &mkey) override;
158 
160  const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
161  Array<OneD, NekDouble> &outarray,
162  const StdRegions::StdMatrixKey &mkey) override;
163 
165  Array<OneD, NekDouble> &array,
166  const StdRegions::StdMatrixKey &mkey) override;
167 
168  //-----------------------------
169  // Matrix creation functions
170  //-----------------------------
172  const StdRegions::StdMatrixKey &mkey) override;
173 
175  const StdRegions::StdMatrixKey &mkey) override;
176 
178  const MatrixKey &mkey) override;
179 
180  LOCAL_REGIONS_EXPORT void v_DropLocMatrix(const MatrixKey &mkey) override;
181 
183  const MatrixKey &mkey) override;
184 
186  const MatrixKey &mkey) override;
187 
189  const DNekMatSharedPtr &m_transformationmatrix,
190  DNekMatSharedPtr m_inversetransformationmatrix,
191  DNekMatSharedPtr m_inversetransposedtransformationmatrix);
192 
193  LOCAL_REGIONS_EXPORT virtual void v_ComputeLaplacianMetric() override;
194 
196  Array<OneD, Array<OneD, NekDouble>> &d0factors,
197  Array<OneD, Array<OneD, NekDouble>> &d1factors,
198  Array<OneD, Array<OneD, NekDouble>> &d2factors) override;
199 
200 private:
205 
207  const Array<OneD, const NekDouble> &inarray,
208  Array<OneD, NekDouble> &outarray, const StdRegions::StdMatrixKey &mkey);
210  const Array<OneD, const NekDouble> &inarray,
211  Array<OneD, NekDouble> &outarray, Array<OneD, NekDouble> &wsp) override;
212 };
213 
214 typedef std::shared_ptr<TetExp> TetExpSharedPtr;
215 typedef std::vector<TetExpSharedPtr> TetExpVector;
216 } // namespace LocalRegions
217 } // namespace Nektar
218 
219 #endif // TETEXP_H
#define LOCAL_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:50
void v_ComputeTraceNormal(const int face) override
Compute the normal of a triangular face.
Definition: TetExp.cpp:706
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals) override
Definition: TetExp.cpp:473
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray) override
Integrate the physical point list inarray over region.
Definition: TetExp.cpp:106
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey) override
Definition: TetExp.cpp:1051
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals) override
Definition: TetExp.cpp:461
virtual 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
Differentiate inarray in the three coordinate directions.
Definition: TetExp.cpp:145
void v_DropLocMatrix(const MatrixKey &mkey) override
Definition: TetExp.cpp:1056
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: TetExp.h:204
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: TetExp.h:202
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition: TetExp.cpp:1018
void SetUpInverseTransformationMatrix(const DNekMatSharedPtr &m_transformationmatrix, DNekMatSharedPtr m_inversetransformationmatrix, DNekMatSharedPtr m_inversetransposedtransformationmatrix)
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: TetExp.cpp:973
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
Definition: TetExp.cpp:286
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey) override
Definition: TetExp.cpp:1061
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords) override
Get the coordinates "coords" at the local coordinates "Lcoords".
Definition: TetExp.cpp:500
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculate the inner product of inarray with respect to the basis B=m_base0*m_base1*m_base2 and put in...
Definition: TetExp.cpp:280
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Forward transform from physical quadrature space stored in inarray and evaluate the expansion coeffic...
Definition: TetExp.cpp:227
virtual ~TetExp() override=default
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const override
Definition: TetExp.cpp:536
virtual LibUtilities::ShapeType v_DetShapeType() const override
Return Shape of region, using ShapeType enum list.
Definition: TetExp.cpp:531
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition: TetExp.cpp:1040
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculates the inner product .
Definition: TetExp.cpp:345
virtual 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...
Definition: TetExp.cpp:1375
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const override
Definition: TetExp.cpp:543
TetExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, const SpatialDomains::TetGeomSharedPtr &geom)
Constructor using BasisKey class for quadrature points and order definition.
Definition: TetExp.cpp:61
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
Definition: TetExp.cpp:517
void GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1071
virtual void v_ComputeLaplacianMetric() override
Definition: TetExp.cpp:1172
void v_DropLocStaticCondMatrix(const MatrixKey &mkey) override
Definition: TetExp.cpp:1066
virtual void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray) override
Definition: TetExp.cpp:390
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey) override
Definition: TetExp.cpp:988
virtual void v_GetTracePhysMap(const int face, Array< OneD, int > &outarray) override
Returns the physical values at the quadrature points of a face.
Definition: TetExp.cpp:618
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: TetExp.cpp:966
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp) override
Definition: TetExp.cpp:1094
virtual void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType) override
Definition: TetExp.cpp:556
std::vector< TetExpSharedPtr > TetExpVector
Definition: TetExp.h:215
std::shared_ptr< TetExp > TetExpSharedPtr
Definition: TetExp.h:214
std::shared_ptr< TetGeom > TetGeomSharedPtr
Definition: TetGeom.h:85
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:79
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble