Nektar++
StdRegions.hpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File StdRegions.hpp
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 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Definition of enum lists and constants
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef STDREGIONS_HPP
36 #define STDREGIONS_HPP
37 
38 
39 #include<map>
40 #include <LibUtilities/BasicUtils/SharedArray.hpp> // for Array, etc
42 
43 namespace Nektar
44 {
45 
46  /** \brief The namespace associated with the the StdRegions library
47  * (\ref pageStdRegions "StdRegions introduction")
48  */
49  namespace StdRegions
50  {
52  {
53  //eStdPointExp,
73  };
74 
75  const char* const ElementTypeMap[] =
76  {
77  //"StdPointExp",
78  "StdSegExp",
79  "SegExp",
80  "StdQuadExp",
81  "StdTriExp",
82  "StdNodalTriExp",
83  "QuadExp",
84  "TriExp",
85  "NodalTriExp",
86  "StdHexExp",
87  "StdPrismExp",
88  "StdPyrExp",
89  "StdTetExp",
90  "StdNodalTetExp",
91  "HexExp",
92  "PrismExp",
93  "PyrExp",
94  "TetExp",
95  "NodalTetExp",
96  };
97 
98  /** @todo we need to tidy up matrix construction approach
99  * probably using a factory type approach */
101  {
151  };
152 
153  const char* const MatrixTypeMap[] =
154  {
155  "Mass",
156  "InvMass",
157  "Laplacian",
158  "Laplacian00",
159  "Laplacian01",
160  "Laplacian02",
161  "Laplacian10",
162  "Laplacian11",
163  "Laplacian12",
164  "Laplacian20",
165  "Laplacian21",
166  "Laplacian22",
167  "InvLaplacianWithUnityMean",
168  "WeakDeriv0",
169  "WeakDeriv1",
170  "WeakDeriv2",
171  "WeakDirectionalDeriv",
172  "MassLevelCurvature",
173  "LinearAdvectionReaction",
174  "LinearAdvectionDiffusionReaction",
175  "NBasisTrans",
176  "InvNBasisTrans",
177  "BwdTrans",
178  "BwdMat",
179  "IProductWRTBase",
180  "IProductWRTDerivBase0",
181  "IProductWRTDerivBase1",
182  "IProductWRTDerivBase2",
183  "DerivBase0",
184  "DerivBase1",
185  "DerivBase2",
186  "Helmholtz",
187  "HybridDGHelmholz",
188  "InvHybridDGHelmholtz",
189  "HybridDGHelmBndLam",
190  "HybridDGLamToQ0",
191  "HybridDGLamToQ1",
192  "HybridDGLamToQ2",
193  "HybridDGLamToU",
194  "FwdTrans",
195  "PreconR",
196  "PreconRMass",
197  "PreconLinearSpace",
198  "PreconLinearSpaceMass",
199  "InterpGauss",
200  "GaussDG",
201  "PhysInterpToEquiSpaced",
202  "EquiSpacedToCoeffs"
203  };
204 
206  {
238  };
239 
240  const char* const VarCoeffTypeMap[] = {
241  "VarCoeffMass",
242  "VarCoeffLaplacian",
243  "VarCoeffWeakDeriv",
244  "VarCoeffD00",
245  "VarCoeffD11",
246  "VarCoeffD22",
247  "VarCoeffD01",
248  "VarCoeffD02",
249  "VarCoeffD12",
250  "VarCoeffVelX",
251  "VarCoeffVelY",
252  "VarCoeffVelZ",
253  "VarCoeffMF1x",
254  "VarCoeffMF1y",
255  "VarCoeffMF1z",
256  "VarCoeffMF1Div",
257  "VarCoeffMF1Mag",
258  "VarCoeffMF2x",
259  "VarCoeffMF2y",
260  "VarCoeffMF2z",
261  "VarCoeffMF2Div",
262  "VarCoeffMF2Mag",
263  "VarCoeffMF3x",
264  "VarCoeffMF3y",
265  "VarCoeffMF3z",
266  "VarCoeffMF3Div",
267  "VarCoeffMF3Mag",
268  "VarCoeffMF",
269  "VarCoeffMFDiv",
270  "VarCoeffGmat"
271  };
272  typedef std::map<StdRegions::VarCoeffType, Array<OneD, NekDouble> > VarCoeffMap;
274 
276  {
294  };
295 
296  const char* const ConstFactorTypeMap[] = {
297  "FactorLambda",
298  "FactorCoeffD00",
299  "FactorCoeffD11",
300  "FactorCoeffD22",
301  "FactorCoeffD01",
302  "FactorCoeffD02",
303  "FactorCoeffD12",
304  "FactorTau",
305  "FactorTime",
306  "FactorSVVCutoffRatio",
307  "FactorSVVDiffCoeff",
308  "FactorSVVPowerKerDiffCoeff",
309  "FactorSVVDGKerDiffCoeff",
310  "FactorGaussVertex",
311  "FactorGaussEdge",
312  "FactorConstant"
313  };
314  typedef std::map<ConstFactorType, NekDouble> ConstFactorMap;
316 
317  // FactorMap
320 
322  {
328  eDir1FwdDir1_Dir2FwdDir2, // These flags are interpreted as
329  eDir1FwdDir1_Dir2BwdDir2, // taking the second direction to the
330  eDir1BwdDir1_Dir2FwdDir2, // first direction. So Dir1FwdDir2 takes
331  eDir1BwdDir1_Dir2BwdDir2, // direction 2 and makes it backward
332  eDir1FwdDir2_Dir2FwdDir1, // to direction 1 in the mapped face.
333  eDir1FwdDir2_Dir2BwdDir1, // Note be careful not to flip this
334  eDir1BwdDir2_Dir2FwdDir1, // convention especially when using
335  eDir1BwdDir2_Dir2BwdDir1, // transposed mappings.
337  };
338 
339  const char* const OrientationMap[] =
340  {
341  "NoOrientation",
342  "Fwd",
343  "Bwd",
344  "Forwards",
345  "Backwards",
346  "Dir1FwdDir1_Dir2FwdDir2",
347  "Dir1FwdDir1_Dir2BwdDir2",
348  "Dir1BwdDir1_Dir2FwdDir2",
349  "Dir1BwdDir1_Dir2BwdDir2",
350  "Dir1FwdDir2_Dir2FwdDir1",
351  "Dir1FwdDir2_Dir2BwdDir1",
352  "Dir1BwdDir2_Dir2FwdDir1",
353  "Dir1BwdDir2_Dir2BwdDir1"
354  };
355 
356  // Defines a "fast find"
357  // Assumes that first/last define the beginning/ending of
358  // a continuous range of classes, and that start is
359  // an iterator between first and last
360 
361  template<class InputIterator, class EqualityComparable>
362  InputIterator find(InputIterator first, InputIterator last,
363  InputIterator startingpoint,
364  const EqualityComparable& value)
365  {
366  InputIterator val;
367 
368  if(startingpoint == first)
369  {
370  val = find(first,last,value);
371  }
372  else
373  {
374  val = find(startingpoint,last,value);
375  if(val == last)
376  {
377  val = find(first,startingpoint,value);
378  if(val == startingpoint)
379  {
380  val = last;
381  }
382  }
383  }
384  return val;
385  }
386 
387  //Optimized Kernel Entries
388  const int kSVVDGFiltermodesmin = 3;
389  const int kSVVDGFiltermodesmax = 11;
390  // Optimized Kernel Entries for p = 2 - 10
391  const NekDouble kSVVDGFilter[9][11] =
392  { { 0, 0.36212, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
393  { 0, 0.70546, 0.078836, 1, 0, 0, 0, 0, 0, 0, 0 },
394  { 0, 0, 0.49411, 0.072394, 1, 0, 0, 0, 0, 0, 0 },
395  { 0, 0, 0.000073566, 0.40506, 0.094122, 1, 0, 0, 0, 0, 0 },
396  { 0, 0, 0, 0.0001422, 0.36863, 0.11815, 1, 0, 0, 0, 0 },
397  { 0, 0, 0, 0, 0.00019497, 0.41397, 0.16927, 1, 0, 0, 0 },
398  { 0, 0, 0, 0, 0, 0.0009762, 0.12747, 0.13763, 1, 0, 0 },
399  { 0, 0, 0, 0, 0, 0, 0.0023592, 0.23683, 0.17196, 1, 0 },
400  { 0, 0, 0, 0, 0, 0, 0, 0.0026055, 0.28682, 0.22473, 1 } };
401 
402  } // end of namespace
403 } // end of namespace
404 
405 #endif //STDREGIONS_H
406 
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Definition: StdRegions.hpp:362
const int kSVVDGFiltermodesmin
Definition: StdRegions.hpp:388
static FactorMap NullFactorMap
Definition: StdRegions.hpp:319
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:272
const char *const VarCoeffTypeMap[]
Definition: StdRegions.hpp:240
const int kSVVDGFiltermodesmax
Definition: StdRegions.hpp:389
const NekDouble kSVVDGFilter[9][11]
Definition: StdRegions.hpp:391
const char *const ConstFactorTypeMap[]
Definition: StdRegions.hpp:296
const char *const ElementTypeMap[]
Definition: StdRegions.hpp:75
const char *const MatrixTypeMap[]
Definition: StdRegions.hpp:153
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:314
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:315
const char *const OrientationMap[]
Definition: StdRegions.hpp:339
ConstFactorMap FactorMap
Definition: StdRegions.hpp:318
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:273
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
double NekDouble