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 
62 
63 protected:
64  //-----------------------------
65  // Integration Methods
66  //-----------------------------
68  const Array<OneD, const NekDouble> &inarray);
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);
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);
84 
85  //-----------------------------
86  // Inner product functions
87  //-----------------------------
89  const Array<OneD, const NekDouble> &inarray,
90  Array<OneD, NekDouble> &outarray);
92  const Array<OneD, const NekDouble> &inarray,
93  Array<OneD, NekDouble> &outarray, bool multiplybyweights = true);
95  const int dir, const Array<OneD, const NekDouble> &inarray,
96  Array<OneD, NekDouble> &outarray);
98  const int dir, const Array<OneD, const NekDouble> &inarray,
99  Array<OneD, Array<OneD, NekDouble>> &outarray);
100 
101  //-----------------------------
102  // Evaluation functions
103  //-----------------------------
105  const Array<OneD, const NekDouble> &Lcoord,
106  const Array<OneD, const NekDouble> &physvals);
107 
109  const Array<OneD, const NekDouble> &coords,
110  const Array<OneD, const NekDouble> &physvals);
111 
112  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
113  const Array<OneD, const NekDouble> &Lcoords,
114  Array<OneD, NekDouble> &coords);
115 
116  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
117  Array<OneD, NekDouble> &coords_1, Array<OneD, NekDouble> &coords_2,
118  Array<OneD, NekDouble> &coords_3);
119 
120  //-----------------------------
121  // Helper functions
122  //-----------------------------
124 
126  void) const;
127 
129  void) const;
130 
131  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
132 
134  const NekDouble *data, const std::vector<unsigned int> &nummodes,
135  const int mode_offset, NekDouble *coeffs,
136  std::vector<LibUtilities::BasisType> &fromType);
137 
139  const int face, Array<OneD, int> &outarray);
140 
141  LOCAL_REGIONS_EXPORT void v_ComputeTraceNormal(const int face);
142  //-----------------------------
143  // Operator creation functions
144  //-----------------------------
146  const Array<OneD, const NekDouble> &inarray,
147  Array<OneD, NekDouble> &outarray, const StdRegions::StdMatrixKey &mkey);
148 
150  const Array<OneD, const NekDouble> &inarray,
151  Array<OneD, NekDouble> &outarray, const StdRegions::StdMatrixKey &mkey);
152 
154  const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
155  Array<OneD, NekDouble> &outarray, const StdRegions::StdMatrixKey &mkey);
156 
159 
160  //-----------------------------
161  // Matrix creation functions
162  //-----------------------------
164  const StdRegions::StdMatrixKey &mkey);
165 
167  const StdRegions::StdMatrixKey &mkey);
168 
170  const MatrixKey &mkey);
171 
173  const MatrixKey &mkey);
174 
176 
178  const DNekMatSharedPtr &m_transformationmatrix,
179  DNekMatSharedPtr m_inversetransformationmatrix,
180  DNekMatSharedPtr m_inversetransposedtransformationmatrix);
181 
183  const DNekScalMatSharedPtr &mat);
184 
186 
188  Array<OneD, Array<OneD, NekDouble>> &d0factors,
189  Array<OneD, Array<OneD, NekDouble>> &d1factors,
190  Array<OneD, Array<OneD, NekDouble>> &d2factors);
191 
192 private:
197 
199 
201  const Array<OneD, const NekDouble> &inarray,
202  Array<OneD, NekDouble> &outarray, const StdRegions::StdMatrixKey &mkey);
204  const Array<OneD, const NekDouble> &inarray,
206 };
207 
208 typedef std::shared_ptr<TetExp> TetExpSharedPtr;
209 typedef std::vector<TetExpSharedPtr> TetExpVector;
210 } // namespace LocalRegions
211 } // namespace Nektar
212 
213 #endif // TETEXP_H
#define LOCAL_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:50
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Get the coordinates "coords" at the local coordinates "Lcoords".
Definition: TetExp.cpp:497
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Forward transform from physical quadrature space stored in inarray and evaluate the expansion coeffic...
Definition: TetExp.cpp:234
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)
Differentiate inarray in the three coordinate directions.
Definition: TetExp.cpp:152
virtual void v_ComputeLaplacianMetric()
Definition: TetExp.cpp:1169
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: TetExp.cpp:514
void v_ComputeConditionNumberOfMatrix(const DNekScalMatSharedPtr &mat)
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1020
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: TetExp.h:196
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: TetExp.cpp:533
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: TetExp.h:194
virtual void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
Definition: TetExp.cpp:558
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:975
virtual int v_GetCoordim()
Definition: TetExp.cpp:553
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1053
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:968
void SetUpInverseTransformationMatrix(const DNekMatSharedPtr &m_transformationmatrix, DNekMatSharedPtr m_inversetransformationmatrix, DNekMatSharedPtr m_inversetransposedtransformationmatrix)
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrate the physical point list inarray over region.
Definition: TetExp.cpp:113
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1042
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculate the inner product of inarray with respect to the basis B=m_base0*m_base1*m_base2 and put in...
Definition: TetExp.cpp:287
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: TetExp.cpp:468
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const
Definition: TetExp.cpp:540
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: TetExp.cpp:293
void v_ComputeTraceNormal(const int face)
Compute the normal of a triangular face.
Definition: TetExp.cpp:708
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:990
virtual LibUtilities::ShapeType v_DetShapeType() const
Return Shape of region, using ShapeType enum list.
Definition: TetExp.cpp:528
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1058
void GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1068
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the inner product .
Definition: TetExp.cpp:352
virtual void v_GetTracePhysMap(const int face, Array< OneD, int > &outarray)
Returns the physical values at the quadrature points of a face.
Definition: TetExp.cpp:620
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1063
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
Definition: TetExp.cpp:480
virtual void v_NormalTraceDerivFactors(Array< OneD, Array< OneD, NekDouble >> &d0factors, Array< OneD, Array< OneD, NekDouble >> &d1factors, Array< OneD, Array< OneD, NekDouble >> &d2factors)
: This method gets all of the factors which are required as part of the Gradient Jump Penalty stabili...
Definition: TetExp.cpp:1372
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
Definition: TetExp.cpp:1091
virtual void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: TetExp.cpp:397
std::vector< TetExpSharedPtr > TetExpVector
Definition: TetExp.h:209
std::shared_ptr< TetExp > TetExpSharedPtr
Definition: TetExp.h:208
std::shared_ptr< TetGeom > TetGeomSharedPtr
Definition: TetGeom.h:84
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
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