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  {
147  };
148 
149  const char* const MatrixTypeMap[] =
150  {
151  "Mass",
152  "InvMass",
153  "Laplacian",
154  "Laplacian00",
155  "Laplacian01",
156  "Laplacian02",
157  "Laplacian10",
158  "Laplacian11",
159  "Laplacian12",
160  "Laplacian20",
161  "Laplacian21",
162  "Laplacian22",
163  "InvLaplacianWithUnityMean",
164  "WeakDeriv0",
165  "WeakDeriv1",
166  "WeakDeriv2",
167  "WeakDirectionalDeriv",
168  "MassLevelCurvature",
169  "LinearAdvectionReaction",
170  "LinearAdvectionDiffusionReaction",
171  "NBasisTrans",
172  "InvNBasisTrans",
173  "BwdTrans",
174  "IProductWRTBase",
175  "IProductWRTDerivBase0",
176  "IProductWRTDerivBase1",
177  "IProductWRTDerivBase2",
178  "Helmholtz",
179  "HybridDGHelmholz",
180  "InvHybridDGHelmholtz",
181  "HybridDGHelmBndLam",
182  "HybridDGLamToQ0",
183  "HybridDGLamToQ1",
184  "HybridDGLamToQ2",
185  "HybridDGLamToU",
186  "FwdTrans",
187  "PreconR",
188  "PreconRMass",
189  "PreconLinearSpace",
190  "PreconLinearSpaceMass",
191  "InterpGauss",
192  "GaussDG",
193  "PhysInterpToEquiSpaced",
194  "EquiSpacedToCoeffs"
195  };
196 
198  {
230  };
231 
232  const char* const VarCoeffTypeMap[] = {
233  "VarCoeffMass",
234  "VarCoeffLaplacian",
235  "VarCoeffWeakDeriv",
236  "VarCoeffD00",
237  "VarCoeffD11",
238  "VarCoeffD22",
239  "VarCoeffD01",
240  "VarCoeffD02",
241  "VarCoeffD12",
242  "VarCoeffVelX",
243  "VarCoeffVelY",
244  "VarCoeffVelZ",
245  "VarCoeffMF1x",
246  "VarCoeffMF1y",
247  "VarCoeffMF1z",
248  "VarCoeffMF1Div",
249  "VarCoeffMF1Mag",
250  "VarCoeffMF2x",
251  "VarCoeffMF2y",
252  "VarCoeffMF2z",
253  "VarCoeffMF2Div",
254  "VarCoeffMF2Mag",
255  "VarCoeffMF3x",
256  "VarCoeffMF3y",
257  "VarCoeffMF3z",
258  "VarCoeffMF3Div",
259  "VarCoeffMF3Mag",
260  "VarCoeffMF",
261  "VarCoeffMFDiv",
262  "VarCoeffGmat"
263  };
264  typedef std::map<StdRegions::VarCoeffType, Array<OneD, NekDouble> > VarCoeffMap;
265  static VarCoeffMap NullVarCoeffMap;
266 
268  {
280  };
281 
282  const char* const ConstFactorTypeMap[] = {
283  "FactorLambda",
284  "FactorTau",
285  "FactorTime",
286  "FactorSVVCutoffRatio",
287  "FactorSVVDiffCoeff",
288  "FactorSVVPowerKerDiffCoeff",
289  "FactorSVVDGKerDiffCoeff",
290  "FactorGaussVertex",
291  "FactorGaussEdge",
292  "FactorConstant"
293  };
294  typedef std::map<ConstFactorType, NekDouble> ConstFactorMap;
295  static ConstFactorMap NullConstFactorMap;
296 
298  {
305  };
306 
307  const char* const IndexMapTypeMap[] =
308  {
309  "EdgeToElement",
310  "FaceToElement",
311  "EdgeInterior",
312  "FaceInterior",
313  "Boundary",
314  "Vertex"
315  };
316 
318  {
324  eDir1FwdDir1_Dir2FwdDir2, // These flags are interpreted as
325  eDir1FwdDir1_Dir2BwdDir2, // taking the second direction to the
326  eDir1BwdDir1_Dir2FwdDir2, // first direction. So Dir1FwdDir2 takes
327  eDir1BwdDir1_Dir2BwdDir2, // direction 2 and makes it backward
328  eDir1FwdDir2_Dir2FwdDir1, // to direction 1 in the mapped face.
329  eDir1FwdDir2_Dir2BwdDir1, // Note be careful not to flip this
330  eDir1BwdDir2_Dir2FwdDir1, // convention especially when using
331  eDir1BwdDir2_Dir2BwdDir1, // transposed mappings.
333  };
334 
335  const char* const OrientationMap[] =
336  {
337  "NoOrientation",
338  "Fwd",
339  "Bwd",
340  "Forwards",
341  "Backwards",
342  "Dir1FwdDir1_Dir2FwdDir2",
343  "Dir1FwdDir1_Dir2BwdDir2",
344  "Dir1BwdDir1_Dir2FwdDir2",
345  "Dir1BwdDir1_Dir2BwdDir2",
346  "Dir1FwdDir2_Dir2FwdDir1",
347  "Dir1FwdDir2_Dir2BwdDir1",
348  "Dir1BwdDir2_Dir2FwdDir1",
349  "Dir1BwdDir2_Dir2BwdDir1"
350  };
351 
352  // Defines a "fast find"
353  // Assumes that first/last define the beginning/ending of
354  // a continuous range of classes, and that start is
355  // an iterator between first and last
356 
357  template<class InputIterator, class EqualityComparable>
358  InputIterator find(InputIterator first, InputIterator last,
359  InputIterator startingpoint,
360  const EqualityComparable& value)
361  {
362  InputIterator val;
363 
364  if(startingpoint == first)
365  {
366  val = find(first,last,value);
367  }
368  else
369  {
370  val = find(startingpoint,last,value);
371  if(val == last)
372  {
373  val = find(first,startingpoint,value);
374  if(val == startingpoint)
375  {
376  val = last;
377  }
378  }
379  }
380  return val;
381  }
382 
383  //Optimized Kernel Entries
384  const int kSVVDGFiltermodesmin = 3;
385  const int kSVVDGFiltermodesmax = 11;
386  // Optimized Kernel Entries for p = 2 - 10
387  const NekDouble kSVVDGFilter[9][11] =
388  { { 0, 0.36212, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
389  { 0, 0.70546, 0.078836, 1, 0, 0, 0, 0, 0, 0, 0 },
390  { 0, 0, 0.49411, 0.072394, 1, 0, 0, 0, 0, 0, 0 },
391  { 0, 0, 0.000073566, 0.40506, 0.094122, 1, 0, 0, 0, 0, 0 },
392  { 0, 0, 0, 0.0001422, 0.36863, 0.11815, 1, 0, 0, 0, 0 },
393  { 0, 0, 0, 0, 0.00019497, 0.41397, 0.16927, 1, 0, 0, 0 },
394  { 0, 0, 0, 0, 0, 0.0009762, 0.12747, 0.13763, 1, 0, 0 },
395  { 0, 0, 0, 0, 0, 0, 0.0023592, 0.23683, 0.17196, 1, 0 },
396  { 0, 0, 0, 0, 0, 0, 0, 0.0026055, 0.28682, 0.22473, 1 } };
397 
398  } // end of namespace
399 } // end of namespace
400 
401 #endif //STDREGIONS_H
402 
const int kSVVDGFiltermodesmax
Definition: StdRegions.hpp:385
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:294
const int kSVVDGFiltermodesmin
Definition: StdRegions.hpp:384
const char *const ConstFactorTypeMap[]
Definition: StdRegions.hpp:282
const char *const IndexMapTypeMap[]
Definition: StdRegions.hpp:307
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:264
const char *const MatrixTypeMap[]
Definition: StdRegions.hpp:149
double NekDouble
const char *const ElementTypeMap[]
Definition: StdRegions.hpp:75
const NekDouble kSVVDGFilter[9][11]
Definition: StdRegions.hpp:387
const char *const OrientationMap[]
Definition: StdRegions.hpp:335
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Definition: StdRegions.hpp:358
const char *const VarCoeffTypeMap[]
Definition: StdRegions.hpp:232
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:265
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:295