LifeV
MeshElementMarked.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 Geometric elements
30 
31  @author Luca Formaggia <luca.formaggia@polimi.it>
32  @contributor Marta D'Elia <mdelia2@mathcs.emory.edu>
33  @contributor Mauro Perego <mdelia2@mathcs.emory.edu>
34  @maintainer Marta D'Elia <mdelia2@mathcs.emory.edu>
35 
36  @date 00-00-0000
37 
38  */
39 
40 #ifndef MESHELEMENTMARKED_H
41 #define MESHELEMENTMARKED_H
42 
43 #include <lifev/core/LifeV.hpp>
44 #include <lifev/core/mesh/MarkerDefinitions.hpp>
45 #include <lifev/core/mesh/MeshElement.hpp>
46 #include <lifev/core/mesh/MeshElementBare.hpp>
47 
48 namespace LifeV
49 {
50 
51 //! Class for describing a geometric Entity immersed in 1D, 2D or 3D Geometry.
52 /* it is implemented using traits.
53  * Template parameters:
54  * elemDim: is the dimension of the entity: 0 for vertices, 1 for lines, 2 for triangles, 3 for tetrahedra.
55  * geoDim: is the dimension of the geometry: (1, for a 1D geometry, 2 for a 2D geometry, 3 for a 3D geometry).
56  * GeoShape: is the shape type: (eg. linearTetra, linearTriangle ecc. )
57  notice that the dimension of GeoShape is GeoDim (except for GeoShape)
58  * MC: is the marker
59  */
60 template <int elemDim, int geoDim, typename GeoShape, typename MC>
62 {
63 public:
66 };
67 
68 
69 //! specialization for 0D entities (points).
70 template <int geoDim, typename GeoShape, typename MC>
71 class MeshElementMarked<0, geoDim, GeoShape, MC>: public MeshVertex, public MC::pointMarker_Type
72 {
73 public:
74 
75  //! @name Public Types
76  //@{
77  typedef typename MC::pointMarker_Type marker_Type;
78 
79  //@}
80 
81  //! @name Constructor & Destructor
82  //@{
83 
84  //! Empty Constructor
86 
87  //! Declares item identity and states if it is on boundary
88  /*!
89  @param identity Element identity
90  @param boundary True if the element is on boundary
91  */
92  explicit MeshElementMarked ( ID identity, bool boundary = false );
93 
94  //! Declares item identity, provides coordinate and states if it is on boundary
95  /*!
96  @param identity Element identity
97  @param x Element x coordinate
98  @param y Element y coordinate
99  @param z Element z coordinate
100  @param boundary True if the element is on boundary
101  */
102  MeshElementMarked ( ID identity, Real x, Real y, Real z, bool boundary = false );
103 
104  //! Copy constructor
105  /*!
106  @param Element MeshElementMarked0D to be copied
107  */
108  MeshElementMarked ( MeshElementMarked<0, geoDim, GeoShape, MC> const& Element );
109 
110  //! Copy constructor
111  /*!
112  @param Element MeshElementMarked0D to be copied
113  @param Marker Markercommon
114  */
115  MeshElementMarked ( MeshVertex const& Element, MC const& Marker );
116 
117  //! Destructor
118  virtual ~MeshElementMarked()
119  {
120  // nothing to be done
121  }
122 
123  //@}
124 
125  //! @name Operators
126  //@{
127 
128  //! The equivalence operator
129  /*!
130  @param Element Equivalent MeshElementMarked
131  @return Reference to a new MeshElementMarked with the same content of MeshElementMarked Element
132  */
133  MeshElementMarked& operator = ( const MeshElementMarked<0, geoDim, GeoShape, MC>& Element );
134 
135  //@}
136 
137  void setPoint ( ID const identity, MeshElementMarked<0, geoDim, GeoShape, MC> const* point );
138 
139  void setPoint ( ID const /*identity*/, MeshElementMarked<0, geoDim, GeoShape, MC> const& point );
140 
141  MeshElementMarked<0, geoDim, GeoShape, MC> const& point ( ID const identity ) const;
142 
143 
144 };
145 
146 //! specialization for 0D entities (points) in 1D Geometry.
147 template
148 <typename GeoShape, typename MC>
149 class MeshElementMarked<0, 1, GeoShape, MC>: public MeshVertex, public MC::pointMarker_Type
150 {
151 public:
152 
153  //! @name Public Types
154  //@{
155  typedef typename MC::pointMarker_Type marker_Type;
156  static const UInt S_numPoints = 1;
157 
158  //@}
159 
160  //! @name Constructor & Destructor
161  //@{
162 
163  //! Empty Constructor
165 
166  //! Declares item identity and states if it is on boundary
167  /*!
168  @param identity Element identity
169  @param boundary True if the element is on boundary
170  */
171  explicit MeshElementMarked ( ID identity, bool boundary = false );
172 
173  //! Declares item identity, provides coordinate and states if it is on boundary
174  /*!
175  @param identity Element identity
176  @param x Element x coordinate
177  @param y Element y coordinate
178  @param z Element z coordinate
179  @param boundary True if the element is on boundary
180  */
181  MeshElementMarked ( ID identity, Real x, Real y, Real z, bool boundary = false );
182 
183  //! Copy constructor
184  /*!
185  @param Element MeshElementMarked0D to be copied
186  */
187  MeshElementMarked ( MeshElementMarked<0, 1, GeoShape, MC> const& Element );
188 
189  //! Copy constructor
190  /*!
191  @param Element MeshElementMarked0D to be copied
192  @param Marker Markercommon
193  */
194  MeshElementMarked ( MeshVertex const& Element, MC const& Marker );
195 
196  //! Destructor
197  virtual ~MeshElementMarked()
198  {
199  // nothing to be done
200  }
201 
202  //@}
203 
204  //! @name Operators
205  //@{
206 
207  //! The equivalence operator
208  /*!
209  @param Element Equivalent MeshElementMarked
210  @return Reference to a new MeshElementMarked with the same content of MeshElementMarked Element
211  */
212  MeshElementMarked& operator = ( const MeshElementMarked<0, 1, GeoShape, MC>& Element );
213 
214  //@}
215 
216  void setPoint ( ID const identity, MeshElementMarked<0, 1, GeoShape, MC> const* point );
217 
218  void setPoint ( ID const /*identity*/, MeshElementMarked<0, 1, GeoShape, MC> const& point );
219 
220  MeshElementMarked<0, 1, GeoShape, MC> const& point ( ID const identity ) const;
221 
222  //! @name Get Methods
223  //@{
224 
225  //! Returns the identity of the first adjacent element
226  /*!
227  @return Identity of the first adjacent element
228  */
230  {
231 
233  }
234 
235  //! Returns the identity of the second adjacent element
236  /*!
237  @return Identity of the second adjacent element
238  */
240  {
242  }
243 
244  //! Returns the identity of the first adjacent element
245  /*!
246  @return Identity of the first adjacent element
247  */
249  {
251  }
252 
253  //! Returns the identity of the second adjacent element
254  /*!
255  @return Identity of the second adjacent element
256  */
258  {
260  }
261 
262  //! Returns the position of the first adjacent element
263  /*!
264  @return Position of the first adjacent element
265  */
267  {
269  }
270 
271  //! Returns the position of the second adjacent element
272  /*!
273  @return Position of the second adjacent element
274  */
276  {
278  }
279 
280 
281  //! Returns the position of the first adjacent element
282  /*!
283  @return Position of the first adjacent element
284  */
286  {
288  }
289 
290  //! Returns the position of the second adjacent element
291  /*!
292  @return Position of the second adjacent element
293  */
295  {
297  }
298 
299  //@}
300 
301 private:
306 
307 };
308 
309 
310 //! specialization for 1D entities (edges) in 1D Geometry.
311 template
312 <typename GeoShape, typename MC>
313 class MeshElementMarked<1, 1, GeoShape, MC> :
314  public MeshElement<GeoShape, MeshElementMarked<0, 1, GeoShape, MC> >,
315  public MC::edgeMarker_Type
316 {
317 public:
318 
319  //! @name Public Types
320  //@{
321 
322  typedef GeoShape geoShape_Type;
323  typedef typename MC::edgeMarker_Type marker_Type;
324  typedef MeshElementMarked<0, 1, GeoShape, MC> geoBElement_Type;
325  typedef MeshElementMarked<0, 1, GeoShape, MC> point_Type;
326  static const UInt S_numLocalVertices = MeshElement<GeoShape, MeshElementMarked<0, 1, GeoShape, MC> >::S_numVertices;
328  //@}
329 
330  //! @name Constructor & Destructor
331  //@{
332 
333  //! Declares element identity
334  /*!
335  @param identity Element identity
336  */
337  explicit MeshElementMarked ( ID identity = NotAnId );
338 
339  //! Copy constructor
340  /*!
341  @param Element MeshElementMarked to be copied
342  */
343  MeshElementMarked ( const MeshElementMarked<1, 1, GeoShape, MC>& Element);
344 
345  //! Destructor
346  virtual ~MeshElementMarked()
347  {
348  // nothing to be done
349  }
350  //@}
351 };
352 
353 
354 //! specialization for 1D entities (edges) in 3D geometry.
355 template
356 <typename GeoShape, typename MC>
357 class MeshElementMarked<1, 3, GeoShape, MC> :
358  public MeshElement<typename GeoShape::GeoBShape::GeoBShape, MeshElementMarked<0, 3, GeoShape, MC> >,
359  public MC::edgeMarker_Type
360 {
361 public:
362 
363  //! @name Public Types
364  //@{
365 
366  typedef typename GeoShape::GeoBShape::GeoBShape geoShape_Type;
367  typedef typename MC::edgeMarker_Type marker_Type;
368  typedef MeshElementMarked<0, 3, GeoShape, MC> geoBElement_Type;
369  typedef MeshElementMarked<0, 3, GeoShape, MC> point_Type;
370  //@}
371 
372  //! @name Constructor & Destructor
373  //@{
374 
375  //! Declares element identity
376  /*!
377  @param identity Element identity
378  */
379  explicit MeshElementMarked ( ID identity = NotAnId );
380 
381  //! Copy constructor
382  /*!
383  @param Element MeshElementMarked to be copied
384  */
385  MeshElementMarked ( const MeshElementMarked<1, 3, GeoShape, MC>& Element);
386 
387  //! Destructor
388  virtual ~MeshElementMarked()
389  {
390  // nothing to be done
391  }
392  //@}
393 };
394 
395 
396 
397 //! specialization for 1D entities (edges) in a 2D geometry. Identities of the adjacent 2D elements and their relative position are stored.
398 template
399 <typename GeoShape, typename MC>
400 class MeshElementMarked<1, 2, GeoShape, MC>: public MeshElement<typename GeoShape::GeoBShape, MeshElementMarked<0, 2, GeoShape, MC> >, public MC::faceMarker_Type
401 {
402 
403 public:
404 
405  //! @name Public Types::GeoBShape
406  //@{
407 
408  //! Number of element edges, for compatibility
409  static const UInt S_numLocalVertices = MeshElement<typename GeoShape::GeoBShape, MeshElementMarked<0, 2, GeoShape, MC> >::S_numVertices;
410 
411  typedef typename GeoShape::GeoBShape geoShape_Type;
412  typedef typename MC::faceMarker_Type marker_Type;
414  typedef MeshElementMarked<1, 2, GeoShape, MC> edge_Type;
415  typedef MeshElementMarked<0, 2, GeoShape, MC> point_Type;
417 
418  //@}
419 
420  //! @name Constructor & Destructor
421  //@{
422 
423  //! Declares element identity
424  /*!
425  @param identity Element identity
426  */
427  explicit MeshElementMarked ( ID identity = NotAnId );
428 
429  //! Copy constructor
430  /*!
431  @param Element MeshElementMarked to be copied
432  */
433  MeshElementMarked ( const MeshElementMarked<1, 2, GeoShape, MC>& Element);
434 
435  //! Destructor
436  virtual ~MeshElementMarked()
437  {
438  // nothing to be done
439  }
440 
441  //@}
442 
443  //! @name Get Methods
444  //@{
445 
446  //! Returns the identity of the first adjacent element
447  /*!
448  @return Identity of the first adjacent element
449  */
451  {
452 
454  }
455 
456  //! Returns the identity of the second adjacent element
457  /*!
458  @return Identity of the second adjacent element
459  */
461  {
463  }
464 
465  //! Returns the identity of the first adjacent element
466  /*!
467  @return Identity of the first adjacent element
468  */
470  {
472  }
473 
474  //! Returns the identity of the second adjacent element
475  /*!
476  @return Identity of the second adjacent element
477  */
479  {
481  }
482 
483  //! Returns the position of the first adjacent element
484  /*!
485  @return Position of the first adjacent element
486  */
488  {
490  }
491 
492  //! Returns the position of the second adjacent element
493  /*!
494  @return Position of the second adjacent element
495  */
497  {
499  }
500 
501 
502  //! Returns the position of the first adjacent element
503  /*!
504  @return Position of the first adjacent element
505  */
507  {
509  }
510 
511  //! Returns the position of the second adjacent element
512  /*!
513  @return Position of the second adjacent element
514  */
516  {
518  }
519 
520  //@}
521 
522 private:
527 };
528 
529 
530 //! specialization for 2D entities (faces) in a 3D geometry. Identities of the adjacent 3D elements and their relative position are stored.
531 template
532 <typename GeoShape, typename MC>
533 class MeshElementMarked<2, 3, GeoShape, MC>:
534  public MeshElement<typename GeoShape::GeoBShape, MeshElementMarked<0, 3, GeoShape, MC> >,
535  public MC::faceMarker_Type
536 {
537 
538 public:
539 
540  //! @name Public Types
541  //@{
542 
543  //! Number of element edges, for compatibility
544  static const UInt S_numLocalEdges = MeshElement<typename GeoShape::GeoBShape, MeshElementMarked<0, 3, GeoShape, MC> >::S_numEdges;
545 
546  typedef typename GeoShape::GeoBShape geoShape_Type;
547  typedef typename MC::faceMarker_Type marker_Type;
549  typedef MeshElementMarked<1, 3, GeoShape, MC> edge_Type;
550  typedef MeshElementMarked<0, 3, GeoShape, MC> point_Type;
552 
553  //@}
554 
555  //! @name Constructor & Destructor
556  //@{
557 
558  //! Declares element identity
559  /*!
560  @param identity Element identity
561  */
562  explicit MeshElementMarked ( ID identity = NotAnId );
563 
564  //! Copy constructor
565  /*!
566  @param Element MeshElementMarked to be copied
567  */
568  MeshElementMarked ( const MeshElementMarked<2, 3, GeoShape, MC>& Element);
569 
570  //! Destructor
571  virtual ~MeshElementMarked()
572  {
573  // nothing to be done
574  }
575 
576  //@}
577 
578  //! @name Get Methods
579  //@{
580 
581  //! Returns the identity of the first adjacent element
582  /*!
583  @return Identity of the first adjacent element
584  */
586  {
587 
589  }
590 
591  //! Returns the identity of the second adjacent element
592  /*!
593  @return Identity of the second adjacent element
594  */
596  {
598  }
599 
600  //! Returns the identity of the first adjacent element
601  /*!
602  @return Identity of the first adjacent element
603  */
605  {
607  }
608 
609  //! Returns the identity of the second adjacent element
610  /*!
611  @return Identity of the second adjacent element
612  */
614  {
616  }
617 
618  //! Returns the position of the first adjacent element
619  /*!
620  @return Position of the first adjacent element
621  */
623  {
625  }
626 
627  //! Returns the position of the second adjacent element
628  /*!
629  @return Position of the second adjacent element
630  */
632  {
634  }
635 
636 
637  //! Returns the position of the first adjacent element
638  /*!
639  @return Position of the first adjacent element
640  */
642  {
644  }
645 
646  //! Returns the position of the second adjacent element
647  /*!
648  @return Position of the second adjacent element
649  */
651  {
653  }
654 
655  //@}
656 
657 private:
662 };
663 
664 
665 
666 
667 //! specialization for 2D entities (faces) in a 2D geometry.
668 template
669 <typename GeoShape, typename MC>
670 class MeshElementMarked<2, 2, GeoShape, MC>: public MeshElement<GeoShape, MeshElementMarked<0, 2, GeoShape, MC> >, public MC::volumeMarker_Type
671 {
672 public:
673 
674  //! @name Public Types
675  //@{
676 
677  //! Number of local Vertices
678  static const UInt S_numLocalVertices = MeshElement<GeoShape, MeshElementMarked<0, 2, GeoShape, MC> >::S_numVertices;
679  //! Number of local Faces
680  static const UInt S_numLocalEdges = MeshElement<GeoShape, MeshElementMarked<0, 2, GeoShape, MC> >::S_numEdges;
683 
684  typedef GeoShape geoShape_Type;
685  typedef typename MC::volumeMarker_Type marker_Type;
686  typedef typename GeoShape::GeoBShape faceShape_Type;
688 
689  typedef MeshElementMarked<1, 2, GeoShape, MC> edge_Type;
690  typedef MeshElementMarked<2, 2, GeoShape, MC> face_Type;
691  typedef MeshElementMarked<0, 2, GeoShape, MC> point_Type;
693 
694  //@}
695 
696  //! @name Constructor & Destructor
697  //@{
698 
699  //! Declares element identity
700  /*!
701  @param identity Element identity
702  */
703  explicit MeshElementMarked ( ID identity = NotAnId );
704 
705  //! Copy constructor
706  /*!
707  @param Element MeshElementMarked3D to be copied
708  */
709  MeshElementMarked ( const MeshElementMarked<2, 2, GeoShape, MC>& Element );
710 
711  //! Destructor
712  virtual ~MeshElementMarked()
713  {
714  // nothing to be done
715  }
716 
717  //@}
718 };
719 
720 //! specialization for 3D entities (cells) in a 3D geometry.
721 template
722 <typename GeoShape, typename MC>
723 class MeshElementMarked<3, 3, GeoShape, MC>:
724  public MeshElement<GeoShape, MeshElementMarked<0, 3, GeoShape, MC> >,
725  public MC::volumeMarker_Type
726 {
727 public:
728 
729  //! @name Public Types
730  //@{
731 
732  //! Number of local Vertices
733  static const UInt S_numLocalVertices = MeshElement<GeoShape, MeshElementMarked<0, 3, GeoShape, MC> >::S_numVertices;
734  //! Number of local Faces
735  static const UInt S_numLocalFaces = MeshElement<GeoShape, MeshElementMarked<0, 3, GeoShape, MC> >::S_numFaces;
736  //! Number of local Edges (using Euler Formula)
737  static const UInt S_numLocalEdges = MeshElement<GeoShape, MeshElementMarked<0, 3, GeoShape, MC> >::S_numEdges;
738 
741 
742  typedef GeoShape geoShape_Type;
743  typedef typename MC::volumeMarker_Type marker_Type;
744  typedef typename GeoShape::GeoBShape faceShape_Type;
746 
747  typedef MeshElementMarked<1, 3, GeoShape, MC> edge_Type;
748  typedef MeshElementMarked<2, 3, GeoShape, MC> face_Type;
749  typedef MeshElementMarked<0, 3, GeoShape, MC> point_Type;
751 
752  //@}
753 
754  //! @name Constructor & Destructor
755  //@{
756 
757  //! Declares element identity
758  /*!
759  @param identity Element identity
760  */
761  explicit MeshElementMarked ( ID identity = NotAnId );
762 
763  //! Copy constructor
764  /*!
765  @param Element MeshElementMarked to be copied
766  */
767  MeshElementMarked ( const MeshElementMarked<3, 3, GeoShape, MC>& Element );
768 
769  //! Destructor
770  virtual ~MeshElementMarked()
771  {
772  // nothing to be done
773  }
774 
775  //@}
776 };
777 
778 
779 /*-------------------------------------------------------------------------
780  MeshElementMarked (0D)
781  --------------------------------------------------------------------------*/
782 // ==========================================
783 // Constructor & Destructor
784 // ==========================================
785 template <int geoDim, typename GeoShape, typename MC>
786 MeshElementMarked<0, geoDim, GeoShape, MC>::MeshElementMarked() :
788 {}
789 
790 template <int geoDim, typename GeoShape, typename MC>
791 MeshElementMarked<0, geoDim, GeoShape, MC>::MeshElementMarked ( ID identity, bool boundary ) :
792  MeshVertex ( identity, boundary ), MC::pointMarker_Type()
793 {}
794 
795 template <int geoDim, typename GeoShape, typename MC>
796 MeshElementMarked<0, geoDim, GeoShape, MC>::MeshElementMarked ( ID identity, Real x, Real y, Real z, bool boundary ) :
797  MeshVertex ( identity, x, y, z, boundary ), MC::pointMarker_Type()
798 {}
799 
800 template <int geoDim, typename GeoShape, typename MC>
801 MeshElementMarked<0, geoDim, GeoShape, MC>::MeshElementMarked ( MeshElementMarked<0, geoDim, GeoShape, MC> const& Element ) :
802  MeshVertex ( Element ), MC::pointMarker_Type ( Element )
803 {}
804 
805 
806 // ==========================================
807 // Operators
808 // ==========================================
809 //! It calls operator= of base classes, just to be sure to do the right thing.
810 template <int geoDim, typename GeoShape, typename MC>
811 MeshElementMarked<0, geoDim, GeoShape, MC>&
812 MeshElementMarked<0, geoDim, GeoShape, MC>::operator = ( MeshElementMarked<0, geoDim, GeoShape, MC> const& Element )
813 {
814  if ( this != &Element )
815  {
816  MeshVertex::operator= ( Element );
817  marker_Type::operator= ( Element );
818  }
819  return *this;
820 }
821 
822 
823 // ==========================================
824 // Methods
825 // ==========================================
826 template <int geoDim, typename GeoShape, typename MC>
827 MeshElementMarked<0, geoDim, GeoShape, MC> const&
828 MeshElementMarked<0, geoDim, GeoShape, MC>::point ( ID const /*identity*/ ) const
829 {
830  return *this;
831 }
832 
833 template <int geoDim, typename GeoShape, typename MC>
834 void
835 MeshElementMarked<0, geoDim, GeoShape, MC>::setPoint ( ID const /*identity*/, MeshElementMarked<0, geoDim, GeoShape, MC> const* point )
836 {
837  if (this != point)
838  {
839  this = point;
840  }
841 }
842 
843 template <int geoDim, typename GeoShape, typename MC>
844 void
845 MeshElementMarked<0, geoDim, GeoShape, MC>::setPoint ( ID const /*identity*/, MeshElementMarked<0, geoDim, GeoShape, MC> const& point )
846 {
847  if (this != &point)
848  {
849  *this = point;
850  }
851 }
852 
853 /*-------------------------------------------------------------------------
854  MeshElementMarked 0D in 1D geometry
855  --------------------------------------------------------------------------*/
856 // ==========================================
857 // Constructor & Destructor
858 // ==========================================
859 template <typename GeoShape, typename MC>
860 MeshElementMarked<0, 1, GeoShape, MC>::MeshElementMarked() :
862 {}
863 
864 template <typename GeoShape, typename MC>
865 MeshElementMarked<0, 1, GeoShape, MC>::MeshElementMarked ( ID identity, bool boundary ) :
866  MeshVertex ( identity, boundary ), MC::pointMarker_Type()
867 {}
868 
869 template <typename GeoShape, typename MC>
870 MeshElementMarked<0, 1, GeoShape, MC>::MeshElementMarked ( ID identity, Real x, Real y, Real z, bool boundary ) :
871  MeshVertex ( identity, x, y, z, boundary ), MC::pointMarker_Type()
872 {}
873 
874 template <typename GeoShape, typename MC>
875 MeshElementMarked<0, 1, GeoShape, MC>::MeshElementMarked ( MeshElementMarked<0, 1, GeoShape, MC> const& Element ) :
876  MeshVertex ( Element ), MC::pointMarker_Type ( Element )
877 {}
878 
879 // ==========================================
880 // Operators
881 // ==========================================
882 //! It calls operator= of base classes, just to be sure to do the right thing.
883 template <typename GeoShape, typename MC>
884 MeshElementMarked<0, 1, GeoShape, MC>&
885 MeshElementMarked<0, 1, GeoShape, MC>::operator = ( MeshElementMarked<0, 1, GeoShape, MC> const& Element )
886 {
887  if ( this != &Element )
888  {
889  MeshVertex::operator= ( Element );
890  marker_Type::operator= ( Element );
891  }
892  return *this;
893 }
894 
895 
896 // ==========================================
897 // Methods
898 // ==========================================
899 template <typename GeoShape, typename MC>
900 MeshElementMarked<0, 1, GeoShape, MC> const&
901 MeshElementMarked<0, 1, GeoShape, MC>::point ( ID const /*identity*/ ) const
902 {
903  return *this;
904 }
905 
906 template <typename GeoShape, typename MC>
907 void
908 MeshElementMarked<0, 1, GeoShape, MC>::setPoint ( ID const /*identity*/, MeshElementMarked<0, 1, GeoShape, MC> const* point )
909 {
910  if (this != point)
911  {
912  this = point;
913  }
914 }
915 
916 template <typename GeoShape, typename MC>
917 void
918 MeshElementMarked<0, 1, GeoShape, MC>::setPoint ( ID const /*identity*/, MeshElementMarked<0, 1, GeoShape, MC> const& point )
919 {
920  if (this != &point)
921  {
922  *this = point;
923  }
924 }
925 
926 
927 /*-------------------------------------------------------------------------
928  MeshElementMarked (1D)
929  --------------------------------------------------------------------------*/
930 // ==========================================
931 // Constructor & Destructor
932 // ==========================================
933 
934 template <typename GeoShape, typename MC>
935 MeshElementMarked<1, 1, GeoShape, MC>::MeshElementMarked ( ID identity ) :
936  MeshElement<GeoShape, MeshElementMarked<0, 1, GeoShape, MC> > ( identity )
937 {
938  ASSERT_PRE ( GeoShape::S_nDimensions == 1 , "geoElement2D with incorrect GeoShape" ) ;
939 }
940 
941 
942 template <typename GeoShape, typename MC>
943 MeshElementMarked<1, 1, GeoShape, MC>::MeshElementMarked ( const MeshElementMarked<1, 1, GeoShape, MC>& Element ) :
944  MeshElement<GeoShape, MeshElementMarked<0, 1, GeoShape, MC> > ( Element ),
945  MC::edgeMarker_Type ( Element )
946 {
947  ASSERT_PRE ( GeoShape::S_nDimensions == 1 , "geoElement2D with incorrect GeoShape" ) ;
948 }
949 
950 /*-------------------------------------------------------------------------
951  MeshElementMarked (1D in 3D geometry)
952  --------------------------------------------------------------------------*/
953 
954 // ==========================================
955 // Constructor & Destructor
956 // ==========================================
957 
958 template <typename GeoShape, typename MC>
959 MeshElementMarked<1, 3, GeoShape, MC>::MeshElementMarked ( ID identity ) :
960  MeshElement<geoShape_Type, MeshElementMarked<0, 3, GeoShape, MC> > ( identity )
961 {
962  ASSERT_PRE ( geoShape_Type::S_nDimensions == 1 , "geoElement1D with incorrect GeoShape" ) ;
963 }
964 
965 
966 template <typename GeoShape, typename MC>
967 MeshElementMarked<1, 3, GeoShape, MC>::MeshElementMarked ( const MeshElementMarked<1, 3, GeoShape, MC>& Element ) :
968  MeshElement<geoShape_Type, MeshElementMarked<0, 3, GeoShape, MC> > ( Element ),
969  MC::edgeMarker_Type ( Element )
970 {
971  ASSERT_PRE ( geoShape_Type::S_nDimensions == 1 , "geoElement1D with incorrect GeoShape" ) ;
972 }
973 
974 
975 
976 /*-------------------------------------------------------------------------
977  MeshElementMarked (1D in 2D geometry)
978  --------------------------------------------------------------------------*/
979 
980 template <typename GeoShape, typename MC>
981 const UInt MeshElementMarked<1, 2, GeoShape, MC>::S_numLocalVertices;
982 
983 // ==========================================
984 // Constructor & Destructor
985 // ==========================================
986 
987 template <typename GeoShape, typename MC>
988 MeshElementMarked<1, 2, GeoShape, MC>::MeshElementMarked ( ID identity ) :
989  MeshElement<geoShape_Type, MeshElementMarked<0, 2, GeoShape, MC> > ( identity ),
994 {
995  ASSERT_PRE ( geoShape_Type::S_nDimensions == 1 , "geoElement1D in 2D geometry with incorrect GeoShape" ) ;
996 }
997 
998 template <typename GeoShape, typename MC>
999 MeshElementMarked<1, 2, GeoShape, MC>::MeshElementMarked ( const MeshElementMarked<1, 2, GeoShape, MC>& Element ) :
1000  MeshElement<geoShape_Type, MeshElementMarked<0, 2, GeoShape, MC> > ( Element ),
1001  MC::faceMarker_Type ( Element ),
1002  M_firstAdjacentElementIdentity ( Element.M_firstAdjacentElementIdentity),
1003  M_secondAdjacentElementIdentity ( Element.M_secondAdjacentElementIdentity),
1004  M_firstAdjacentElementPosition ( Element.M_firstAdjacentElementPosition ),
1005  M_secondAdjacentElementPosition ( Element.M_secondAdjacentElementPosition )
1006 {
1007  ASSERT_PRE ( geoShape_Type::S_nDimensions == 1 , "geoElement1D in 2D Geometry with incorrect GeoShape" ) ;
1008 }
1009 
1010 
1011 /*-------------------------------------------------------------------------
1012  MeshElementMarked (2D in 3D geometry)
1013  --------------------------------------------------------------------------*/
1014 
1015 template <typename GeoShape, typename MC>
1016 const UInt MeshElementMarked<2, 3, GeoShape, MC>::S_numLocalEdges;
1017 
1018 
1019 // ==========================================
1020 // Constructor & Destructor
1021 // ==========================================
1022 
1023 template <typename GeoShape, typename MC>
1024 MeshElementMarked<2, 3, GeoShape, MC>::MeshElementMarked ( ID identity ) :
1025  MeshElement<geoShape_Type, MeshElementMarked<0, 3, GeoShape, MC> > ( identity ),
1030 {
1031  ASSERT_PRE ( geoShape_Type::S_nDimensions == 2 , "geoElement2D with incorrect GeoShape" ) ;
1032 }
1033 
1034 template <typename GeoShape, typename MC>
1035 MeshElementMarked<2, 3, GeoShape, MC>::MeshElementMarked ( const MeshElementMarked<2, 3, GeoShape, MC>& Element ) :
1036  MeshElement<geoShape_Type, MeshElementMarked<0, 3, GeoShape, MC> > ( Element ),
1037  MC::faceMarker_Type ( Element ),
1038  M_firstAdjacentElementIdentity ( Element.M_firstAdjacentElementIdentity),
1039  M_secondAdjacentElementIdentity ( Element.M_secondAdjacentElementIdentity),
1040  M_firstAdjacentElementPosition ( Element.M_firstAdjacentElementPosition ),
1041  M_secondAdjacentElementPosition ( Element.M_secondAdjacentElementPosition )
1042 {
1043  ASSERT_PRE ( geoShape_Type::S_nDimensions == 2 , "geoElement2D with incorrect GeoShape" ) ;
1044 }
1045 
1046 
1047 
1048 /*-------------------------------------------------------------------------
1049  MeshElementMarked (2D in 2D geometry)
1050  --------------------------------------------------------------------------*/
1051 
1052 template <typename GeoShape, typename MC>
1053 const UInt MeshElementMarked<2, 2, GeoShape, MC>::S_numLocalVertices;
1054 template <typename GeoShape, typename MC>
1055 const UInt MeshElementMarked<2, 2, GeoShape, MC>::S_numLocalEdges;
1056 
1057 // ==========================================
1058 // Constructor & Destructor
1059 // ==========================================
1060 
1061 template <typename GeoShape, typename MC>
1062 MeshElementMarked<2, 2, GeoShape, MC>::MeshElementMarked ( ID identity ) :
1063  MeshElement<GeoShape, MeshElementMarked<0, 2, GeoShape, MC> > ( identity )
1064 {
1065  ASSERT_PRE ( GeoShape::S_nDimensions == 2 , "geoElement2D in 2D geometry with incorrect GeoShape" )
1066 }
1067 
1068 template <typename GeoShape, typename MC>
1069 MeshElementMarked<2, 2, GeoShape, MC>::MeshElementMarked ( const MeshElementMarked<2, 2, GeoShape, MC>& Element ) :
1070  MeshElement<GeoShape, MeshElementMarked<0, 2, GeoShape, MC> > ( Element ),
1071  MC::volumeMarker_Type ( Element )
1072 {
1073  ASSERT_PRE ( GeoShape::S_nDimensions == 2 , "geoElement2D in 2D geometry with incorrect GeoShape" )
1074 }
1075 
1076 
1077 
1078 /*-------------------------------------------------------------------------
1079  MeshElementMarked (3D in 3D geometry)
1080  --------------------------------------------------------------------------*/
1081 template <typename GeoShape, typename MC>
1082 const UInt MeshElementMarked<3, 3, GeoShape, MC>::S_numLocalVertices;
1083 template <typename GeoShape, typename MC>
1084 const UInt MeshElementMarked<3, 3, GeoShape, MC>::S_numLocalFaces;
1085 template <typename GeoShape, typename MC>
1086 const UInt MeshElementMarked<3, 3, GeoShape, MC>::S_numLocalEdges;
1087 
1088 // ==========================================
1089 // Constructor & Destructor
1090 // ==========================================
1091 
1092 template <int elemDim, int geoDim, typename GeoShape, typename MC>
1093 MeshElementMarked<elemDim, geoDim, GeoShape, MC>::MeshElementMarked()
1094 {
1095  ;
1096 }
1097 
1098 
1099 template <typename GeoShape, typename MC>
1100 MeshElementMarked<3, 3, GeoShape, MC>::MeshElementMarked ( ID identity ) :
1101  MeshElement<GeoShape, MeshElementMarked<0, 3, GeoShape, MC> > ( identity )
1102 {
1103  ASSERT_PRE ( GeoShape::S_nDimensions == 3 , "geoElement3D with incorrect GeoShape" )
1104 }
1105 
1106 template <typename GeoShape, typename MC>
1107 MeshElementMarked<3, 3, GeoShape, MC>::MeshElementMarked ( const MeshElementMarked<3, 3, GeoShape, MC>& Element ) :
1108  MeshElement<GeoShape, MeshElementMarked<0, 3, GeoShape, MC> > ( Element ),
1109  MC::volumeMarker_Type ( Element )
1110 {
1111  ASSERT_PRE ( GeoShape::S_nDimensions == 3 , "geoElement3D with incorrect GeoShape" )
1112 }
1113 
1114 
1115 
1116 
1117 }
1118 #endif
static const UInt S_numLocalEdges
Number of element edges, for compatibility.
ID & secondAdjacentElementPosition()
Returns the position of the second adjacent element.
static const UInt S_numLocalEdges
Number of local Edges (using Euler Formula)
static const UInt S_numLocalVertices
Number of local Vertices.
MeshElementMarked< 0, 1, GeoShape, MC > geoBElement_Type
ID secondAdjacentElementPosition() const
Returns the position of the second adjacent element.
MeshElementMarked(ID identity, Real x, Real y, Real z, bool boundary=false)
Declares item identity, provides coordinate and states if it is on boundary.
ID firstAdjacentElementPosition() const
Returns the position of the first adjacent element.
static const UInt S_numLocalVertices
Number of local Vertices.
MeshElementMarked< 0, 1, GeoShape, MC > point_Type
ID & firstAdjacentElementIdentity()
Returns the identity of the first adjacent element.
ID & secondAdjacentElementIdentity()
Returns the identity of the second adjacent element.
ID & secondAdjacentElementPosition()
Returns the position of the second adjacent element.
ID & firstAdjacentElementIdentity()
Returns the identity of the first adjacent element.
static const UInt S_numLocalFaces
Number of local Faces.
ID firstAdjacentElementIdentity() const
Returns the identity of the first adjacent element.
MeshElementMarked< 2, 2, GeoShape, MC > face_Type
void setPoint(ID const identity, MeshElementMarked< 0, geoDim, GeoShape, MC > const *point)
MeshElementMarked(ID identity=NotAnId)
Declares element identity.
MeshElementMarked(const MeshElementMarked< 1, 2, GeoShape, MC > &Element)
Copy constructor.
MeshElementMarked(ID identity=NotAnId)
Declares element identity.
MeshElementMarked(ID identity, bool boundary=false)
Declares item identity and states if it is on boundary.
MeshElementMarked< 0, 3, GeoShape, MC > point_Type
MeshElementMarked< 0, 3, GeoShape, MC > point_Type
MeshElementMarked< 0, 3, GeoShape, MC > point_Type
MeshVertex - Zero dimensional entity.
Definition: MeshVertex.hpp:59
MeshElementMarked< 0, 1, GeoShape, MC > const & point(ID const identity) const
ID firstAdjacentElementPosition() const
Returns the position of the first adjacent element.
MeshVertex - Zero dimensional entity.
Definition: MeshElement.hpp:59
MeshElementMarked(const MeshElementMarked< 1, 1, GeoShape, MC > &Element)
Copy constructor.
ID secondAdjacentElementIdentity() const
Returns the identity of the second adjacent element.
MeshElementMarked< 1, 3, GeoShape, MC > edge_Type
MeshElementMarked< 1, 3, GeoShape, MC > edge_Type
void updateInverseJacobian(const UInt &iQuadPt)
ID & firstAdjacentElementPosition()
Returns the position of the first adjacent element.
MeshElementMarked & operator=(const MeshElementMarked< 0, 1, GeoShape, MC > &Element)
The equivalence operator.
MeshElementMarked(ID identity, Real x, Real y, Real z, bool boundary=false)
Declares item identity, provides coordinate and states if it is on boundary.
ID & secondAdjacentElementIdentity()
Returns the identity of the second adjacent element.
ID & secondAdjacentElementIdentity()
Returns the identity of the second adjacent element.
MeshElementMarked(MeshVertex const &Element, MC const &Marker)
Copy constructor.
MeshElementMarked(const MeshElementMarked< 1, 3, GeoShape, MC > &Element)
Copy constructor.
ID secondAdjacentElementIdentity() const
Returns the identity of the second adjacent element.
void setPoint(ID const, MeshElementMarked< 0, 1, GeoShape, MC > const &point)
ID & firstAdjacentElementPosition()
Returns the position of the first adjacent element.
MeshElementMarked< 0, 3, GeoShape, MC > geoBElement_Type
#define ASSERT_PRE(X, A)
Definition: LifeAssert.hpp:96
MeshElementMarked(ID identity=NotAnId)
Declares element identity.
MeshElementMarked(ID identity=NotAnId)
Declares element identity.
uint32_type ID
IDs.
Definition: LifeV.hpp:194
MeshElementMarked(ID identity=NotAnId)
Declares element identity.
MeshElementMarked(MeshElementMarked< 0, 1, GeoShape, MC > const &Element)
Copy constructor.
ID firstAdjacentElementPosition() const
Returns the position of the first adjacent element.
ID firstAdjacentElementIdentity() const
Returns the identity of the first adjacent element.
MeshElementMarked< 0, 2, GeoShape, MC > point_Type
MeshElementMarked< 0, 2, GeoShape, MC > point_Type
void setPoint(ID const identity, MeshElementMarked< 0, 1, GeoShape, MC > const *point)
ID & secondAdjacentElementPosition()
Returns the position of the second adjacent element.
MeshElementMarked(ID identity, bool boundary=false)
Declares item identity and states if it is on boundary.
double Real
Generic real data.
Definition: LifeV.hpp:175
ID secondAdjacentElementPosition() const
Returns the position of the second adjacent element.
MeshElementMarked(const MeshElementMarked< 2, 2, GeoShape, MC > &Element)
Copy constructor.
MeshElementMarked & operator=(const MeshElementMarked< 0, geoDim, GeoShape, MC > &Element)
The equivalence operator.
Class for describing a geometric Entity immersed in 1D, 2D or 3D Geometry.
void setPoint(ID const, MeshElementMarked< 0, geoDim, GeoShape, MC > const &point)
MeshElementMarked< 2, 3, GeoShape, MC > face_Type
static const UInt S_numLocalEdges
Number of local Faces.
MeshElementMarked(const MeshElementMarked< 2, 3, GeoShape, MC > &Element)
Copy constructor.
const ID NotAnId
Definition: LifeV.hpp:264
ID secondAdjacentElementIdentity() const
Returns the identity of the second adjacent element.
ID & firstAdjacentElementIdentity()
Returns the identity of the first adjacent element.
ID firstAdjacentElementIdentity() const
Returns the identity of the first adjacent element.
MeshElementMarked< 0, geoDim, GeoShape, MC > const & point(ID const identity) const
MeshElementMarked(MeshElementMarked< 0, geoDim, GeoShape, MC > const &Element)
Copy constructor.
MeshElementMarked(const MeshElementMarked< 3, 3, GeoShape, MC > &Element)
Copy constructor.
MeshElementMarked< 1, 2, GeoShape, MC > edge_Type
MeshElementMarked< 1, 2, GeoShape, MC > edge_Type
MeshElementMarked(MeshVertex const &Element, MC const &Marker)
Copy constructor.
MeshElementMarked(ID identity=NotAnId)
Declares element identity.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
ID secondAdjacentElementPosition() const
Returns the position of the second adjacent element.
ID & firstAdjacentElementPosition()
Returns the position of the first adjacent element.
static const UInt S_numLocalVertices
Number of element edges, for compatibility.