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 
38 #include <StdRegions/StdTetExp.h>
39 #include <SpatialDomains/TetGeom.h>
40 #include <LocalRegions/MatrixKey.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 
59  LOCAL_REGIONS_EXPORT TetExp(const TetExp &T);
60 
61 
63 
64  protected:
65  //-----------------------------
66  // Integration Methods
67  //-----------------------------
68  LOCAL_REGIONS_EXPORT virtual
70 
71 
72  //-----------------------------
73  // Differentiation Methods
74  //-----------------------------
75  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
76  const Array<OneD, const NekDouble> &inarray,
77  Array<OneD, NekDouble> &out_d0,
78  Array<OneD, NekDouble> &out_d1,
79  Array<OneD, NekDouble> &out_d2);
80 
81  //-----------------------------
82  // Transforms
83  //-----------------------------
84  LOCAL_REGIONS_EXPORT virtual void v_FwdTrans(
85  const Array<OneD, const NekDouble> & inarray,
86  Array<OneD,NekDouble> &outarray);
87 
88  //-----------------------------
89  // Inner product functions
90  //-----------------------------
92  const Array<OneD, const NekDouble>& inarray,
93  Array<OneD, NekDouble>& outarray);
95  const Array<OneD, const NekDouble>& inarray,
96  Array<OneD, NekDouble>& outarray,
97  bool multiplybyweights = true);
99  const int dir,
100  const Array<OneD, const NekDouble>& inarray,
101  Array<OneD, NekDouble>& outarray);
102 
103 
104  //-----------------------------
105  // Evaluation functions
106  //-----------------------------
108  const Array<OneD, const NekDouble> &Lcoord,
109  const Array<OneD, const NekDouble> &physvals);
110 
112  const Array<OneD, const NekDouble> &coords,
113  const Array<OneD, const NekDouble> & physvals);
114 
115  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
116  const Array<OneD, const NekDouble> &Lcoords,
117  Array<OneD,NekDouble> &coords);
118 
119  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
120  Array<OneD, NekDouble> &coords_1,
121  Array<OneD, NekDouble> &coords_2,
122  Array<OneD, NekDouble> &coords_3);
123 
124  //-----------------------------
125  // Helper functions
126  //-----------------------------
127  LOCAL_REGIONS_EXPORT virtual
129 
130  LOCAL_REGIONS_EXPORT virtual
132 
133  LOCAL_REGIONS_EXPORT virtual
135 
136  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
137 
139  const NekDouble *data,
140  const std::vector<unsigned int> &nummodes,
141  const int mode_offset,
142  NekDouble *coeffs,
143  std::vector<LibUtilities::BasisType> &fromType);
144 
145 
147  const int face,
148  Array<OneD, int> &outarray);
149 
150  LOCAL_REGIONS_EXPORT void v_ComputeFaceNormal(const int face);
151  //-----------------------------
152  // Operator creation functions
153  //-----------------------------
155  const Array<OneD, const NekDouble> &inarray,
156  Array<OneD,NekDouble> &outarray,
157  const StdRegions::StdMatrixKey &mkey);
158 
160  const Array<OneD, const NekDouble> &inarray,
161  Array<OneD,NekDouble> &outarray,
162  const StdRegions::StdMatrixKey &mkey);
163 
165  const int k1,
166  const int k2,
167  const Array<OneD, const NekDouble> &inarray,
168  Array<OneD,NekDouble> &outarray,
169  const StdRegions::StdMatrixKey &mkey);
170 
172  Array<OneD, NekDouble> &array,
173  const StdRegions::StdMatrixKey &mkey);
174 
175  //-----------------------------
176  // Matrix creation functions
177  //-----------------------------
179  const StdRegions::StdMatrixKey &mkey);
180 
182  const MatrixKey &mkey);
183 
185  const MatrixKey &mkey);
186 
188  const StdRegions::StdMatrixKey &mkey);
189 
191  const MatrixKey &mkey);
192 
193  LOCAL_REGIONS_EXPORT virtual
195  const MatrixKey &mkey);
196 
198  const MatrixKey &mkey);
199 
201  const DNekMatSharedPtr & m_transformationmatrix,
202  DNekMatSharedPtr m_inversetransformationmatrix,
203  DNekMatSharedPtr m_inversetransposedtransformationmatrix);
204 
206  const DNekScalMatSharedPtr & mat);
207 
209 
210  private:
213 
214  TetExp();
215 
217  const Array<OneD, const NekDouble> &inarray,
218  Array<OneD, NekDouble> &outarray,
219  const StdRegions::StdMatrixKey &mkey);
221  const Array<OneD, const NekDouble> &inarray,
222  Array<OneD, NekDouble> &outarray,
224  };
225 
226  typedef std::shared_ptr<TetExp> TetExpSharedPtr;
227  typedef std::vector< TetExpSharedPtr > TetExpVector;
228  } //end of namespace
229 } //end of namespace
230 
231 #endif // TETEXP_H
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1497
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrate the physical point list inarray over region.
Definition: TetExp.cpp:123
void GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1512
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< TetGeom > TetGeomSharedPtr
Definition: TetGeom.h:88
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:73
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: TetExp.cpp:484
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const
Definition: TetExp.cpp:563
std::shared_ptr< TetExp > TetExpSharedPtr
Definition: TetExp.h:226
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:296
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: TetExp.h:211
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:242
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1000
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1061
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1368
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)
Definition: TetExp.cpp:1009
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1486
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: TetExp.h:212
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: TetExp.cpp:303
void v_ComputeFaceNormal(const int face)
Compute the normal of a triangular face.
Definition: TetExp.cpp:739
double NekDouble
virtual void v_GetFacePhysMap(const int face, Array< OneD, int > &outarray)
Returns the physical values at the quadrature points of a face.
Definition: TetExp.cpp:649
void v_ComputeConditionNumberOfMatrix(const DNekScalMatSharedPtr &mat)
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1028
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1502
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
Definition: TetExp.cpp:1535
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
Definition: TetExp.cpp:496
virtual int v_GetCoordim()
Definition: TetExp.cpp:577
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:582
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the inner product .
Definition: TetExp.cpp:367
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: TetExp.cpp:554
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:514
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1085
virtual LibUtilities::ShapeType v_DetShapeType() const
Return Shape of region, using ShapeType enum list.
Definition: TetExp.cpp:549
#define LOCAL_REGIONS_EXPORT
std::vector< TetExpSharedPtr > TetExpVector
Definition: TetExp.h:227
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:164
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1507
Describes the specification for a Basis.
Definition: Basis.h:49
virtual void v_ComputeLaplacianMetric()
Definition: TetExp.cpp:1605
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: TetExp.cpp:533