Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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
166 
168  const NekDouble *data,
169  const std::vector<unsigned int > &nummodes,
170  const int mode_offset,
171  NekDouble * coeffs,
172  std::vector<LibUtilities::BasisType> &fromType);
173 
174  LOCAL_REGIONS_EXPORT virtual
175  bool v_GetFaceDGForwards(const int i) const;
176 
178  const int face,
179  Array<OneD, int> &outarray);
180 
181  LOCAL_REGIONS_EXPORT void v_ComputeFaceNormal(const int face);
182 
183  //---------------------------------------
184  // Operator creation functions
185  //---------------------------------------
187  const Array<OneD, const NekDouble> &inarray,
188  Array<OneD,NekDouble> &outarray,
189  const StdRegions::StdMatrixKey &mkey);
190 
192  const Array<OneD, const NekDouble> &inarray,
193  Array<OneD,NekDouble> &outarray,
194  const StdRegions::StdMatrixKey &mkey);
195 
197  const int k1,
198  const int k2,
199  const Array<OneD, const NekDouble> &inarray,
200  Array<OneD,NekDouble> &outarray,
201  const StdRegions::StdMatrixKey &mkey);
202 
203  LOCAL_REGIONS_EXPORT virtual void v_WeakDerivMatrixOp(const int i,
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  const Array<OneD, const NekDouble> &inarray,
225  Array<OneD,NekDouble> &outarray,
226  const StdRegions::StdMatrixKey &mkey);
227 
229  int numMin,
230  const Array<OneD, const NekDouble> &inarray,
231  Array<OneD, NekDouble> &outarray);
232 
234  Array<OneD, NekDouble> &array,
235  const StdRegions::StdMatrixKey &mkey);
236 
237  //---------------------------------------
238  // Matrix creation functions
239  //---------------------------------------
241  const StdRegions::StdMatrixKey &mkey);
242 
244  const StdRegions::StdMatrixKey &mkey);
245 
247  const MatrixKey &mkey);
248 
250  const MatrixKey &mkey);
251 
253  const MatrixKey &mkey);
254 
255  LOCAL_REGIONS_EXPORT virtual
257  const MatrixKey &mkey);
258 
260  const MatrixKey &mkey);
261 
263 
264 
265  private:
268 
269  HexExp();
270 
272  const Array<OneD, const NekDouble> &inarray,
273  Array<OneD, NekDouble> &outarray,
275  };
276 
277  } //end of namespace
278 } //end of namespace
279 
280 #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:1167
virtual LibUtilities::ShapeType v_DetShapeType() const
Return the region shape using the enum-list of ShapeType.
Definition: HexExp.cpp:622
void v_ComputeFaceNormal(const int face)
Definition: HexExp.cpp:865
void IProductWRTDerivBase_MatOp(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: HexExp.cpp:492
virtual void v_ComputeLaplacianMetric()
Definition: HexExp.cpp:1894
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:365
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: HexExp.cpp:1813
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrate the physical point list inarray over region.
Definition: HexExp.cpp:116
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: HexExp.cpp:1825
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:326
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: HexExp.cpp:401
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:430
virtual void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1140
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:550
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: HexExp.h:267
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: HexExp.cpp:1819
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1113
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
virtual bool v_GetFaceDGForwards(const int i) const
Definition: HexExp.cpp:739
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1304
void v_GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1176
virtual void v_GetFacePhysMap(const int face, Array< OneD, int > &outarray)
Definition: HexExp.cpp:749
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:159
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: HexExp.cpp:628
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: HexExp.cpp:1374
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1336
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:590
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:1149
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: HexExp.cpp:609
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: HexExp.cpp:1235
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
Definition: HexExp.cpp:1830
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const
Definition: HexExp.cpp:570
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: HexExp.cpp:542
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:1699
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: HexExp.h:266
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: HexExp.cpp:561
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1360
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1121
#define LOCAL_REGIONS_EXPORT
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
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:288
virtual void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: HexExp.cpp:1158