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
44
46{
47
48class TetExp : virtual public StdRegions::StdTetExp, virtual public Expansion3D
49{
50
51public:
53 const LibUtilities::BasisKey &Bb,
54 const LibUtilities::BasisKey &Bc,
56
58
59 LOCAL_REGIONS_EXPORT ~TetExp() override = default;
60
61protected:
62 //-----------------------------
63 // Integration Methods
64 //-----------------------------
66 v_Integral(const Array<OneD, const NekDouble> &inarray) override;
67
68 //-----------------------------
69 // Differentiation Methods
70 //-----------------------------
72 const Array<OneD, const NekDouble> &inarray,
74 Array<OneD, NekDouble> &out_d2) override;
75
76 //-----------------------------
77 // Transforms
78 //-----------------------------
80 const Array<OneD, const NekDouble> &inarray,
81 Array<OneD, NekDouble> &outarray) override;
82
83 //-----------------------------
84 // Inner product functions
85 //-----------------------------
87 const Array<OneD, const NekDouble> &inarray,
88 Array<OneD, NekDouble> &outarray) override;
90 const Array<OneD, const NekDouble> &inarray,
91 Array<OneD, NekDouble> &outarray,
92 bool multiplybyweights = true) override;
94 const int dir, const Array<OneD, const NekDouble> &inarray,
95 Array<OneD, NekDouble> &outarray) override;
97 const int dir, const Array<OneD, const NekDouble> &inarray,
98 Array<OneD, Array<OneD, NekDouble>> &outarray) override;
99
100 //-----------------------------
101 // Evaluation functions
102 //-----------------------------
105 const Array<OneD, const NekDouble> &physvals) override;
106
109 const Array<OneD, const NekDouble> &physvals) override;
112 const Array<OneD, const NekDouble> &inarray,
113 std::array<NekDouble, 3> &firstOrderDerivs) override;
114
116 const Array<OneD, const NekDouble> &Lcoords,
117 Array<OneD, NekDouble> &coords) override;
118
121 Array<OneD, NekDouble> &coords_3) override;
122
123 //-----------------------------
124 // Helper functions
125 //-----------------------------
127 const override;
128
130 void) const override;
131
133 void) const override;
134
136 const NekDouble *data, const std::vector<unsigned int> &nummodes,
137 const int mode_offset, NekDouble *coeffs,
138 std::vector<LibUtilities::BasisType> &fromType) override;
139
141 const int face, Array<OneD, int> &outarray) override;
142
143 LOCAL_REGIONS_EXPORT void v_ComputeTraceNormal(const int face) override;
144 //-----------------------------
145 // Operator creation functions
146 //-----------------------------
148 const Array<OneD, const NekDouble> &inarray,
149 Array<OneD, NekDouble> &outarray,
150 const StdRegions::StdMatrixKey &mkey) override;
151
153 const Array<OneD, const NekDouble> &inarray,
154 Array<OneD, NekDouble> &outarray,
155 const StdRegions::StdMatrixKey &mkey) override;
156
158 const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
159 Array<OneD, NekDouble> &outarray,
160 const StdRegions::StdMatrixKey &mkey) override;
161
164 const StdRegions::StdMatrixKey &mkey) override;
165
166 //-----------------------------
167 // Matrix creation functions
168 //-----------------------------
170 v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override;
171
173 v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override;
174
176 v_GetLocMatrix(const MatrixKey &mkey) override;
177
178 LOCAL_REGIONS_EXPORT void v_DropLocMatrix(const MatrixKey &mkey) override;
179
181 v_GetLocStaticCondMatrix(const MatrixKey &mkey) override;
182
184 const MatrixKey &mkey) override;
185
187 const DNekMatSharedPtr &m_transformationmatrix,
188 DNekMatSharedPtr m_inversetransformationmatrix,
189 DNekMatSharedPtr m_inversetransposedtransformationmatrix);
190
192
194 Array<OneD, Array<OneD, NekDouble>> &d0factors,
195 Array<OneD, Array<OneD, NekDouble>> &d1factors,
196 Array<OneD, Array<OneD, NekDouble>> &d2factors) override;
197
198private:
203
205 const Array<OneD, const NekDouble> &inarray,
206 Array<OneD, NekDouble> &outarray, const StdRegions::StdMatrixKey &mkey);
208 const Array<OneD, const NekDouble> &inarray,
209 Array<OneD, NekDouble> &outarray, Array<OneD, NekDouble> &wsp) override;
210};
211
212typedef std::shared_ptr<TetExp> TetExpSharedPtr;
213typedef std::vector<TetExpSharedPtr> TetExpVector;
214} // namespace Nektar::LocalRegions
215
216#endif // TETEXP_H
#define LOCAL_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:45
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:1369
void v_ComputeTraceNormal(const int face) override
Compute the normal of a triangular face.
Definition: TetExp.cpp:700
NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals) override
Definition: TetExp.cpp:469
NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray) override
Integrate the physical point list inarray over region.
Definition: TetExp.cpp:102
DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey) override
Definition: TetExp.cpp:1045
NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals) override
Definition: TetExp.cpp:457
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:141
void v_DropLocMatrix(const MatrixKey &mkey) override
Definition: TetExp.cpp:1050
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: TetExp.h:202
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: TetExp.h:200
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition: TetExp.cpp:1012
void SetUpInverseTransformationMatrix(const DNekMatSharedPtr &m_transformationmatrix, DNekMatSharedPtr m_inversetransformationmatrix, DNekMatSharedPtr m_inversetransposedtransformationmatrix)
void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: TetExp.cpp:967
void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
Definition: TetExp.cpp:282
DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey) override
Definition: TetExp.cpp:1055
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:496
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:276
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:223
StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const override
Definition: TetExp.cpp:532
LibUtilities::ShapeType v_DetShapeType() const override
Return Shape of region, using ShapeType enum list.
Definition: TetExp.cpp:527
DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition: TetExp.cpp:1034
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculates the inner product .
Definition: TetExp.cpp:341
StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const override
Definition: TetExp.cpp:539
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:57
~TetExp() override=default
void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
Definition: TetExp.cpp:513
void GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1065
void v_ComputeLaplacianMetric() override
Definition: TetExp.cpp:1166
void v_DropLocStaticCondMatrix(const MatrixKey &mkey) override
Definition: TetExp.cpp:1060
void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey) override
Definition: TetExp.cpp:982
void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
Definition: TetExp.cpp:386
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:612
void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: TetExp.cpp:960
void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp) override
Definition: TetExp.cpp:1088
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:552
std::vector< TetExpSharedPtr > TetExpVector
Definition: TetExp.h:213
std::shared_ptr< TetExp > TetExpSharedPtr
Definition: TetExp.h:212
std::shared_ptr< TetGeom > TetGeomSharedPtr
Definition: TetGeom.h:82
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
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