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 
119  const int dir,
120  const Array<OneD, const NekDouble> &inarray,
121  Array<OneD, NekDouble> &outarray);
122 
124  const int dir,
125  const Array<OneD, const NekDouble> &inarray,
126  Array<OneD, NekDouble> &outarray);
127 
129  const int dir,
130  const Array<OneD, const NekDouble> &inarray,
131  Array<OneD, NekDouble> &outarray);
132 
133  //---------------------------------------
134  // Evaluation functions
135  //---------------------------------------
137  const Array<OneD, const NekDouble> &Lcoord,
138  const Array<OneD, const NekDouble> &physvals);
139 
141  const Array<OneD, const NekDouble> &coords,
142  const Array<OneD, const NekDouble> & physvals);
143 
144  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
145  const Array<OneD, const NekDouble> &Lcoords,
146  Array<OneD,NekDouble> &coords);
147 
148  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
149  Array<OneD, NekDouble> &coords_1,
150  Array<OneD, NekDouble> &coords_2,
151  Array<OneD, NekDouble> &coords_3);
152 
153 
154  //---------------------------------------
155  // Helper functions
156  //---------------------------------------
157  LOCAL_REGIONS_EXPORT virtual
159 
160  LOCAL_REGIONS_EXPORT virtual void v_ExtractDataToCoeffs(const NekDouble *data,
161  const std::vector<unsigned int > &nummodes,
162  const int mode_offset,
163  NekDouble * coeffs);
164 
165  LOCAL_REGIONS_EXPORT virtual
166  bool v_GetFaceDGForwards(const int i) const;
167 
169  const int face,
170  const StdRegions::StdExpansionSharedPtr &FaceExp,
171  const Array<OneD, const NekDouble> &inarray,
172  Array<OneD, NekDouble> &outarray,
173  StdRegions::Orientation orient);
174 
176  const int face,
177  const StdRegions::StdExpansionSharedPtr &FaceExp,
178  const Array<OneD, const NekDouble> &inarray,
179  Array<OneD, NekDouble> &outarray,
180  StdRegions::Orientation orient);
181 
182  LOCAL_REGIONS_EXPORT void v_ComputeFaceNormal(const int face);
183 
184  //---------------------------------------
185  // Operator creation functions
186  //---------------------------------------
188  const Array<OneD, const NekDouble> &inarray,
189  Array<OneD,NekDouble> &outarray,
190  const StdRegions::StdMatrixKey &mkey);
191 
193  const Array<OneD, const NekDouble> &inarray,
194  Array<OneD,NekDouble> &outarray,
195  const StdRegions::StdMatrixKey &mkey);
196 
198  const int k1,
199  const int k2,
200  const Array<OneD, const NekDouble> &inarray,
201  Array<OneD,NekDouble> &outarray,
202  const StdRegions::StdMatrixKey &mkey);
203 
204  LOCAL_REGIONS_EXPORT virtual void v_WeakDerivMatrixOp(const int i,
205  const Array<OneD, const NekDouble> &inarray,
206  Array<OneD,NekDouble> &outarray,
207  const StdRegions::StdMatrixKey &mkey);
208 
210  const Array<OneD, const NekDouble> &inarray,
211  Array<OneD,NekDouble> &outarray,
212  const StdRegions::StdMatrixKey &mkey);
213 
215  const Array<OneD, const NekDouble> &inarray,
216  Array<OneD,NekDouble> &outarray,
217  const StdRegions::StdMatrixKey &mkey);
218 
220  const Array<OneD, const NekDouble> &inarray,
221  Array<OneD,NekDouble> &outarray,
222  const StdRegions::StdMatrixKey &mkey);
223 
225  const Array<OneD, const NekDouble> &inarray,
226  Array<OneD,NekDouble> &outarray,
227  const StdRegions::StdMatrixKey &mkey);
228 
230  int numMin,
231  const Array<OneD, const NekDouble> &inarray,
232  Array<OneD, NekDouble> &outarray);
233 
234  //---------------------------------------
235  // Matrix creation functions
236  //---------------------------------------
238  const StdRegions::StdMatrixKey &mkey);
239 
241  const StdRegions::StdMatrixKey &mkey);
242 
244  const MatrixKey &mkey);
245 
247  const MatrixKey &mkey);
248 
250  const MatrixKey &mkey);
251 
252  LOCAL_REGIONS_EXPORT virtual
254  const MatrixKey &mkey);
255 
257  const MatrixKey &mkey);
258 
260 
261 
262  private:
265 
266  HexExp();
267 
269  const Array<OneD, const NekDouble> &inarray,
270  Array<OneD, NekDouble> &outarray,
271  Array<OneD, NekDouble> &wsp);
272  };
273 
274  } //end of namespace
275 } //end of namespace
276 
277 #endif //HEX_EXP_H