LifeV
ElementShapes.hpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  @file
29  @brief Contains the basic element shapes, to be used by Geometric
30  and Finite Elements
31 
32  @author Luca Formaggia
33  @contributor Zhen Wang <zwang26@emory.edu>
34  @contributor Tiziano Passerini <tiziano@mathcs.emory.edu>
35 
36  These classes provide the most basic definitions for the geometric
37  elements. The variables names are self-explanatory.
38 
39  The Basis Geometric Shapes (<tt>GeoShape</tt>) are derived from a set of
40  classes called Basis Reference Shapes (<tt>BasRefSha</tt>), which contains
41  the very basic information about the reference element geometries
42  supported by the library (reference element geometry=geometry of the
43  finite element in the reference space.)
44 
45  A Basis Geometric Shape contains (when relevant) the following methods
46  <ol>
47  <li> <tt>static ID edgeToPoint(ID const jEdge, ID const iPoint);</tt>
48  which returns the local ID of the i-th point of the j-th edge of the GeoShape
49 
50  <li> <tt>static ID faceToPoint(ID const jFace, ID const iPoint);</tt>
51  which returns the local ID of the i-th point of the j-th face of the GeoShape
52 
53  <li> <tt>static pair<ID,bool> faceToEdge(ID const jFace, ID const iEdge);</tt>
54  which returns the local numbering of the i-th edge on the j-th face.
55  It returns also if the orientation of the edge on the face is consistent
56  with that of the same edge on the element
57  </ol>
58 
59  @note The methods edge to point-ID (EtoP) and Face to point-ID (FtoP)
60  return the local id number of points on faces and edges (when relevant)
61  @note We follow the convention of indicating THE VERTICES FIRST in the list
62  of dofs
63  */
64 
65 #ifndef ELEMENTSHAPES_H
66 #define ELEMENTSHAPES_H 1
67 
68 #include <utility>
69 #include <lifev/core/LifeV.hpp>
70 
71 namespace LifeV
72 {
73 //! A utility to invert point numbering on a GeoShape
74 /*!
75  * It must be specialised for the specific GeoShape since the inverse ordering
76  * depends on how points are numbered in the actual GeoShape.
77  * This utility is meant to be used only by procedures that build a mesh, since it operates on
78  * basic mesh structures. It can be dangerous to use, for instance, after a full mesh has been set up.
79  * It is useful to invert faces or edges which are incorrectly oriented or to fix a mesh produced by a mesher
80  * which uses a different orientation convention.
81  *
82  * @param pointId Elemental local id of a point of the GeoShape
83  * @return the (local) ID of the corresponding point in the reversed GeoShape
84  */
85 template <typename GeoShapeType>
86 inline ID reversePoint ( ID const& pointId );
87 
88 // *********** BASIS REFERENCE SHAPES ****************
89 
90 /*! @enum ReferenceShapes
91  Lists of the geometries of the finite element in the reference space,
92  supported by the library
93 
94 enum ReferenceShapes
95 {
96  NONE, POINT, LINE, TRIANGLE, QUAD, HEXA, PRISM, TETRA
97 };
98  */
99 // deprecated name
101 {
103 };
104 
105 
106 //!
107 /*!
108  @param shape a shape identifier
109  @return the geometric dimension of the shape
110  @sa ReferenceShapes
111  */
112 UInt shapeDimension (const ReferenceShapes& shape);
113 
114 
115 /*! @enum ReferenceGeometry
116  Lists of the geometric items used to build the shapes.
117 
118 enum ReferenceGeometry
119 {
120  VERTEX = 0, EDGE = 1, FACE = 2, VOLUME = 3
121 };
122  */
123 // deprecated name
125 {
126  VERTEX = 0, EDGE = 1, FACE = 2, VOLUME = 3
127 };
128 
129 
130 //! @defgroup BasRefSha Basis Reference Shapes
131 
132 //! @ingroup BasRefSha
134 {
135 public:
137 };
138 
139 
140 //! dummy class for selecting correct function specializations based on geometry dimensions (1,2,3).
141 template<int geoDimensions>
142 class GeoDim {};
143 
144 
145 //! @ingroup BasRefSha
146 class Point
147 {
148 public:
149  static const ReferenceShapes S_shape = POINT; //!< Identify the shape
150  static const ReferenceGeometry S_geometry = VERTEX;//!< Identify the geometric entity
151  static const UInt S_nDimensions = 0; //!< Dimensionality
152  static const UInt S_numFaces = 0; //!< Number of faces
153  static const UInt S_numEdges = 0; //!< Number of edges
154  static const UInt S_numVertices = 1; //!< Number of vertices.
155  static const UInt S_numFacets = 0; //!< Number of facets
156  static const UInt S_numRidges = 0; //!< Number of ridges
157  static const UInt S_numPeaks = 0; //!< Number of peaks
158 
159  //! @return the local ID of the j-th point of the i-th edge
160  static ID edgeToPoint ( ID const& /*iEdge*/, ID const& /*jPoint*/ )
161  {
162  ERROR_MSG ( "edgeToPoint not implemented for geo Point elements." );
163  return static_cast<ID> (0);
164  }
165 };
166 
167 
168 //! @ingroup BasRefSha
169 class Line
170 {
171 public:
172  static const ReferenceShapes S_shape = LINE; //!< Identify the shape
173  static const ReferenceGeometry S_geometry = EDGE;//!< Identify the geometric entity
174  static const UInt S_nDimensions = 1; //!< Dimensionality
175  static const UInt S_numFaces = 0; //!< Number of faces
176  static const UInt S_numEdges = 1; //!< Number of edges
177  static const UInt S_numVertices = 2; //!< Number of vertices.
178  static const UInt S_numFacets = S_numVertices; //!< Number of facets
179  static const UInt S_numRidges = 0; //!< Number of ridges
180  static const UInt S_numPeaks = 0; //!< Number of peaks
181 
182  //! @return the local ID of the j-th point of the i-th edge
183  static ID edgeToPoint ( ID const& /*iEdge*/, ID const& jPoint )
184  {
185  return jPoint;
186  }
187 
188  //! @return the local ID of the j-th point of the i-th facet
189  static ID facetToPoint ( ID const& iFacet, ID const& /*jPoint*/ )
190  {
191  return iFacet;
192  }
193 
194  static ID facetToRidge ( ID const& /*iFacet*/, ID const& /*jRidge*/ )
195  {
196  return NotAnId;
197  }
198 
199  static ID facetToPeak ( ID const& /*iFacet*/, ID const& /*jPeak*/ )
200  {
201  return NotAnId;
202  }
203 
204  static std::pair<ID, bool> faceToEdge ( ID const& /*iFace*/, ID const& /*jEdge*/ )
205  {
206  ERROR_MSG ( "FaceToEdge not implemented for geo Line elements." );
207  return std::make_pair ( static_cast<ID> (0), true );
208  }
209 };
210 
211 
212 //! @ingroup BasRefSha
213 class Triangle
214 {
215 public:
216  static const ReferenceShapes S_shape = TRIANGLE; //!< Identify the shape
217  static const ReferenceGeometry S_geometry = FACE;//!< Identify the geometric entity
218  static const UInt S_nDimensions = 2; //!< Dimensionality
219  static const UInt S_numVertices = 3; //!< Number of vertices.
220  static const UInt S_numEdges = 3; //!< Number of edges
221  static const UInt S_numFaces = 1; //!< Number of faces
222  static const UInt S_numFacets = S_numEdges; //!< Number of facets
223  static const UInt S_numRidges = S_numVertices; //!< Number of ridges
224  static const UInt S_numPeaks = 0; //!< Number of peaks
225 
226  //! @return the local ID of the j-th point of the i-th face
227  static ID faceToPoint ( ID const& /*iFace*/, ID const& jPoint )
228  {
229  return jPoint;
230  };
231 
232  /*!
233  @return a pair: the local numbering of the j-th edge on the i-th face, and
234  true if the orientation of the edge on the face is consistent
235  with that of the same edge on the element
236  */
237  static std::pair<ID, bool> faceToEdge ( ID const& /*iFace*/, ID const& jEdge )
238  {
239  return std::make_pair ( jEdge, true );
240  }
241 
242  static ID facetToPeak ( ID const& /*iFacet*/, ID const& /*jPeak*/ )
243  {
244  return NotAnId;
245  }
246 };
247 
248 
249 //! @ingroup BasRefSha
250 class Quad
251 {
252 public:
253  static const ReferenceShapes S_shape = QUAD; //!< Identify the shape
254  static const ReferenceGeometry S_geometry = FACE;//!< Identify the geometric entity
255  static const UInt S_nDimensions = 2; //!< Dimensionality
256  static const UInt S_numFaces = 1; //!< Number of faces
257  static const UInt S_numVertices = 4; //!< Number of vertices.
258  static const UInt S_numEdges = 4; //!< Number of edges
259  static const UInt S_numFacets = S_numEdges; //!< Number of facets
260  static const UInt S_numRidges = S_numVertices; //!< Number of ridges
261  static const UInt S_numPeaks = 0; //!< Number of peaks
262 
263  //! @return the local ID of the j-th point of the i-th face
264  static ID faceToPoint ( ID const& /*iFace*/, ID const& jPoint )
265  {
266  return jPoint;
267  };
268 
269  /*!
270  @return a pair: the local numbering of the j-th edge on the i-th face, and
271  true if the orientation of the edge on the face is consistent
272  with that of the same edge on the element
273  */
274  static std::pair<ID, bool> faceToEdge ( ID const& /*iFace*/, ID const& jEdge )
275  {
276  return std::make_pair ( jEdge, true );
277  }
278 
279  static ID facetToPeak ( ID const& /*iFacet*/, ID const& /*jPeak*/ )
280  {
281  return NotAnId;
282  }
283 };
284 
285 
286 //! @ingroup BasRefSha
287 class Tetra
288 {
289 public:
290  static const ReferenceShapes S_shape = TETRA; //!< Identify the shape
291  static const ReferenceGeometry S_geometry = VOLUME; //!< Identify the geometric entity
292  static const UInt S_nDimensions = 3; //!< Dimensionality
293  static const UInt S_numVertices = 4; //!< Number of vertices.
294  static const UInt S_numFaces = 4; //!< Number of faces
295  static const UInt S_numEdges = S_numFaces + S_numVertices - 2;//!< Number of edges
296  static const UInt S_numFacets = S_numFaces; //!< Number of facets
297  static const UInt S_numRidges = S_numEdges; //!< Number of ridges
298  static const UInt S_numPeaks = S_numVertices; //!< Number of peaks
299 
300  /*!
301  @return a pair: the local numbering of the j-th edge on the i-th face, and
302  true if the orientation of the edge on the face is consistent
303  with that of the same edge on the element
304  */
305  static std::pair<ID, bool> faceToEdge ( ID const& iFace, ID const& jEdge );
306 };
307 
308 
309 //! @ingroup BasRefSha
310 class Hexa
311 {
312 public:
313  static const ReferenceShapes S_shape = HEXA; //!< Identify the shape
314  static const ReferenceGeometry S_geometry = VOLUME; //!< Identify the geometric entity
315  static const UInt S_nDimensions = 3; //!< Dimensionality
316  static const UInt S_numFaces = 6; //!< Number of faces
317  static const UInt S_numVertices = 8; //!< Number of vertices.
318  static const UInt S_numEdges = S_numFaces + S_numVertices - 2;//!< Number of edges
319  static const UInt S_numFacets = S_numFaces; //!< Number of facets
320  static const UInt S_numRidges = S_numEdges; //!< Number of ridges
321  static const UInt S_numPeaks = S_numVertices; //!< Number of peaks
322 
323  /*!
324  @return a pair: the local numbering of the j-th edge on the i-th face, and
325  true if the orientation of the edge on the face is consistent
326  with that of the same edge on the element
327  */
328  static std::pair<ID, bool> faceToEdge ( ID const& iFace, ID const& jEdge );
329 
330 };
331 
332 
333 /*
334  Now the Basis Geometric Shapes, derived from the Reference Shapes
335  */
336 //! @defgroup GeoShape Basis Geometric Shapes
337 
338 // Forward Declarations.
339 class GeoPoint;
340 class LinearLine;
341 class QuadraticLine;
342 class LinearTriangle;
343 class QuadraticTriangle;
344 class LinearQuad;
345 class QuadraticQuad;
346 class LinearTetra;
347 class LinearTetraBubble;
348 class QuadraticTetra;
349 class LinearHexa;
350 class QuadraticHexa;
351 
352 
353 //! @ingroup GeoShape
354 //! A Geometric Shape
355 class GeoPoint:
356  public Point
357 {
358 public:
359  //! @name Public Types
360  //@{
361  typedef Point BasRefSha;
362  typedef nullShape GeoBShape; //!< Geometric shape of the boundary
363  //@}
364  static const UInt S_numPoints = 1; //!< Number of points
365  static const UInt S_numPointsPerElement = 1; //!< Number of points per element
366  static const UInt S_numPointsPerFacet = 0; //!< Number of points per facet
367  static const UInt S_numPointsPerRidge = 0; //!< Number of points per ridge
368  static const UInt S_numPointsPerPeak = 0; //!< Number of points per peak
369 
370 };
371 
372 
373 //! @ingroup GeoShape
374 //! A Geometric Shape
376  public Line
377 {
378 public:
379  //! @name Public Types
380  //@{
381  typedef Line BasRefSha;
382  typedef GeoPoint GeoBShape; //!< Geometric shape of the boundary
383  //@}
384  static const UInt S_numPoints = 2; //!< Number of points
385  static const UInt S_numPointsPerEdge = 0; //!< Number of points per edge
386  static const UInt S_numPointsPerVertex = 1; //!< Number of points per vertex
387  static const UInt S_numPointsPerElement = S_numPointsPerEdge; //!< Number of points per element
388  static const UInt S_numPointsPerFacet = S_numPointsPerVertex; //!< Number of points per facet
389  static const UInt S_numPointsPerRidge = 0; //!< Number of points per ridge
390  static const UInt S_numPointsPerPeak = 0; //!< Number of points per peak
391 };
392 //! Inverts a line
393 template <>
394 inline ID reversePoint<LinearLine> ( ID const& pointId )
395 {
396  static ID _rid[] = {1, 0};
397  return _rid[pointId];
398 }
399 
400 
401 //! @ingroup GeoShape
402 //! A Geometric Shape
404  public Line
405 {
406 public:
407  //! @name Public Types
408  //@{
409  typedef Line BasRefSha;
410  typedef GeoPoint GeoBShape; //!< Geometric shape of the boundary
411  //@}
412  static const UInt S_numPoints = 3; //!< Number of points
413  static const UInt S_numPointsPerEdge = 1; //!< Number of points per edge
414  static const UInt S_numPointsPerVertex = 1; //!< Number of points per vertex
415  static const UInt S_numPointsPerElement = S_numPointsPerEdge; //!< Number of points per element
416  static const UInt S_numPointsPerFacet = S_numPointsPerVertex; //!< Number of points per facet
417  static const UInt S_numPointsPerRidge = 0; //!< Number of points per ridge
418  static const UInt S_numPointsPerPeak = 0; //!< Number of points per peak
419 
420 };
421 
422 template <>
423 inline ID reversePoint<QuadraticLine> ( ID const& pointId )
424 {
425  static ID _rid[] = {1, 0, 2};
426  return _rid[pointId];
427 }
428 
429 
430 //! @ingroup GeoShape
431 //! A Geometric Shape
433  public Triangle
434 {
435 public:
436  //! @name Public Types
437  //@{
440  //@}
441  static const UInt S_numPoints = 3; //!< Number of points
442  static const UInt S_numPointsPerVertex = 1; //!< Number of points per vertex
443  static const UInt S_numPointsPerEdge = 0; //!< Number of points per edge
444  static const UInt S_numPointsPerFace = 0; //!< Number of points per face
445  static const UInt S_numPointsPerElement = S_numPointsPerFace; //!< Number of points per element
446  static const UInt S_numPointsPerFacet = S_numPointsPerEdge; //!< Number of points per facet
447  static const UInt S_numPointsPerRidge = S_numPointsPerVertex; //!< Number of points per ridge
448  static const UInt S_numPointsPerPeak = 0; //!< Number of points per peak
449 
450  //! @return the local ID of the j-th point of the i-th edge
451  static ID edgeToPoint ( ID const& iEdge, ID const& jPoint );
452 
453  //! @return the local ID of the j-th point of the i-th facet
454  static ID facetToPoint ( ID const& iFacet, ID const& jPoint )
455  {
456  return edgeToPoint ( iFacet, jPoint );
457  }
458 
459  //! @return the local ID of the j-th ridge of the i-th facet
460  static ID facetToRidge ( ID const& iFacet, ID const& jRidge )
461  {
462  return edgeToPoint (iFacet, jRidge);
463  }
464 };
465 
466 template <>
467 inline ID reversePoint<LinearTriangle> ( ID const& pointId )
468 {
469  static ID _rid[] = {1, 0, 2};
470  return _rid[pointId];
471 }
472 
473 
474 //! @ingroup GeoShape
475 //! A Geometric Shape
477  public Triangle
478 {
479 public:
480  //! @name Public Types
481  //@{
484  //@}
485  static const UInt S_numPoints = 6; //!< Number of points
486  static const UInt S_numPointsPerVertex = 1; //!< Number of points per vertex
487  static const UInt S_numPointsPerEdge = 1; //!< Number of points per edge
488  static const UInt S_numPointsPerFace = 0; //!< Number of points per face
489  static const UInt S_numPointsPerElement = S_numPointsPerFace; //!< Number of points per element
490  static const UInt S_numPointsPerFacet = S_numPointsPerEdge; //!< Number of points per facet
491  static const UInt S_numPointsPerRidge = S_numPointsPerVertex; //!< Number of points per ridge
492  static const UInt S_numPointsPerPeak = 0; //!< Number of points per peak
493 
494 
495  //! @return the local ID of the j-th point of the i-th edge
496  static ID edgeToPoint ( ID const& iEdge, ID const& jPoint );
497  //! @return the local ID of the j-th point of the i-th facet
498  static ID facetToPoint ( ID const& iFacet, ID const& jPoint )
499  {
500  return edgeToPoint ( iFacet, jPoint );
501  }
502  static ID facetToRidge ( ID const& iFacet, ID const& jRidge )
503  {
504  return edgeToPoint (iFacet, jRidge);
505  }
506 };
507 
508 template <>
509 inline ID reversePoint<QuadraticTriangle> ( ID const& pointId )
510 {
511  static ID _rid[] = {1, 0, 2, 3, 5, 4};
512  return _rid[pointId];
513 }
514 
515 
516 //! @ingroup GeoShape
517 //! A Geometric Shape
519  public Quad
520 {
521 public:
522  //! @name Public Types
523  //@{
524  typedef Quad BasRefSha;
526  //@}
527  static const UInt S_numPoints = 4; //!< Number of points
528  static const UInt S_numPointsPerVertex = 1; //!< Number of points per vertex
529  static const UInt S_numPointsPerEdge = 0; //!< Number of points per edge
530  static const UInt S_numPointsPerFace = 0; //!< Number of points per face
531  static const UInt S_numPointsPerElement = S_numPointsPerFace; //!< Number of points per element
532  static const UInt S_numPointsPerFacet = S_numPointsPerEdge; //!< Number of points per facet
533  static const UInt S_numPointsPerRidge = S_numPointsPerVertex; //!< Number of points per ridge
534  static const UInt S_numPointsPerPeak = 0; //!< Number of points per peak
535 
536 
537  //! @return the local ID of the j-th point of the i-th edge
538  static ID edgeToPoint ( ID const& iEdge, ID const& jPoint );
539 
540  //! @return the local ID of the j-th point of the i-th facet
541  static ID facetToPoint ( ID const& iFacet, ID const& jPoint )
542  {
543  return edgeToPoint ( iFacet, jPoint );
544  }
545 
546  //! @return the local ID of the j-th point of the i-th ridge
547  static ID facetToRidge ( ID const& iFacet, ID const& jRidge )
548  {
549  return edgeToPoint (iFacet, jRidge);
550  }
551 };
552 
553 //! Specialization
554 template <>
555 inline ID reversePoint<LinearQuad> ( ID const& pointId )
556 {
557  static ID _rid[] = {3, 2, 1, 0};
558  return _rid[pointId];
559 }
560 
561 
562 //! @ingroup GeoShape
563 //! A Geometric Shape
565  public Quad
566 {
567 public:
568  //! @name Public Types
569  //@{
570  typedef Quad BasRefSha;
572  //@}
573  static const UInt S_numPoints = 9; //!< Number of points
574  static const UInt S_numPointsPerVertex = 1; //!< Number of points per vertex
575  static const UInt S_numPointsPerEdge = 1; //!< Number of points per edge
576  static const UInt S_numPointsPerFace = 1; //!< Number of points per face
577  static const UInt S_numPointsPerElement = S_numPointsPerFace; //!< Number of points per element
578  static const UInt S_numPointsPerFacet = S_numPointsPerEdge; //!< Number of points per facet
579  static const UInt S_numPointsPerRidge = S_numPointsPerVertex; //!< Number of points per ridge
580  static const UInt S_numPointsPerPeak = 0; //!< Number of points per peak
581 
582  //! @return the local ID of the j-th point of the i-th edge
583  static ID edgeToPoint ( ID const& iEdge, ID const& jPoint );
584 
585  //! @return the local ID of the j-th point of the i-th facet
586  static ID facetToPoint ( ID const& iFacet, ID const& jPoint )
587  {
588  return edgeToPoint ( iFacet, jPoint );
589  }
590 
591  //! @return the local ID of the j-th point of the i-th ridge
592  static ID facetToRidge ( ID const& iFacet, ID const& jRidge )
593  {
594  return edgeToPoint (iFacet, jRidge);
595  }
596 };
597 //! Specialization
598 template <>
599 inline ID reversePoint<QuadraticQuad> ( ID const& pointId )
600 {
601  static ID _rid[] = {3, 2, 1, 0, 6, 5, 4, 7, 8};
602  return _rid[pointId];
603 }
604 
605 
606 //! @ingroup GeoShape
607 //! A Geometric Shape
609  public Tetra
610 {
611 public:
612  //! @name Public Types
613  //@{
614  typedef Tetra BasRefSha;
616  //@}
617  static const UInt S_numPoints = 4; //!< Number of points
618  static const UInt S_numPointsPerVertex = 1; //!< Number of points per vertex
619  static const UInt S_numPointsPerEdge = 0; //!< Number of points per edge
620  static const UInt S_numPointsPerFace = 0; //!< Number of points per face
621  static const UInt S_numPointsPerVolume = 0; //!< Number of points per volume
622  static const UInt S_numPointsPerElement = S_numPointsPerVolume; //!< Number of points per element
623  static const UInt S_numPointsPerFacet = S_numPointsPerFace; //!< Number of points per facet
624  static const UInt S_numPointsPerRidge = S_numPointsPerEdge; //!< Number of points per ridge
625  static const UInt S_numPointsPerPeak = S_numPointsPerVertex; //!< Number of points per peak
626 
627  //! @return the local ID of the j-th point of the i-th edge
628  static ID edgeToPoint ( ID const& iEdge, ID const& jPoint );
629 
630  //! @return the local ID of the j-th point of the i-th face
631  static ID faceToPoint ( ID const& iFace, ID const& jPoint );
632 
633  //! @return the local ID of the j-th point of the i-th facet
634  static ID facetToPoint ( ID const& iFacet, ID const& jPoint )
635  {
636  return faceToPoint ( iFacet, jPoint );
637  }
638 
639  //! @return the local ID of the j-th ridge of the i-th facet
640  static ID facetToRidge ( ID const& iFacet, ID const& jRidge )
641  {
642  return faceToEdge (iFacet, jRidge).first;
643  }
644 
645  //! @return the local ID of the j-th peak of the i-th facet
646  static ID facetToPeak ( ID const& iFacet, ID const& jPeak )
647  {
648  return faceToPoint (iFacet, jPeak);
649  }
650 };
651 
652 //! Specialization
653 template <>
654 inline ID reversePoint<LinearTetra> ( ID const& pointId )
655 {
656  static ID _rid[] = {1, 0, 2, 3};
657  return _rid[pointId];
658 }
659 
660 
661 //! @ingroup GeoShape
662 //! A Geometric Shape
664  public Tetra
665 {
666 public:
667  //! @name Public Types
668  //@{
669  typedef Tetra BasRefSha;
671  //@}
672  static const UInt S_numPoints = 5; //!< Number of points
673  static const UInt S_numPointsPerVertex = 1; //!< Number of points per vertex
674  static const UInt S_numPointsPerEdge = 0; //!< Number of points per edge
675  static const UInt S_numPointsPerFace = 0; //!< Number of points per face
676  static const UInt S_numPointsPerVolume = 1; //!< Number of points per volume
677  static const UInt S_numPointsPerElement = S_numPointsPerVolume; //!< Number of points per element
678  static const UInt S_numPointsPerFacet = S_numPointsPerFace; //!< Number of points per facet
679  static const UInt S_numPointsPerRidge = S_numPointsPerEdge; //!< Number of points per ridge
680  static const UInt S_numPointsPerPeak = S_numPointsPerVertex; //!< Number of points per peak
681 
682  //! @return the local ID of the j-th point of the i-th edge
683  static ID edgeToPoint ( ID const& iEdge, ID const& jPoint );
684 
685  //! @return the local ID of the j-th point of the i-th face
686  static ID faceToPoint ( ID const& iFace, ID const& jPoint );
687 
688  //! @return the local ID of the j-th point of the i-th facet
689  static ID facetToPoint ( ID const& iFacet, ID const& jPoint )
690  {
691  return faceToPoint ( iFacet, jPoint );
692  }
693 
694  //! @return the local ID of the j-th ridge of the i-th facet
695  static ID facetToRidge ( ID const& iFacet, ID const& jRidge )
696  {
697  return faceToEdge (iFacet, jRidge).first;
698  }
699 
700  //! @return the local ID of the j-th peak of the i-th facet
701  static ID facetToPeak ( ID const& iFacet, ID const& jPeak )
702  {
703  return faceToPoint (iFacet, jPeak);
704  }
705 };
706 
707 template <>
708 inline ID reversePoint<LinearTetraBubble> ( ID const& pointId )
709 {
710  static ID _rid[] = {1, 0, 2, 3, 4};
711  return _rid[pointId];
712 }
713 
714 
715 //! @ingroup GeoShape
716 //! A Geometric Shape
718  public Tetra
719 {
720 public:
721  //! @name Public Types
722  //@{
723  typedef Tetra BasRefSha;
725  //@}
726  static const UInt S_numPoints = 10; //!< Number of points
727  static const UInt S_numPointsPerVertex = 1; //!< Number of points per vertex
728  static const UInt S_numPointsPerEdge = 1; //!< Number of points per edge
729  static const UInt S_numPointsPerFace = 0; //!< Number of points per face
730  static const UInt S_numPointsPerVolume = 0; //!< Number of points per volume
731  static const UInt S_numPointsPerElement = S_numPointsPerVolume; //!< Number of points per element
732  static const UInt S_numPointsPerFacet = S_numPointsPerFace; //!< Number of points per facet
733  static const UInt S_numPointsPerRidge = S_numPointsPerEdge; //!< Number of points per ridge
734  static const UInt S_numPointsPerPeak = S_numPointsPerVertex; //!< Number of points per peak
735 
736 
737  //! @return the local ID of the j-th point of the i-th edge
738  static ID edgeToPoint ( ID const& iEdge, ID const& jPoint );
739 
740  //! @return the local ID of the j-th point of the i-th face
741  static ID faceToPoint ( ID const& iFace, ID const& jPoint );
742 
743  //! @return the local ID of the j-th point of the i-th facet
744  static ID facetToPoint ( ID const& iFacet, ID const& jPoint )
745  {
746  return faceToPoint ( iFacet, jPoint );
747  }
748 
749  //! @return the local ID of the j-th ridge of the i-th facet
750  static ID facetToRidge ( ID const& iFacet, ID const& jRidge )
751  {
752  return faceToEdge (iFacet, jRidge).first;
753  }
754 
755  //! @return the local ID of the j-th peak of the i-th facet
756  static ID facetToPeak ( ID const& iFacet, ID const& jPeak )
757  {
758  return faceToPoint (iFacet, jPeak);
759  }
760 
761 };
762 
763 template <>
764 inline ID reversePoint<QuadraticTetra> ( ID const& pointId )
765 {
766  static ID _rid[] = {1, 0, 2, 3, 4, 6, 5, 8, 7, 9};
767  return _rid[pointId];
768 }
769 
770 
771 //! @ingroup GeoShape
772 //! A Geometric Shape
774  public Hexa
775 {
776 public:
777  //! @name Public Types
778  //@{
779  typedef Hexa BasRefSha;
781  //@}
782  static const UInt S_numPoints = 8; //!< Number of points
783  static const UInt S_numPointsPerVertex = 1; //!< Number of points per vertex
784  static const UInt S_numPointsPerEdge = 0; //!< Number of points per edge
785  static const UInt S_numPointsPerFace = 0; //!< Number of points per face
786  static const UInt S_numPointsPerVolume = 0; //!< Number of points per volume
787  static const UInt S_numPointsPerElement = S_numPointsPerVolume; //!< Number of points per element
788  static const UInt S_numPointsPerFacet = S_numPointsPerFace; //!< Number of points per facet
789  static const UInt S_numPointsPerRidge = S_numPointsPerEdge; //!< Number of points per ridge
790  static const UInt S_numPointsPerPeak = S_numPointsPerVertex; //!< Number of points per peak
791 
792 
793  //! @return the local ID of the j-th point of the i-th edge
794  static ID edgeToPoint ( ID const& iEdge, ID const& jPoint );
795  //! @return the local ID of the j-th point of the i-th face
796  static ID faceToPoint ( ID const& iFace, ID const& jPoint );
797 
798  //! @return the local ID of the j-th point of the i-th facet
799  static ID facetToPoint ( ID const& iFacet, ID const& jPoint )
800  {
801  return faceToPoint ( iFacet, jPoint );
802  }
803 
804  //! @return the local ID of the j-th ridge of the i-th facet
805  static ID facetToRidge ( ID const& iFacet, ID const& jRidge )
806  {
807  return faceToEdge (iFacet, jRidge).first;
808  }
809 
810  //! @return the local ID of the j-th peak of the i-th facet
811  static ID facetToPeak ( ID const& iFacet, ID const& jPeak )
812  {
813  return faceToPoint (iFacet, jPeak);
814  }
815 
816 };
817 
818 template <>
819 inline ID reversePoint<LinearHexa> ( ID const& pointId )
820 {
821  static ID _rid[] = {3, 2, 1, 0, 7, 6, 5, 4};
822  return _rid[pointId];
823 }
824 
825 
826 //! @ingroup GeoShape
827 //! A Geometric Shape
829  public Hexa
830 {
831 public:
832  //! @name Public Types
833  //@{
834  typedef Hexa BasRefSha;
836  //@}
837  static const UInt S_numPoints = 27; //!< Number of points
838  static const UInt S_numPointsPerVertex = 1; //!< Number of points per vertex
839  static const UInt S_numPointsPerEdge = 1; //!< Number of points per edge
840  static const UInt S_numPointsPerFace = 1; //!< Number of points per face
841  static const UInt S_numPointsPerVolume = 1; //!< Number of points per volume
842  static const UInt S_numPointsPerElement = S_numPointsPerVolume; //!< Number of points per element
843  static const UInt S_numPointsPerFacet = S_numPointsPerFace; //!< Number of points per facet
844  static const UInt S_numPointsPerRidge = S_numPointsPerEdge; //!< Number of points per ridge
845  static const UInt S_numPointsPerPeak = S_numPointsPerVertex; //!< Number of points per peak
846 
847 
848  //! @return the local ID of the j-th point of the i-th edge
849  static ID edgeToPoint ( ID const& iEdge, ID const& jPoint );
850 
851  //! @return the local ID of the j-th point of the i-th face
852  static ID faceToPoint ( ID const& iFace, ID const& jPoint );
853 
854  //! @return the local ID of the j-th point of the i-th facet
855  static ID facetToPoint ( ID const& iFacet, ID const& jPoint )
856  {
857  return faceToPoint ( iFacet, jPoint );
858  }
859 
860  //! @return the local ID of the j-th ridge of the i-th facet
861  static ID facetToRidge ( ID const& iFacet, ID const& jRidge )
862  {
863  return faceToEdge (iFacet, jRidge).first;
864  }
865 
866  //! @return the local ID of the j-th peak of the i-th facet
867  static ID facetToPeak ( ID const& iFacet, ID const& jPeak )
868  {
869  return faceToPoint (iFacet, jPeak);
870  }
871 
872 };
873 
874 template <>
875 inline ID reversePoint<QuadraticHexa> ( ID const& pointId )
876 {
877  static ID _rid[] = {3, 2, 1, 0, 7, 6, 5, 4,
878  10, 9, 8, 11, 15, 14, 13, 12,
879  18, 17, 16, 19, 20, 23, 22, 21, 24, 25, 26
880  };
881  return _rid[pointId];
882 }
883 
884 
885 }
886 
887 #endif // ELEMENTSHAPES_H
static const UInt S_numPointsPerVertex
Number of points per vertex.
static const UInt S_numPointsPerVertex
Number of points per vertex.
static const UInt S_numPointsPerElement
Number of points per element.
static const UInt S_numPointsPerElement
Number of points per element.
static const UInt S_numPointsPerElement
Number of points per element.
static const UInt S_numPointsPerElement
Number of points per element.
static const UInt S_numPointsPerPeak
Number of points per peak.
static const UInt S_numPointsPerFacet
Number of points per facet.
static ID facetToRidge(ID const &iFacet, ID const &jRidge)
static ID faceToPoint(ID const &iFace, ID const &jPoint)
static const UInt S_nDimensions
Dimensionality.
static const ReferenceGeometry S_geometry
Identify the geometric entity.
static const UInt S_numPointsPerVolume
Number of points per volume.
static const UInt S_numRidges
Number of ridges.
static const UInt S_numPointsPerEdge
Number of points per edge.
static const UInt S_numEdges
Number of edges.
static const UInt S_numPointsPerFacet
Number of points per facet.
A Geometric Shape.
A Geometric Shape.
static const UInt S_numFaces
Number of faces.
static const UInt S_nDimensions
Dimensionality.
GeoPoint GeoBShape
Geometric shape of the boundary.
static const UInt S_numPointsPerElement
Number of points per element.
static const ReferenceShapes S_shape
Identify the shape.
static const UInt S_numRidges
Number of ridges.
static const UInt S_numPointsPerFace
Number of points per face.
A Geometric Shape.
static ID edgeToPoint(ID const &iEdge, ID const &jPoint)
static const UInt S_numVertices
Number of vertices.
static const UInt S_numPointsPerRidge
Number of points per ridge.
static ID facetToPeak(ID const &iFacet, ID const &jPeak)
static ID facetToPeak(ID const &iFacet, ID const &jPeak)
QuadraticLine GeoBShape
A Geometric Shape.
static const UInt S_numPointsPerVolume
Number of points per volume.
A Geometric Shape.
static const UInt S_numPointsPerPeak
Number of points per peak.
static const UInt S_numPointsPerFacet
Number of points per facet.
static const UInt S_nDimensions
Dimensionality.
static const UInt S_numPoints
Number of points.
static const UInt S_numPointsPerElement
Number of points per element.
static const UInt S_numEdges
Number of edges.
static ID facetToPoint(ID const &iFacet, ID const &jPoint)
static const UInt S_numPointsPerRidge
Number of points per ridge.
static const UInt S_numPointsPerFace
Number of points per face.
static const UInt S_numEdges
Number of edges.
static const UInt S_numPointsPerElement
Number of points per element.
static const UInt S_numFacets
Number of facets.
static ID edgeToPoint(ID const &iEdge, ID const &jPoint)
static ID edgeToPoint(ID const &, ID const &jPoint)
static ID facetToRidge(ID const &iFacet, ID const &jRidge)
static ID edgeToPoint(ID const &iEdge, ID const &jPoint)
GeoPoint GeoBShape
Geometric shape of the boundary.
static ID facetToPoint(ID const &iFacet, ID const &jPoint)
static const UInt S_numVertices
Number of vertices.
static const UInt S_numPointsPerPeak
Number of points per peak.
static ID edgeToPoint(ID const &iEdge, ID const &jPoint)
static const UInt S_numFaces
Number of faces.
static const UInt S_numFaces
Number of faces.
static const UInt S_numPointsPerFacet
Number of points per facet.
static ID faceToPoint(ID const &iFace, ID const &jPoint)
static const UInt S_numPointsPerElement
Number of points per element.
static const ReferenceGeometry S_geometry
Identify the geometric entity.
static const UInt S_numPointsPerEdge
Number of points per edge.
static ID edgeToPoint(ID const &iEdge, ID const &jPoint)
void updateInverseJacobian(const UInt &iQuadPt)
static const UInt S_numFacets
Number of facets.
static const UInt S_numPointsPerFace
Number of points per face.
static const UInt S_numPointsPerElement
Number of points per element.
static ID facetToRidge(ID const &, ID const &)
static ID faceToPoint(ID const &, ID const &jPoint)
static const UInt S_numEdges
Number of edges.
static const ReferenceGeometry S_geometry
Identify the geometric entity.
static const UInt S_nDimensions
Dimensionality.
static ID edgeToPoint(ID const &iEdge, ID const &jPoint)
static const UInt S_numPointsPerVolume
Number of points per volume.
static ID facetToRidge(ID const &iFacet, ID const &jRidge)
static const UInt S_numPoints
Number of points.
static const UInt S_numPointsPerPeak
Number of points per peak.
static ID edgeToPoint(ID const &iEdge, ID const &jPoint)
QuadraticTriangle GeoBShape
static std::pair< ID, bool > faceToEdge(ID const &, ID const &jEdge)
static const UInt S_numPointsPerRidge
Number of points per ridge.
static const UInt S_nDimensions
Dimensionality.
static ID facetToPeak(ID const &iFacet, ID const &jPeak)
static const UInt S_numPointsPerVertex
Number of points per vertex.
static const UInt S_numEdges
Number of edges.
static ID facetToPoint(ID const &iFacet, ID const &jPoint)
#define ERROR_MSG(A)
Definition: LifeAssert.hpp:69
static const UInt S_numPeaks
Number of peaks.
static const UInt S_numPointsPerVertex
Number of points per vertex.
static const UInt S_numPoints
Number of points.
static const UInt S_nDimensions
Dimensionality.
dummy class for selecting correct function specializations based on geometry dimensions (1...
A Geometric Shape.
static ID facetToRidge(ID const &iFacet, ID const &jRidge)
static const UInt S_numRidges
Number of ridges.
static const UInt S_numPointsPerFace
Number of points per face.
static const UInt S_numPointsPerPeak
Number of points per peak.
static const UInt S_numVertices
Number of vertices.
static const UInt S_numPointsPerRidge
Number of points per ridge.
static const UInt S_numRidges
Number of ridges.
static const UInt S_numPointsPerRidge
Number of points per ridge.
uint32_type ID
IDs.
Definition: LifeV.hpp:194
static const UInt S_numPointsPerEdge
Number of points per edge.
ID reversePoint(ID const &pointId)
A utility to invert point numbering on a GeoShape.
static const UInt S_numPointsPerFacet
Number of points per facet.
static ID facetToPoint(ID const &iFacet, ID const &jPoint)
static ID facetToPoint(ID const &iFacet, ID const &jPoint)
static ID edgeToPoint(ID const &iEdge, ID const &jPoint)
A Geometric Shape.
static const UInt S_numPointsPerFacet
Number of points per facet.
static const UInt S_numFacets
Number of facets.
static const ReferenceShapes S_shape
Identify the shape.
static const UInt S_numPointsPerEdge
Number of points per edge.
static std::pair< ID, bool > faceToEdge(ID const &iFace, ID const &jEdge)
static const UInt S_numEdges
Number of edges.
static const ReferenceShapes S_shape
Identify the shape.
static const UInt S_numVertices
Number of vertices.
QuadraticQuad GeoBShape
static const UInt S_numPointsPerPeak
Number of points per peak.
static const UInt S_numPointsPerFacet
Number of points per facet.
static const ReferenceGeometry S_geometry
Identify the geometric entity.
static const UInt S_numPointsPerVertex
Number of points per vertex.
static ID facetToPoint(ID const &iFacet, ID const &jPoint)
static const UInt S_numPointsPerVolume
Number of points per volume.
static const UInt S_numFaces
Number of faces.
A Geometric Shape.
static const ReferenceShapes S_shape
Identify the shape.
static ID facetToRidge(ID const &iFacet, ID const &jRidge)
static const UInt S_numPointsPerFace
Number of points per face.
static const UInt S_numPointsPerEdge
Number of points per edge.
static const UInt S_numPointsPerRidge
Number of points per ridge.
static const UInt S_numPointsPerVertex
Number of points per vertex.
static ID facetToPeak(ID const &, ID const &)
static const UInt S_numPoints
Number of points.
static const UInt S_numFacets
Number of facets.
static ID edgeToPoint(ID const &, ID const &)
static const UInt S_numPointsPerPeak
Number of points per peak.
static const UInt S_numPointsPerFacet
Number of points per facet.
static const UInt S_numPointsPerVolume
Number of points per volume.
static const UInt S_numPointsPerFacet
Number of points per facet.
static const UInt S_numVertices
Number of vertices.
static const UInt S_numPointsPerRidge
Number of points per ridge.
static const UInt S_numPoints
Number of points.
static const UInt S_numPointsPerEdge
Number of points per edge.
static const UInt S_numRidges
Number of ridges.
static const ReferenceShapes S_shape
Identify the shape.
static const UInt S_numPointsPerFace
Number of points per face.
static const UInt S_numPointsPerVertex
Number of points per vertex.
static const UInt S_numPointsPerFacet
Number of points per facet.
static const UInt S_numPointsPerRidge
Number of points per ridge.
static const UInt S_numPointsPerFace
Number of points per face.
static const ReferenceGeometry S_geometry
Identify the geometric entity.
static ID faceToPoint(ID const &iFace, ID const &jPoint)
static std::pair< ID, bool > faceToEdge(ID const &, ID const &)
static const UInt S_numPointsPerFacet
Number of points per facet.
static const UInt S_numPointsPerFace
Number of points per face.
A Geometric Shape.
static ID edgeToPoint(ID const &iEdge, ID const &jPoint)
static ID facetToPoint(ID const &iFacet, ID const &jPoint)
A Geometric Shape.
static const UInt S_numPoints
Number of points.
static const ReferenceGeometry S_geometry
Identify the geometric entity.
static const UInt S_numPoints
Number of points.
static const UInt S_numFacets
Number of facets.
static ID faceToPoint(ID const &iFace, ID const &jPoint)
static const UInt S_numPointsPerPeak
Number of points per peak.
static const UInt S_numPointsPerEdge
Number of points per edge.
static ID facetToPoint(ID const &iFacet, ID const &jPoint)
A Geometric Shape.
static ID facetToPeak(ID const &, ID const &)
static const UInt S_numPointsPerPeak
Number of points per peak.
static const UInt S_numFaces
Number of faces.
static std::pair< ID, bool > faceToEdge(ID const &iFace, ID const &jEdge)
static const UInt S_numPoints
Number of points.
static const UInt S_numPointsPerEdge
Number of points per edge.
static ID facetToRidge(ID const &iFacet, ID const &jRidge)
static const UInt S_numPeaks
Number of peaks.
static const UInt S_numPointsPerFacet
Number of points per facet.
const ID NotAnId
Definition: LifeV.hpp:264
static ID facetToRidge(ID const &iFacet, ID const &jRidge)
static const UInt S_numPointsPerPeak
Number of points per peak.
static const UInt S_numPoints
Number of points.
static ID faceToPoint(ID const &iFace, ID const &jPoint)
static ID faceToPoint(ID const &, ID const &jPoint)
static const UInt S_numPointsPerEdge
Number of points per edge.
A Geometric Shape.
LinearTriangle GeoBShape
static const UInt S_numFaces
Number of faces.
static const UInt S_numPointsPerVertex
Number of points per vertex.
static const UInt S_numPointsPerElement
Number of points per element.
static const UInt S_numPeaks
Number of peaks.
static ID facetToPoint(ID const &iFacet, ID const &)
static const UInt S_numPointsPerRidge
Number of points per ridge.
static const UInt S_numPeaks
Number of peaks.
static const UInt S_numPointsPerPeak
Number of points per peak.
UInt shapeDimension(const ReferenceShapes &shape)
static const UInt S_numPointsPerRidge
Number of points per ridge.
static const UInt S_numVertices
Number of vertices.
static ID facetToPoint(ID const &iFacet, ID const &jPoint)
static const UInt S_numPeaks
Number of peaks.
static std::pair< ID, bool > faceToEdge(ID const &, ID const &jEdge)
static ID facetToRidge(ID const &iFacet, ID const &jRidge)
static ID facetToPeak(ID const &iFacet, ID const &jPeak)
static const UInt S_numPeaks
Number of peaks.
static const UInt S_numPointsPerRidge
Number of points per ridge.
nullShape GeoBShape
Geometric shape of the boundary.
static const UInt S_numPointsPerElement
Number of points per element.
static const UInt S_numPointsPerVertex
Number of points per vertex.
static const UInt S_numPointsPerElement
Number of points per element.
static const UInt S_numPointsPerEdge
Number of points per edge.
static const UInt S_numFacets
Number of facets.
static const UInt S_numPointsPerFace
Number of points per face.
static const UInt S_numPointsPerVertex
Number of points per vertex.
static const UInt S_numPointsPerVertex
Number of points per vertex.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
static const UInt S_numRidges
Number of ridges.
static const ReferenceShapes S_shape
Identify the shape.
static const UInt S_numPointsPerEdge
Number of points per edge.
static const UInt S_numPointsPerRidge
Number of points per ridge.
static ID facetToPeak(ID const &, ID const &)
static const UInt S_numPoints
Number of points.
static const UInt S_numPoints
Number of points.
static ID facetToPeak(ID const &iFacet, ID const &jPeak)
static ID facetToRidge(ID const &iFacet, ID const &jRidge)
static const UInt S_numPoints
Number of points.
static const UInt S_numPointsPerPeak
Number of points per peak.