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 
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);
103  const int dir,
104  const Array<OneD, const NekDouble> &inarray,
105  Array<OneD, Array<OneD, NekDouble> > &outarray);
106 
107 
108  //-----------------------------
109  // Evaluation functions
110  //-----------------------------
112  const Array<OneD, const NekDouble> &Lcoord,
113  const Array<OneD, const NekDouble> &physvals);
114 
116  const Array<OneD, const NekDouble> &coords,
117  const Array<OneD, const NekDouble> & physvals);
118 
119  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
120  const Array<OneD, const NekDouble> &Lcoords,
121  Array<OneD,NekDouble> &coords);
122 
123  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
124  Array<OneD, NekDouble> &coords_1,
125  Array<OneD, NekDouble> &coords_2,
126  Array<OneD, NekDouble> &coords_3);
127 
128  //-----------------------------
129  // Helper functions
130  //-----------------------------
131  LOCAL_REGIONS_EXPORT virtual
133 
134  LOCAL_REGIONS_EXPORT virtual
136 
137  LOCAL_REGIONS_EXPORT virtual
139 
140  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
141 
143  const NekDouble *data,
144  const std::vector<unsigned int> &nummodes,
145  const int mode_offset,
146  NekDouble *coeffs,
147  std::vector<LibUtilities::BasisType> &fromType);
148 
149 
151  const int face,
152  Array<OneD, int> &outarray);
153 
154  LOCAL_REGIONS_EXPORT void v_ComputeTraceNormal(const int face);
155  //-----------------------------
156  // Operator creation functions
157  //-----------------------------
159  const Array<OneD, const NekDouble> &inarray,
160  Array<OneD,NekDouble> &outarray,
161  const StdRegions::StdMatrixKey &mkey);
162 
164  const Array<OneD, const NekDouble> &inarray,
165  Array<OneD,NekDouble> &outarray,
166  const StdRegions::StdMatrixKey &mkey);
167 
169  const int k1,
170  const int k2,
171  const Array<OneD, const NekDouble> &inarray,
172  Array<OneD,NekDouble> &outarray,
173  const StdRegions::StdMatrixKey &mkey);
174 
176  Array<OneD, NekDouble> &array,
177  const StdRegions::StdMatrixKey &mkey);
178 
179  //-----------------------------
180  // Matrix creation functions
181  //-----------------------------
183  const StdRegions::StdMatrixKey &mkey);
184 
186  const MatrixKey &mkey);
187 
189  const MatrixKey &mkey);
190 
192  const StdRegions::StdMatrixKey &mkey);
193 
195  const MatrixKey &mkey);
196 
197  LOCAL_REGIONS_EXPORT virtual
199  const MatrixKey &mkey);
200 
202  const MatrixKey &mkey);
203 
205  const DNekMatSharedPtr & m_transformationmatrix,
206  DNekMatSharedPtr m_inversetransformationmatrix,
207  DNekMatSharedPtr m_inversetransposedtransformationmatrix);
208 
210  const DNekScalMatSharedPtr & mat);
211 
213 
214  private:
217 
219 
221  const Array<OneD, const NekDouble> &inarray,
222  Array<OneD, NekDouble> &outarray,
223  const StdRegions::StdMatrixKey &mkey);
225  const Array<OneD, const NekDouble> &inarray,
226  Array<OneD, NekDouble> &outarray,
228  };
229 
230  typedef std::shared_ptr<TetExp> TetExpSharedPtr;
231  typedef std::vector< TetExpSharedPtr > TetExpVector;
232  } //end of namespace
233 } //end of namespace
234 
235 #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:526
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
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
virtual void v_ComputeLaplacianMetric()
Definition: TetExp.cpp:1625
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: TetExp.cpp:545
void v_ComputeConditionNumberOfMatrix(const DNekScalMatSharedPtr &mat)
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1081
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: TetExp.h:216
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: TetExp.cpp:566
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: TetExp.h:215
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:594
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1029
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1388
virtual int v_GetCoordim()
Definition: TetExp.cpp:589
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1517
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1020
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:123
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1506
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
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: TetExp.cpp:496
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const
Definition: TetExp.cpp:575
virtual void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: TetExp.cpp:419
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: TetExp.cpp:303
void v_ComputeTraceNormal(const int face)
Compute the normal of a triangular face.
Definition: TetExp.cpp:751
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1048
virtual LibUtilities::ShapeType v_DetShapeType() const
Return Shape of region, using ShapeType enum list.
Definition: TetExp.cpp:561
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1522
void GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1532
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 void v_GetTracePhysMap(const int face, Array< OneD, int > &outarray)
Returns the physical values at the quadrature points of a face.
Definition: TetExp.cpp:661
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1527
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
Definition: TetExp.cpp:508
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1105
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
Definition: TetExp.cpp:1555
std::shared_ptr< TetExp > TetExpSharedPtr
Definition: TetExp.h:230
std::vector< TetExpSharedPtr > TetExpVector
Definition: TetExp.h:231
std::shared_ptr< TetGeom > TetGeomSharedPtr
Definition: TetGeom.h:82
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:73
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
double NekDouble