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 LISTEDGES_HPP |
16 |
|
|
#define LISTEDGES_HPP |
17 |
|
|
|
18 |
|
|
// System includes |
19 |
|
|
#include <vector> |
20 |
|
|
|
21 |
|
|
// External includes |
22 |
|
|
|
23 |
|
|
// Project includes |
24 |
|
|
#include "Core/felisce.hpp" |
25 |
|
|
#include "Geometry/geometricEdges.hpp" |
26 |
|
|
|
27 |
|
|
namespace felisce |
28 |
|
|
{ |
29 |
|
|
////////////////////// |
30 |
|
|
// LIST EDGES CLASS // |
31 |
|
|
////////////////////// |
32 |
|
|
/*! |
33 |
|
|
\class ListEdges |
34 |
|
|
\authors J.Castelneau & J.Foulon |
35 |
|
|
|
36 |
|
|
\brief Class implementing the list of geometric edges |
37 |
|
|
|
38 |
|
|
A list of edges is defined by |
39 |
|
|
- a list of pointer on edge |
40 |
|
|
- the total number of edges |
41 |
|
|
- a chained list of edges |
42 |
|
|
|
43 |
|
|
To access at the edge defined by the 2 vertices (i,j): |
44 |
|
|
- go to the i-th index in the list of pointer |
45 |
|
|
- browse the chained list of edges where 1st vertex is i |
46 |
|
|
*/ |
47 |
|
|
// class Edge; |
48 |
|
|
class NeighFacesOfEdges; |
49 |
|
|
class NeighVolumesOfEdges; |
50 |
|
|
|
51 |
|
|
class ListEdges { |
52 |
|
|
|
53 |
|
|
typedef felisce::shared_ptr<NeighFacesOfEdges> shar_ptrFace; |
54 |
|
|
typedef felisce::shared_ptr<NeighVolumesOfEdges> shar_ptrVol; |
55 |
|
|
|
56 |
|
|
public: |
57 |
|
|
|
58 |
|
|
static const felInt m_null_int; |
59 |
|
|
|
60 |
|
|
// Constructor / Destructor |
61 |
|
|
// ======================= |
62 |
|
1277 |
ListEdges(): m_numEdges(0), m_numGivenEdges(0),m_numOfEdgesSupportingADof(0) {} |
63 |
|
|
~ListEdges(); |
64 |
|
|
|
65 |
|
|
//! Copy constructor, to avoid warning due to user-declared destructor. |
66 |
|
|
ListEdges(const ListEdges&) = default; |
67 |
|
|
|
68 |
|
|
public: |
69 |
|
|
|
70 |
|
|
void searchAddEdge(felInt pt_edge_beg, felInt pt_edge_end, |
71 |
|
|
shar_ptrFace the_face_neighbour, |
72 |
|
|
shar_ptrVol the_vol_neighbour); |
73 |
|
|
|
74 |
|
|
// return the edge id, if edge=[beg,end] found, else return -1 |
75 |
|
|
felInt findEdge( felInt pt_edge_beg, felInt pt_edge_end ) const; |
76 |
|
|
void searchEdge(const std::vector<felInt>& edgePts, Edge& resultEdge) const; |
77 |
|
|
void print( std::ostream& outstr = std::cout, int verbose = 0, int orderFormat = 0 ) const; |
78 |
|
|
|
79 |
|
|
// getters |
80 |
|
|
// ====== |
81 |
|
1698703 |
inline const std::vector<Edge*>& list() const { |
82 |
|
1698703 |
return m_listEdges; |
83 |
|
|
} |
84 |
|
|
inline const std::vector<Edge*>& listBegin() const { |
85 |
|
|
return m_listBeginEdge; |
86 |
|
|
} |
87 |
|
66 |
inline const felInt & numEdges() const { |
88 |
|
66 |
return m_numEdges; |
89 |
|
|
} |
90 |
|
186 |
inline const felInt & numGivenEdges() const { |
91 |
|
186 |
return m_numGivenEdges; |
92 |
|
|
} |
93 |
|
232296 |
inline const felInt & numEdgesSupportingADof() const { |
94 |
|
232296 |
return m_numOfEdgesSupportingADof; |
95 |
|
|
} |
96 |
|
|
|
97 |
|
|
// setters |
98 |
|
|
// ====== |
99 |
|
4450 |
inline std::vector <Edge*> & list() { |
100 |
|
4450 |
return m_listEdges; |
101 |
|
|
} |
102 |
|
|
inline std::vector <Edge*> & listBegin() { |
103 |
|
|
return m_listBeginEdge; |
104 |
|
|
} |
105 |
|
|
//inline felInt & numEdges() { return m_numEdges; } |
106 |
|
9866 |
Edge* operator[](felInt i) { |
107 |
|
9866 |
return m_listEdges[i]; |
108 |
|
|
} |
109 |
|
|
inline const Edge* operator[](felInt i) const { |
110 |
|
|
return m_listEdges[i]; |
111 |
|
|
} |
112 |
|
|
|
113 |
|
93 |
void setNumGivenEdges() { |
114 |
|
93 |
m_numGivenEdges = m_numEdges; |
115 |
|
93 |
} |
116 |
|
|
|
117 |
|
|
void clearAndInit(felInt numPts); |
118 |
|
|
double countAndComputeIdEdgesSupportingDofs(const RefElement& refEle); |
119 |
|
|
|
120 |
|
|
private: |
121 |
|
|
felInt m_numEdges; |
122 |
|
|
felInt m_numGivenEdges; |
123 |
|
|
felInt m_numOfEdgesSupportingADof; |
124 |
|
|
std::vector<Edge*> m_listBeginEdge; |
125 |
|
|
std::vector<Edge*> m_listEdges; |
126 |
|
|
|
127 |
|
|
void m_insertNeighbors(Edge* the_edge, |
128 |
|
|
shar_ptrFace the_face_neighbour, |
129 |
|
|
shar_ptrVol the_vol_neighbour) const; |
130 |
|
|
|
131 |
|
|
}; |
132 |
|
|
} |
133 |
|
|
|
134 |
|
|
#endif |
135 |
|
|
|