Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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  {
148  };
149 
150  const char* const MatrixTypeMap[] =
151  {
152  "Mass",
153  "InvMass",
154  "Laplacian",
155  "Laplacian00",
156  "Laplacian01",
157  "Laplacian02",
158  "Laplacian10",
159  "Laplacian11",
160  "Laplacian12",
161  "Laplacian20",
162  "Laplacian21",
163  "Laplacian22",
164  "InvLaplacianWithUnityMean",
165  "WeakDeriv0",
166  "WeakDeriv1",
167  "WeakDeriv2",
168  "WeakDirectionalDeriv",
169  "MassLevelCurvature",
170  "LinearAdvectionReaction",
171  "LinearAdvectionDiffusionReaction",
172  "NBasisTrans",
173  "InvNBasisTrans",
174  "BwdTrans",
175  "IProductWRTBase",
176  "IProductWRTDerivBase0",
177  "IProductWRTDerivBase1",
178  "IProductWRTDerivBase2",
179  "Helmholtz",
180  "HybridDGHelmholz",
181  "InvHybridDGHelmholtz",
182  "HybridDGHelmBndLam",
183  "HybridDGLamToQ0",
184  "HybridDGLamToQ1",
185  "HybridDGLamToQ2",
186  "HybridDGLamToU",
187  "FwdTrans",
188  "PreconR",
189  "PreconRT",
190  "PreconLinearSpace",
191  "InterpGauss",
192  "GaussDG"
193  };
194 
196  {
208  };
209 
210  const char* const VarCoeffTypeMap[] = {
211  "VarCoeffMass",
212  "VarCoeffLaplacian",
213  "VarCoeffWeakDeriv",
214  "VarCoeffD00",
215  "VarCoeffD11",
216  "VarCoeffD22",
217  "VarCoeffD01",
218  "VarCoeffD02",
219  "VarCoeffD12",
220  "VarCoeffVelX",
221  "VarCoeffVelY"
222  };
223  typedef std::map<StdRegions::VarCoeffType, Array<OneD, NekDouble> > VarCoeffMap;
225 
227  {
235  };
236 
237  const char* const ConstFactorTypeMap[] = {
238  "FactorLambda",
239  "FactorTau",
240  "FactorTime",
241  "FactorSVVCutoffRatio",
242  "FactorSVVDiffCoeff",
243  "FactorGaussVertex",
244  "FactorGaussEdge"
245  };
246  typedef std::map<ConstFactorType, NekDouble> ConstFactorMap;
248 
250  {
257  };
258 
259  const char* const IndexMapTypeMap[] =
260  {
261  "EdgeToElement",
262  "FaceToElement",
263  "EdgeInterior",
264  "FaceInterior",
265  "Boundary",
266  "Vertex"
267  };
268 
270  {
276  eDir1FwdDir1_Dir2FwdDir2, // These flags are interpreted as
277  eDir1FwdDir1_Dir2BwdDir2, // taking the second direction to the
278  eDir1BwdDir1_Dir2FwdDir2, // first direction. So Dir1FwdDir2 takes
279  eDir1BwdDir1_Dir2BwdDir2, // direction 2 and makes it backward
280  eDir1FwdDir2_Dir2FwdDir1, // to direction 1 in the mapped face.
281  eDir1FwdDir2_Dir2BwdDir1, // Note be careful not to flip this
282  eDir1BwdDir2_Dir2FwdDir1, // convention especially when using
283  eDir1BwdDir2_Dir2BwdDir1, // transposed mappings.
285  };
286 
287  const char* const OrientationMap[] =
288  {
289  "NoOrientation",
290  "Fwd",
291  "Bwd",
292  "Forwards",
293  "Backwards",
294  "Dir1FwdDir1_Dir2FwdDir2",
295  "Dir1FwdDir1_Dir2BwdDir2",
296  "Dir1BwdDir1_Dir2FwdDir2",
297  "Dir1BwdDir1_Dir2BwdDir2",
298  "Dir1FwdDir2_Dir2FwdDir1",
299  "Dir1FwdDir2_Dir2BwdDir1",
300  "Dir1BwdDir2_Dir2FwdDir1",
301  "Dir1BwdDir2_Dir2BwdDir1"
302  };
303 
304  // Defines a "fast find"
305  // Assumes that first/last define the beginning/ending of
306  // a continuous range of classes, and that start is
307  // an iterator between first and last
308 
309  template<class InputIterator, class EqualityComparable>
310  InputIterator find(InputIterator first, InputIterator last,
311  InputIterator startingpoint,
312  const EqualityComparable& value)
313  {
314  InputIterator val;
315 
316  if(startingpoint == first)
317  {
318  val = find(first,last,value);
319  }
320  else
321  {
322  val = find(startingpoint,last,value);
323  if(val == last)
324  {
325  val = find(first,startingpoint,value);
326  if(val == startingpoint)
327  {
328  val = last;
329  }
330  }
331  }
332  return val;
333  }
334 
335  } // end of namespace
336 } // end of namespace
337 
338 #endif //STDREGIONS_H
339