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 
39 #include <LibUtilities/BasicUtils/SharedArray.hpp> // for Array, etc
40 #include <map>
41 
42 namespace Nektar
43 {
44 
45 /** \brief The namespace associated with the the StdRegions library
46  * (\ref pageStdRegions "StdRegions introduction")
47  */
48 namespace StdRegions
49 {
51 {
52  // eStdPointExp,
72 };
73 
74 const char *const ElementTypeMap[] = {
75  //"StdPointExp",
76  "StdSegExp", "SegExp", "StdQuadExp", "StdTriExp", "StdNodalTriExp",
77  "QuadExp", "TriExp", "NodalTriExp", "StdHexExp", "StdPrismExp",
78  "StdPyrExp", "StdTetExp", "StdNodalTetExp", "HexExp", "PrismExp",
79  "PyrExp", "TetExp", "NodalTetExp",
80 };
81 
82 /** @todo we need to tidy up matrix construction approach
83  * probably using a factory type approach */
85 {
138 };
139 
140 const char *const MatrixTypeMap[] = {"Mass",
141  "Mass wiht Diagonal GJP",
142  "InvMass",
143  "Laplacian",
144  "Laplacian00",
145  "Laplacian01",
146  "Laplacian02",
147  "Laplacian10",
148  "Laplacian11",
149  "Laplacian12",
150  "Laplacian20",
151  "Laplacian21",
152  "Laplacian22",
153  "InvLaplacianWithUnityMean",
154  "WeakDeriv0",
155  "WeakDeriv1",
156  "WeakDeriv2",
157  "WeakDirectionalDeriv",
158  "MassLevelCurvature",
159  "LinearAdvectionReaction",
160  "LinearAdvectionDiffusionReaction",
161  "NBasisTrans",
162  "InvNBasisTrans",
163  "BwdTrans",
164  "BwdMat",
165  "IProductWRTBase",
166  "IProductWRTDerivBase0",
167  "IProductWRTDerivBase1",
168  "IProductWRTDerivBase2",
169  "DerivBase0",
170  "DerivBase1",
171  "DerivBase2",
172  "Helmholtz",
173  "Helmholtz with Diagonal GJP",
174  "HybridDGHelmholz",
175  "InvHybridDGHelmholtz",
176  "HybridDGHelmBndLam",
177  "HybridDGLamToQ0",
178  "HybridDGLamToQ1",
179  "HybridDGLamToQ2",
180  "HybridDGLamToU",
181  "FwdTrans",
182  "PreconR",
183  "PreconRMass",
184  "PreconLinearSpace",
185  "PreconLinearSpaceMass",
186  "InterpGauss",
187  "GaussDG",
188  "PhysInterpToEquiSpaced",
189  "EquiSpacedToCoeffs",
190  "NormDerivOnTrace"};
191 
193 {
226 };
227 
228 const char *const VarCoeffTypeMap[] = {
229  "VarCoeffMass", "VarCoeffLaplacian", "VarCoeffWeakDeriv",
230  "VarCoeffD00", "VarCoeffD11", "VarCoeffD22",
231  "VarCoeffD01", "VarCoeffD02", "VarCoeffD12",
232  "VarCoeffVelX", "VarCoeffVelY", "VarCoeffVelZ",
233  "VarCoeffMF1x", "VarCoeffMF1y", "VarCoeffMF1z",
234  "VarCoeffMF1Div", "VarCoeffMF1Mag", "VarCoeffMF2x",
235  "VarCoeffMF2y", "VarCoeffMF2z", "VarCoeffMF2Div",
236  "VarCoeffMF2Mag", "VarCoeffMF3x", "VarCoeffMF3y",
237  "VarCoeffMF3z", "VarCoeffMF3Div", "VarCoeffMF3Mag",
238  "VarCoeffMF", "VarCoeffMFDiv", "VarCoeffGmat",
239  "VarCoeffGJPNormVel"};
240 typedef std::map<StdRegions::VarCoeffType, Array<OneD, NekDouble>> VarCoeffMap;
242 
244 {
263 };
264 
265 const char *const ConstFactorTypeMap[] = {"FactorLambda",
266  "FactorCoeffD00",
267  "FactorCoeffD11",
268  "FactorCoeffD22",
269  "FactorCoeffD01",
270  "FactorCoeffD02",
271  "FactorCoeffD12",
272  "FactorTau",
273  "FactorTime",
274  "FactorSVVCutoffRatio",
275  "FactorSVVDiffCoeff",
276  "FactorSVVPowerKerDiffCoeff",
277  "FactorSVVDGKerDiffCoeff",
278  "FactorGaussVertex",
279  "FactorGaussEdge",
280  "FactorGJP",
281  "FactorConstant"};
282 typedef std::map<ConstFactorType, NekDouble> ConstFactorMap;
284 
285 // FactorMap
288 
290 {
296  eDir1FwdDir1_Dir2FwdDir2, // These flags are interpreted as
297  eDir1FwdDir1_Dir2BwdDir2, // taking the second direction to the
298  eDir1BwdDir1_Dir2FwdDir2, // first direction. So Dir1FwdDir2 takes
299  eDir1BwdDir1_Dir2BwdDir2, // direction 2 and makes it backward
300  eDir1FwdDir2_Dir2FwdDir1, // to direction 1 in the mapped face.
301  eDir1FwdDir2_Dir2BwdDir1, // Note be careful not to flip this
302  eDir1BwdDir2_Dir2FwdDir1, // convention especially when using
303  eDir1BwdDir2_Dir2BwdDir1, // transposed mappings.
305 };
306 
307 const char *const OrientationMap[] = {"NoOrientation",
308  "Fwd",
309  "Bwd",
310  "Forwards",
311  "Backwards",
312  "Dir1FwdDir1_Dir2FwdDir2",
313  "Dir1FwdDir1_Dir2BwdDir2",
314  "Dir1BwdDir1_Dir2FwdDir2",
315  "Dir1BwdDir1_Dir2BwdDir2",
316  "Dir1FwdDir2_Dir2FwdDir1",
317  "Dir1FwdDir2_Dir2BwdDir1",
318  "Dir1BwdDir2_Dir2FwdDir1",
319  "Dir1BwdDir2_Dir2BwdDir1"};
320 
321 // Defines a "fast find"
322 // Assumes that first/last define the beginning/ending of
323 // a continuous range of classes, and that start is
324 // an iterator between first and last
325 
326 template <class InputIterator, class EqualityComparable>
327 InputIterator find(InputIterator first, InputIterator last,
328  InputIterator startingpoint, const EqualityComparable &value)
329 {
330  InputIterator val;
331 
332  if (startingpoint == first)
333  {
334  val = find(first, last, value);
335  }
336  else
337  {
338  val = find(startingpoint, last, value);
339  if (val == last)
340  {
341  val = find(first, startingpoint, value);
342  if (val == startingpoint)
343  {
344  val = last;
345  }
346  }
347  }
348  return val;
349 }
350 
351 // Optimized Kernel Entries
352 const int kSVVDGFiltermodesmin = 3;
353 const int kSVVDGFiltermodesmax = 11;
354 // Optimized Kernel Entries for p = 2 - 10
355 const NekDouble kSVVDGFilter[9][11] = {
356  {0, 0.36212, 1, 0, 0, 0, 0, 0, 0, 0, 0},
357  {0, 0.70546, 0.078836, 1, 0, 0, 0, 0, 0, 0, 0},
358  {0, 0, 0.49411, 0.072394, 1, 0, 0, 0, 0, 0, 0},
359  {0, 0, 0.000073566, 0.40506, 0.094122, 1, 0, 0, 0, 0, 0},
360  {0, 0, 0, 0.0001422, 0.36863, 0.11815, 1, 0, 0, 0, 0},
361  {0, 0, 0, 0, 0.00019497, 0.41397, 0.16927, 1, 0, 0, 0},
362  {0, 0, 0, 0, 0, 0.0009762, 0.12747, 0.13763, 1, 0, 0},
363  {0, 0, 0, 0, 0, 0, 0.0023592, 0.23683, 0.17196, 1, 0},
364  {0, 0, 0, 0, 0, 0, 0, 0.0026055, 0.28682, 0.22473, 1}};
365 
366 } // namespace StdRegions
367 } // namespace Nektar
368 
369 #endif // STDREGIONS_H
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Definition: StdRegions.hpp:327
const int kSVVDGFiltermodesmin
Definition: StdRegions.hpp:352
static FactorMap NullFactorMap
Definition: StdRegions.hpp:287
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:240
const char *const VarCoeffTypeMap[]
Definition: StdRegions.hpp:228
const int kSVVDGFiltermodesmax
Definition: StdRegions.hpp:353
const NekDouble kSVVDGFilter[9][11]
Definition: StdRegions.hpp:355
const char *const ConstFactorTypeMap[]
Definition: StdRegions.hpp:265
const char *const ElementTypeMap[]
Definition: StdRegions.hpp:74
const char *const MatrixTypeMap[]
Definition: StdRegions.hpp:140
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:282
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:283
const char *const OrientationMap[]
Definition: StdRegions.hpp:307
ConstFactorMap FactorMap
Definition: StdRegions.hpp:286
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:241
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
double NekDouble