GCC Code Coverage Report


Directory: ./
File: Geometry/listFaces.hpp
Date: 2024-04-14 07:32:34
Exec Total Coverage
Lines: 12 14 85.7%
Branches: 0 0 -%

Line Branch Exec Source
1 // ______ ______ _ _ _____ ______
2 // | ____| ____| | (_)/ ____| | ____|
3 // | |__ | |__ | | _| (___ ___| |__
4 // | __| | __| | | | |\___ \ / __| __|
5 // | | | |____| |____| |____) | (__| |____
6 // |_| |______|______|_|_____/ \___|______|
7 // Finite Elements for Life Sciences and Engineering
8 //
9 // License: LGL2.1 License
10 // FELiScE default license: LICENSE in root folder
11 //
12 // Main authors: J.Castelneau & J.Foulon
13 //
14
15 #ifndef LISTFACES_HPP
16 #define LISTFACES_HPP
17
18 // System includes
19 #include <vector>
20 #include <list>
21 #include <iostream>
22
23 // External includes
24
25 // Project includes
26 #include "Core/felisce.hpp"
27
28 namespace felisce
29 {
30 //////////////////////
31 // LIST FACES CLASS //
32 //////////////////////
33 /*!
34 \class ListFaces
35 \authors J.Castelneau & J.Foulon
36
37 \brief Class implementing the list of geometric faces
38
39 A list of faces is defined by
40 - a list of pointer on face
41 - the total number of faces
42 - a chained list of faces
43
44 To access at the face defined by the std::set of vertices (i,j,k) or (i,j,k,l):
45 - go to the i-th index in the list of pointer
46 - browse the chained list of faces where 1st vertex is i
47 */
48
49 class Face;
50 class NeighVolumesOfFaces;
51
52 class ListFaces {
53
54 public: // le deplacer ailleurs? ->Core?
55 static const felInt m_null_int;
56
57 // Constructor
58 // ===========
59 1277 ListFaces() : m_numFaces(0), m_numGivenFaces(0) {}
60 ~ListFaces();
61
62 //! Copy constructor, to avoid warning due to user-declared destructor.
63 ListFaces(const ListFaces&) = default;
64
65 void searchAddFace(std::vector<felInt> ptOfFace, NeighVolumesOfFaces* the_neighbour,
66 bool check_surface_mesh_flag);
67
68 void searchFace(const std::vector <felInt> & facePts, Face& face) const;
69
70 felInt findFace(const std::vector <felInt> & facePts) const;
71 felInt findFace(const Face& the_face) const; //! if not used: remove it! 2012/08 vm
72
73 bool compareFaces(const std::vector<felInt>& face1, const std::vector<felInt>& face2) const;
74
75 void permutFacePointsSmallIDFirst(const std::vector <felInt>& theFacePts,
76 std::vector <felInt>& theOrderedFactePts) const;
77 void permutFacePointsSmallIDFirst(std::vector <felInt>& facePts) const;
78
79 void giveOppositeFace(const std::vector <felInt>& theFacePts,
80 std::vector <felInt>& theOppositeFacePts) const;
81
82 void print( std::ostream& outstr = std::cout, int verbose = 0, int orderFormat = 0 ) const;
83
84 void clearAndInit(felInt numPts);
85
86 // getters
87 // ======
88 inline const std::vector <Face*> & listBegin() const {
89 return m_listBegin;
90 }
91 90 inline const std::vector <Face*> & list() const {
92 90 return m_list; // CHANGER CE NOM! VM 2012/09
93 }
94 inline const felInt & numFaces() const {
95 return m_numFaces;
96 }
97 266 inline const felInt & numGivenFaces() const {
98 266 return m_numGivenFaces;
99 }
100
101 193437 inline Face* list(felInt faceID) const {
102 193437 return m_list[faceID];
103 }
104
105
106 // setters
107 // ======
108 inline std::vector <Face*> & listBegin() {
109 return m_listBegin; // A VIRER! VM 2012/09
110 }
111 5 inline std::vector <Face*> & list() {
112 5 return m_list; // A VIRER! VM 2012/09
113 }
114 inline felInt & numFaces() {
115 return m_numFaces;
116 }
117
118 133 void setNumGivenFaces() {
119 133 m_numGivenFaces = m_numFaces;
120 133 }
121
122 private:
123 felInt m_numFaces;
124 felInt m_numGivenFaces; // num of faces coming from the mesh
125 std::vector<Face*> m_listBegin;
126 std::vector<Face*> m_list;
127
128 };
129 }
130 #endif
131