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 // 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: Definition of enum lists and constants
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef STDREGIONS_HPP
37 #define STDREGIONS_HPP
38 
39 
40 #include<map>
41 #include <LibUtilities/BasicUtils/SharedArray.hpp> // for Array, etc
43 
44 namespace Nektar
45 {
46 
47  /** \brief The namespace associated with the the StdRegions library
48  * (\ref pageStdRegions "StdRegions introduction")
49  */
50  namespace StdRegions
51  {
53  {
54  //eStdPointExp,
74  };
75 
76  const char* const ElementTypeMap[] =
77  {
78  //"StdPointExp",
79  "StdSegExp",
80  "SegExp",
81  "StdQuadExp",
82  "StdTriExp",
83  "StdNodalTriExp",
84  "QuadExp",
85  "TriExp",
86  "NodalTriExp",
87  "StdHexExp",
88  "StdPrismExp",
89  "StdPyrExp",
90  "StdTetExp",
91  "StdNodalTetExp",
92  "HexExp",
93  "PrismExp",
94  "PyrExp",
95  "TetExp",
96  "NodalTetExp",
97  };
98 
99  /** @todo we need to tidy up matrix construction approach
100  * probably using a factory type approach */
102  {
149  };
150 
151  const char* const MatrixTypeMap[] =
152  {
153  "Mass",
154  "InvMass",
155  "Laplacian",
156  "Laplacian00",
157  "Laplacian01",
158  "Laplacian02",
159  "Laplacian10",
160  "Laplacian11",
161  "Laplacian12",
162  "Laplacian20",
163  "Laplacian21",
164  "Laplacian22",
165  "InvLaplacianWithUnityMean",
166  "WeakDeriv0",
167  "WeakDeriv1",
168  "WeakDeriv2",
169  "WeakDirectionalDeriv",
170  "MassLevelCurvature",
171  "LinearAdvectionReaction",
172  "LinearAdvectionDiffusionReaction",
173  "NBasisTrans",
174  "InvNBasisTrans",
175  "BwdTrans",
176  "IProductWRTBase",
177  "IProductWRTDerivBase0",
178  "IProductWRTDerivBase1",
179  "IProductWRTDerivBase2",
180  "Helmholtz",
181  "HybridDGHelmholz",
182  "InvHybridDGHelmholtz",
183  "HybridDGHelmBndLam",
184  "HybridDGLamToQ0",
185  "HybridDGLamToQ1",
186  "HybridDGLamToQ2",
187  "HybridDGLamToU",
188  "FwdTrans",
189  "PreconR",
190  "PreconRT",
191  "PreconLinearSpace",
192  "InterpGauss",
193  "GaussDG",
194  "PhysInterpToEquiSpaced"
195  };
196 
198  {
210  };
211 
212  const char* const VarCoeffTypeMap[] = {
213  "VarCoeffMass",
214  "VarCoeffLaplacian",
215  "VarCoeffWeakDeriv",
216  "VarCoeffD00",
217  "VarCoeffD11",
218  "VarCoeffD22",
219  "VarCoeffD01",
220  "VarCoeffD02",
221  "VarCoeffD12",
222  "VarCoeffVelX",
223  "VarCoeffVelY"
224  };
225  typedef std::map<StdRegions::VarCoeffType, Array<OneD, NekDouble> > VarCoeffMap;
226  static VarCoeffMap NullVarCoeffMap;
227 
229  {
237  };
238 
239  const char* const ConstFactorTypeMap[] = {
240  "FactorLambda",
241  "FactorTau",
242  "FactorTime",
243  "FactorSVVCutoffRatio",
244  "FactorSVVDiffCoeff",
245  "FactorGaussVertex",
246  "FactorGaussEdge"
247  };
248  typedef std::map<ConstFactorType, NekDouble> ConstFactorMap;
249  static ConstFactorMap NullConstFactorMap;
250 
252  {
259  };
260 
261  const char* const IndexMapTypeMap[] =
262  {
263  "EdgeToElement",
264  "FaceToElement",
265  "EdgeInterior",
266  "FaceInterior",
267  "Boundary",
268  "Vertex"
269  };
270 
272  {
278  eDir1FwdDir1_Dir2FwdDir2, // These flags are interpreted as
279  eDir1FwdDir1_Dir2BwdDir2, // taking the second direction to the
280  eDir1BwdDir1_Dir2FwdDir2, // first direction. So Dir1FwdDir2 takes
281  eDir1BwdDir1_Dir2BwdDir2, // direction 2 and makes it backward
282  eDir1FwdDir2_Dir2FwdDir1, // to direction 1 in the mapped face.
283  eDir1FwdDir2_Dir2BwdDir1, // Note be careful not to flip this
284  eDir1BwdDir2_Dir2FwdDir1, // convention especially when using
285  eDir1BwdDir2_Dir2BwdDir1, // transposed mappings.
287  };
288 
289  const char* const OrientationMap[] =
290  {
291  "NoOrientation",
292  "Fwd",
293  "Bwd",
294  "Forwards",
295  "Backwards",
296  "Dir1FwdDir1_Dir2FwdDir2",
297  "Dir1FwdDir1_Dir2BwdDir2",
298  "Dir1BwdDir1_Dir2FwdDir2",
299  "Dir1BwdDir1_Dir2BwdDir2",
300  "Dir1FwdDir2_Dir2FwdDir1",
301  "Dir1FwdDir2_Dir2BwdDir1",
302  "Dir1BwdDir2_Dir2FwdDir1",
303  "Dir1BwdDir2_Dir2BwdDir1"
304  };
305 
306  // Defines a "fast find"
307  // Assumes that first/last define the beginning/ending of
308  // a continuous range of classes, and that start is
309  // an iterator between first and last
310 
311  template<class InputIterator, class EqualityComparable>
312  InputIterator find(InputIterator first, InputIterator last,
313  InputIterator startingpoint,
314  const EqualityComparable& value)
315  {
316  InputIterator val;
317 
318  if(startingpoint == first)
319  {
320  val = find(first,last,value);
321  }
322  else
323  {
324  val = find(startingpoint,last,value);
325  if(val == last)
326  {
327  val = find(first,startingpoint,value);
328  if(val == startingpoint)
329  {
330  val = last;
331  }
332  }
333  }
334  return val;
335  }
336 
337  } // end of namespace
338 } // end of namespace
339 
340 #endif //STDREGIONS_H
341 
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:248
const char *const ConstFactorTypeMap[]
Definition: StdRegions.hpp:239
const char *const IndexMapTypeMap[]
Definition: StdRegions.hpp:261
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:225
const char *const MatrixTypeMap[]
Definition: StdRegions.hpp:151
const char *const ElementTypeMap[]
Definition: StdRegions.hpp:76
const char *const OrientationMap[]
Definition: StdRegions.hpp:289
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Definition: StdRegions.hpp:312
const char *const VarCoeffTypeMap[]
Definition: StdRegions.hpp:212
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:226
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:249