Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HexExp.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File HexExp.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: Header routines for Hex expansion
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef HEXEXP_H
37 #define HEXEXP_H
38 
39 #include <LibUtilities/BasicUtils/NekManager.hpp> // for NekManager
40 
42 #include <LocalRegions/MatrixKey.h>
44 #include <StdRegions/StdHexExp.h>
45 #include <SpatialDomains/HexGeom.h>
46 
47 namespace Nektar
48 {
49  namespace SpatialDomains
50  {
51  class HexGeom;
52  typedef boost::shared_ptr<HexGeom> HexGeomSharedPtr;
53  }
54 
55  namespace LocalRegions
56  {
57  class HexExp;
58 
59  // type defines for use of HexExp in a boost vector
60  typedef boost::shared_ptr<HexExp> HexExpSharedPtr;
61  typedef std::vector< HexExpSharedPtr > HexExpVector;
63 
64  class HexExp: virtual public StdRegions::StdHexExp, virtual public Expansion3D
65  {
66  public:
67 
69  const LibUtilities::BasisKey &Bb,
70  const LibUtilities::BasisKey &Bc,
72 
73  LOCAL_REGIONS_EXPORT HexExp( const HexExp &T );
74 
76 
77  protected:
78  //------------------------------
79  // Integration Method
80  //------------------------------
82  const Array<OneD, const NekDouble> &inarray );
83 
84 
85  //-----------------------------
86  // Differentiation Methods
87  //-----------------------------
88  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
89  const Array<OneD, const NekDouble> &inarray,
90  Array<OneD, NekDouble> &out_d0,
91  Array<OneD, NekDouble> &out_d1,
92  Array<OneD, NekDouble> &out_d2);
93 
94  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(const int dir,
95  const Array<OneD, const NekDouble>& inarray,
96  Array<OneD, NekDouble> &outarray);
97 
98 
99  //---------------------------------------
100  // Transforms
101  //---------------------------------------
102  LOCAL_REGIONS_EXPORT virtual void v_FwdTrans(
103  const Array<OneD, const NekDouble> & inarray,
104  Array<OneD,NekDouble> &outarray);
105 
106 
107  //---------------------------------------
108  // Inner product functions
109  //---------------------------------------
111  const Array<OneD, const NekDouble> &inarray,
112  Array<OneD, NekDouble> &outarray);
113 
115  const Array<OneD, const NekDouble> &inarray,
116  Array<OneD, NekDouble> &outarray,
117  bool multiplybyweights = true);
118 
120  const int dir,
121  const Array<OneD, const NekDouble> &inarray,
122  Array<OneD, NekDouble> &outarray);
123 
125  const int dir,
126  const Array<OneD, const NekDouble> &inarray,
127  Array<OneD, NekDouble> &outarray);
128 
130  const int dir,
131  const Array<OneD, const NekDouble> &inarray,
132  Array<OneD, NekDouble> &outarray);
133 
134  //---------------------------------------
135  // Evaluation functions
136  //---------------------------------------
138  const Array<OneD, const NekDouble> &Lcoord,
139  const Array<OneD, const NekDouble> &physvals);
140 
142  const Array<OneD, const NekDouble> &coords,
143  const Array<OneD, const NekDouble> & physvals);
144 
145  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
146  const Array<OneD, const NekDouble> &Lcoords,
147  Array<OneD,NekDouble> &coords);
148 
149  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
150  Array<OneD, NekDouble> &coords_1,
151  Array<OneD, NekDouble> &coords_2,
152  Array<OneD, NekDouble> &coords_3);
153 
154 
155  //---------------------------------------
156  // Helper functions
157  //---------------------------------------
158  LOCAL_REGIONS_EXPORT virtual
160 
161  LOCAL_REGIONS_EXPORT virtual
163 
164  LOCAL_REGIONS_EXPORT virtual void v_ExtractDataToCoeffs(const NekDouble *data,
165  const std::vector<unsigned int > &nummodes,
166  const int mode_offset,
167  NekDouble * coeffs);
168 
169  LOCAL_REGIONS_EXPORT virtual
170  bool v_GetFaceDGForwards(const int i) const;
171 
173  const int face,
174  Array<OneD, int> &outarray);
175 
176  LOCAL_REGIONS_EXPORT void v_ComputeFaceNormal(const int face);
177 
178  //---------------------------------------
179  // Operator creation functions
180  //---------------------------------------
182  const Array<OneD, const NekDouble> &inarray,
183  Array<OneD,NekDouble> &outarray,
184  const StdRegions::StdMatrixKey &mkey);
185 
187  const Array<OneD, const NekDouble> &inarray,
188  Array<OneD,NekDouble> &outarray,
189  const StdRegions::StdMatrixKey &mkey);
190 
192  const int k1,
193  const int k2,
194  const Array<OneD, const NekDouble> &inarray,
195  Array<OneD,NekDouble> &outarray,
196  const StdRegions::StdMatrixKey &mkey);
197 
198  LOCAL_REGIONS_EXPORT virtual void v_WeakDerivMatrixOp(const int i,
199  const Array<OneD, const NekDouble> &inarray,
200  Array<OneD,NekDouble> &outarray,
201  const StdRegions::StdMatrixKey &mkey);
202 
204  const Array<OneD, const NekDouble> &inarray,
205  Array<OneD,NekDouble> &outarray,
206  const StdRegions::StdMatrixKey &mkey);
207 
209  const Array<OneD, const NekDouble> &inarray,
210  Array<OneD,NekDouble> &outarray,
211  const StdRegions::StdMatrixKey &mkey);
212 
214  const Array<OneD, const NekDouble> &inarray,
215  Array<OneD,NekDouble> &outarray,
216  const StdRegions::StdMatrixKey &mkey);
217 
219  const Array<OneD, const NekDouble> &inarray,
220  Array<OneD,NekDouble> &outarray,
221  const StdRegions::StdMatrixKey &mkey);
222 
224  int numMin,
225  const Array<OneD, const NekDouble> &inarray,
226  Array<OneD, NekDouble> &outarray);
227 
229  Array<OneD, NekDouble> &array,
230  const StdRegions::StdMatrixKey &mkey);
231 
232  //---------------------------------------
233  // Matrix creation functions
234  //---------------------------------------
236  const StdRegions::StdMatrixKey &mkey);
237 
239  const StdRegions::StdMatrixKey &mkey);
240 
242  const MatrixKey &mkey);
243 
245  const MatrixKey &mkey);
246 
248  const MatrixKey &mkey);
249 
250  LOCAL_REGIONS_EXPORT virtual
252  const MatrixKey &mkey);
253 
255  const MatrixKey &mkey);
256 
258 
259 
260  private:
263 
264  HexExp();
265 
267  const Array<OneD, const NekDouble> &inarray,
268  Array<OneD, NekDouble> &outarray,
270  };
271 
272  } //end of namespace
273 } //end of namespace
274 
275 #endif //HEX_EXP_H
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1101
virtual LibUtilities::ShapeType v_DetShapeType() const
Return the region shape using the enum-list of ShapeType.
Definition: HexExp.cpp:607
void v_ComputeFaceNormal(const int face)
Definition: HexExp.cpp:799
void IProductWRTDerivBase_MatOp(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: HexExp.cpp:490
virtual void v_ComputeLaplacianMetric()
Definition: HexExp.cpp:1828
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Calculate the inner product of inarray with respect to the given basis B = base0 * base1 * base2...
Definition: HexExp.cpp:363
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: HexExp.cpp:1747
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrate the physical point list inarray over region.
Definition: HexExp.cpp:114
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: HexExp.cpp:1759
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculate the inner product of inarray with respect to the elements basis.
Definition: HexExp.cpp:324
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: HexExp.cpp:399
boost::shared_ptr< HexExp > HexExpSharedPtr
Definition: HexExp.h:57
void IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the inner product .
Definition: HexExp.cpp:428
virtual void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1074
boost::shared_ptr< HexGeom > HexGeomSharedPtr
Definition: HexGeom.h:110
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
This function evaluates the expansion at a single (arbitrary) point of the domain.
Definition: HexExp.cpp:548
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: HexExp.h:262
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: HexExp.cpp:1753
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1047
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
virtual bool v_GetFaceDGForwards(const int i) const
Definition: HexExp.cpp:673
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1238
void v_GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1110
virtual void v_GetFacePhysMap(const int face, Array< OneD, int > &outarray)
Definition: HexExp.cpp:683
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)
Calculate the derivative of the physical points.
Definition: HexExp.cpp:157
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: HexExp.cpp:1308
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1270
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Retrieves the physical coordinates of a given set of reference coordinates.
Definition: HexExp.cpp:575
Class representing a hexehedral element in reference space.
Definition: StdHexExp.h:48
std::vector< HexExpSharedPtr >::iterator HexExpVectorIter
Definition: HexExp.h:62
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
double NekDouble
virtual void v_WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1083
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: HexExp.cpp:594
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: HexExp.cpp:1169
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
Definition: HexExp.cpp:1764
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: HexExp.cpp:540
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
std::vector< HexExpSharedPtr > HexExpVector
Definition: HexExp.h:61
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: HexExp.cpp:1633
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: HexExp.h:261
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: HexExp.cpp:559
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1294
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1055
#define LOCAL_REGIONS_EXPORT
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
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: HexExp.cpp:613
Describes the specification for a Basis.
Definition: Basis.h:50
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: HexExp.cpp:286
virtual void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1092