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
167 
168  LOCAL_REGIONS_EXPORT virtual
169  bool v_GetFaceDGForwards(const int i) const;
170 
172  const int face,
173  const StdRegions::StdExpansionSharedPtr &FaceExp,
174  const Array<OneD, const NekDouble> &inarray,
175  Array<OneD, NekDouble> &outarray,
176  StdRegions::Orientation orient);
177 
179  const int face,
180  const StdRegions::StdExpansionSharedPtr &FaceExp,
181  const Array<OneD, const NekDouble> &inarray,
182  Array<OneD, NekDouble> &outarray,
183  StdRegions::Orientation orient);
184 
185  LOCAL_REGIONS_EXPORT void v_ComputeFaceNormal(const int face);
186 
187  //---------------------------------------
188  // Operator creation functions
189  //---------------------------------------
191  const Array<OneD, const NekDouble> &inarray,
192  Array<OneD,NekDouble> &outarray,
193  const StdRegions::StdMatrixKey &mkey);
194 
196  const Array<OneD, const NekDouble> &inarray,
197  Array<OneD,NekDouble> &outarray,
198  const StdRegions::StdMatrixKey &mkey);
199 
201  const int k1,
202  const int k2,
203  const Array<OneD, const NekDouble> &inarray,
204  Array<OneD,NekDouble> &outarray,
205  const StdRegions::StdMatrixKey &mkey);
206 
207  LOCAL_REGIONS_EXPORT virtual void v_WeakDerivMatrixOp(const int i,
208  const Array<OneD, const NekDouble> &inarray,
209  Array<OneD,NekDouble> &outarray,
210  const StdRegions::StdMatrixKey &mkey);
211 
213  const Array<OneD, const NekDouble> &inarray,
214  Array<OneD,NekDouble> &outarray,
215  const StdRegions::StdMatrixKey &mkey);
216 
218  const Array<OneD, const NekDouble> &inarray,
219  Array<OneD,NekDouble> &outarray,
220  const StdRegions::StdMatrixKey &mkey);
221 
223  const Array<OneD, const NekDouble> &inarray,
224  Array<OneD,NekDouble> &outarray,
225  const StdRegions::StdMatrixKey &mkey);
226 
228  const Array<OneD, const NekDouble> &inarray,
229  Array<OneD,NekDouble> &outarray,
230  const StdRegions::StdMatrixKey &mkey);
231 
233  int numMin,
234  const Array<OneD, const NekDouble> &inarray,
235  Array<OneD, NekDouble> &outarray);
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,
274  Array<OneD, NekDouble> &wsp);
275  };
276 
277  } //end of namespace
278 } //end of namespace
279 
280 #endif //HEX_EXP_H