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 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description:
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef TETEXP_H
37 #define TETEXP_H
38 
39 #include <StdRegions/StdTetExp.h>
40 #include <SpatialDomains/TetGeom.h>
41 #include <LocalRegions/MatrixKey.h>
45 
46 namespace Nektar
47 {
48  namespace LocalRegions
49  {
50 
51  class TetExp: virtual public StdRegions::StdTetExp, virtual public Expansion3D
52  {
53 
54  public:
56  const LibUtilities::BasisKey &Bb,
57  const LibUtilities::BasisKey &Bc,
59 
60  LOCAL_REGIONS_EXPORT TetExp(const TetExp &T);
61 
62 
64 
65  protected:
66  //-----------------------------
67  // Integration Methods
68  //-----------------------------
69  LOCAL_REGIONS_EXPORT virtual
71 
72 
73  //-----------------------------
74  // Differentiation Methods
75  //-----------------------------
76  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
77  const Array<OneD, const NekDouble> &inarray,
78  Array<OneD, NekDouble> &out_d0,
79  Array<OneD, NekDouble> &out_d1,
80  Array<OneD, NekDouble> &out_d2);
81 
82  //-----------------------------
83  // Transforms
84  //-----------------------------
85  LOCAL_REGIONS_EXPORT virtual void v_FwdTrans(
86  const Array<OneD, const NekDouble> & inarray,
87  Array<OneD,NekDouble> &outarray);
88 
89  //-----------------------------
90  // Inner product functions
91  //-----------------------------
93  const Array<OneD, const NekDouble>& inarray,
94  Array<OneD, NekDouble>& outarray);
96  const Array<OneD, const NekDouble>& inarray,
97  Array<OneD, NekDouble>& outarray,
98  bool multiplybyweights = true);
100  const int dir,
101  const Array<OneD, const NekDouble>& inarray,
102  Array<OneD, NekDouble>& outarray);
103 
104 
105  //-----------------------------
106  // Evaluation functions
107  //-----------------------------
109  const Array<OneD, const NekDouble> &Lcoord,
110  const Array<OneD, const NekDouble> &physvals);
111 
113  const Array<OneD, const NekDouble> &coords,
114  const Array<OneD, const NekDouble> & physvals);
115 
116  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
117  const Array<OneD, const NekDouble> &Lcoords,
118  Array<OneD,NekDouble> &coords);
119 
120  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
121  Array<OneD, NekDouble> &coords_1,
122  Array<OneD, NekDouble> &coords_2,
123  Array<OneD, NekDouble> &coords_3);
124 
125  //-----------------------------
126  // Helper functions
127  //-----------------------------
128  LOCAL_REGIONS_EXPORT virtual
130 
131  LOCAL_REGIONS_EXPORT virtual
133 
134  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
135 
137  const NekDouble *data,
138  const std::vector<unsigned int> &nummodes,
139  const int mode_offset,
140  NekDouble *coeffs);
141 
143  const int face,
144  const StdRegions::StdExpansionSharedPtr &FaceExp,
145  const Array<OneD, const NekDouble> &inarray,
146  Array<OneD, NekDouble> &outarray,
147  StdRegions::Orientation orient);
148 
150  const int face,
151  const StdRegions::StdExpansionSharedPtr &FaceExp,
152  const Array<OneD, const NekDouble> &inarray,
153  Array<OneD, NekDouble> &outarray,
154  StdRegions::Orientation orient);
155 
156  LOCAL_REGIONS_EXPORT void v_ComputeFaceNormal(const int face);
157 
158  //-----------------------------
159  // Operator creation functions
160  //-----------------------------
162  const Array<OneD, const NekDouble> &inarray,
163  Array<OneD,NekDouble> &outarray,
164  const StdRegions::StdMatrixKey &mkey);
165 
167  const Array<OneD, const NekDouble> &inarray,
168  Array<OneD,NekDouble> &outarray,
169  const StdRegions::StdMatrixKey &mkey);
170 
172  const int k1,
173  const int k2,
174  const Array<OneD, const NekDouble> &inarray,
175  Array<OneD,NekDouble> &outarray,
176  const StdRegions::StdMatrixKey &mkey);
177 
179  Array<OneD, NekDouble> &array,
180  const StdRegions::StdMatrixKey &mkey);
181 
182  //-----------------------------
183  // Matrix creation functions
184  //-----------------------------
186  const StdRegions::StdMatrixKey &mkey);
187 
189  const MatrixKey &mkey);
190 
192  const MatrixKey &mkey);
193 
195  const StdRegions::StdMatrixKey &mkey);
196 
198  const MatrixKey &mkey);
199 
200  LOCAL_REGIONS_EXPORT virtual
202  const MatrixKey &mkey);
203 
205  const MatrixKey &mkey);
206 
208  const DNekMatSharedPtr & m_transformationmatrix,
209  DNekMatSharedPtr m_inversetransformationmatrix,
210  DNekMatSharedPtr m_inversetransposedtransformationmatrix);
211 
213  const DNekScalMatSharedPtr & mat);
214 
216 
217  private:
220 
221  TetExp();
222 
224  const Array<OneD, const NekDouble> &inarray,
225  Array<OneD, NekDouble> &outarray,
226  const StdRegions::StdMatrixKey &mkey);
228  const Array<OneD, const NekDouble> &inarray,
229  Array<OneD, NekDouble> &outarray,
231  };
232 
233  // type defines for use of TetExp in a boost vector
234  typedef boost::shared_ptr<TetExp> TetExpSharedPtr;
235  typedef std::vector< TetExpSharedPtr > TetExpVector;
237 
238  } //end of namespace
239 } //end of namespace
240 
241 #endif // TETEXP_H
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1503
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrate the physical point list inarray over region.
Definition: TetExp.cpp:114
void GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1518
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: TetExp.cpp:475
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
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: TetExp.h:218
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:233
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:980
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
boost::shared_ptr< TetExp > TetExpSharedPtr
Definition: TetExp.h:234
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1041
virtual void v_GetFacePhysVals(const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
Returns the physical values at the quadrature points of a face.
Definition: TetExp.cpp:636
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1374
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:989
virtual void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs)
Unpack data from input file assuming it comes from the same expansion type.
Definition: TetExp.cpp:558
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1492
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: TetExp.h:219
virtual void v_GetTracePhysVals(const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
Returns the physical values at the quadrature points of a face Wrapper function to v_GetFacePhysVals...
Definition: TetExp.cpp:623
std::vector< TetExpSharedPtr >::iterator TetExpVectorIter
Definition: TetExp.h:236
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: TetExp.cpp:294
void v_ComputeFaceNormal(const int face)
Compute the normal of a triangular face.
Definition: TetExp.cpp:730
double NekDouble
void v_ComputeConditionNumberOfMatrix(const DNekScalMatSharedPtr &mat)
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: TetExp.cpp:1008
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1508
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: TetExp.cpp:545
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
Definition: TetExp.cpp:1541
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
Definition: TetExp.cpp:487
virtual int v_GetCoordim()
Definition: TetExp.cpp:553
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the inner product .
Definition: TetExp.cpp:358
boost::shared_ptr< TetGeom > TetGeomSharedPtr
Definition: TetGeom.h:106
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:505
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1065
#define LOCAL_REGIONS_EXPORT
std::vector< TetExpSharedPtr > TetExpVector
Definition: TetExp.h:235
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:155
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: TetExp.cpp:1513
Describes the specification for a Basis.
Definition: Basis.h:50
virtual void v_ComputeLaplacianMetric()
Definition: TetExp.cpp:1611
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: TetExp.cpp:524
virtual LibUtilities::ShapeType v_DetShapeType() const
Return Shape of region, using ShapeType enum list.
Definition: TetExp.cpp:540