Directory: | ./ |
---|---|
File: | FiniteElement/listCurrentFiniteElementWithBd.hpp |
Date: | 2024-04-14 07:32:34 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 11 | 11 | 100.0% |
Branches: | 3 | 4 | 75.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. Foulon | ||
13 | // | ||
14 | |||
15 | #ifndef LISTCURRENTFINITEELEMENTWITHBD_H | ||
16 | #define LISTCURRENTFINITEELEMENTWITHBD_H | ||
17 | |||
18 | // System includes | ||
19 | #include <vector> | ||
20 | |||
21 | // External includes | ||
22 | |||
23 | // Project includes | ||
24 | #include "Core/felisce.hpp" | ||
25 | #include "FiniteElement/currentFiniteElementWithBd.hpp" | ||
26 | |||
27 | namespace felisce | ||
28 | { | ||
29 | ///@name felisce Globals | ||
30 | ///@{ | ||
31 | |||
32 | ///@} | ||
33 | ///@name Type Definitions | ||
34 | ///@{ | ||
35 | |||
36 | ///@} | ||
37 | ///@name Enum's | ||
38 | ///@{ | ||
39 | |||
40 | ///@} | ||
41 | ///@name Functions | ||
42 | ///@{ | ||
43 | |||
44 | ///@} | ||
45 | ///@name felisce Classes | ||
46 | ///@{ | ||
47 | |||
48 | /** | ||
49 | * @class ListCurrentFiniteElementWithBd | ||
50 | * @author J. Foulon | ||
51 | * @date 27/01/2011 | ||
52 | * @brief Class containing a list of finite elements in the problem. | ||
53 | * These finite elements are stored with an STL vector. | ||
54 | * @todo Replace with a template | ||
55 | */ | ||
56 | class ListCurrentFiniteElementWithBd | ||
57 | { | ||
58 | public: | ||
59 | ///@name Type Definitions | ||
60 | ///@{ | ||
61 | |||
62 | ///@} | ||
63 | ///@name Life Cycle | ||
64 | ///@{ | ||
65 | |||
66 | /// Default constructor | ||
67 | 518 | ListCurrentFiniteElementWithBd() = default; | |
68 | |||
69 | /// Destructor | ||
70 | 518 | ~ListCurrentFiniteElementWithBd() | |
71 | { | ||
72 | 518 | clear(); | |
73 | 518 | } | |
74 | |||
75 | ///@} | ||
76 | ///@name Operators | ||
77 | ///@{ | ||
78 | |||
79 | 208 | CurrentFiniteElementWithBd* operator[](int i) { | |
80 | 208 | return m_listCurrentFiniteElementWithBd[i]; | |
81 | } | ||
82 | |||
83 | ///@} | ||
84 | ///@name Operations | ||
85 | ///@{ | ||
86 | |||
87 | //Set functions | ||
88 | //============= | ||
89 | void add(CurrentFiniteElementWithBd* fe); | ||
90 | |||
91 | 6006 | void clear() | |
92 | { | ||
93 |
2/2✓ Branch 1 taken 9968 times.
✓ Branch 2 taken 6006 times.
|
15974 | for (std::size_t i = 0; i < m_listCurrentFiniteElementWithBd.size(); i++) |
94 |
1/2✓ Branch 1 taken 9968 times.
✗ Branch 2 not taken.
|
9968 | delete m_listCurrentFiniteElementWithBd[i]; |
95 | |||
96 | 6006 | m_listCurrentFiniteElementWithBd.clear(); | |
97 | 6006 | } | |
98 | |||
99 | ///@} | ||
100 | ///@name Access | ||
101 | ///@{ | ||
102 | |||
103 | inline const std::vector<CurrentFiniteElementWithBd*>& listCurrentFiniteElementWithBd() const { | ||
104 | return m_listCurrentFiniteElementWithBd; | ||
105 | } | ||
106 | |||
107 | inline std::vector<CurrentFiniteElementWithBd*>& listCurrentFiniteElementWithBd() { | ||
108 | return m_listCurrentFiniteElementWithBd; | ||
109 | } | ||
110 | |||
111 | std::size_t size() { | ||
112 | return m_listCurrentFiniteElementWithBd.size(); | ||
113 | } | ||
114 | |||
115 | ///@} | ||
116 | ///@name Inquiry | ||
117 | ///@{ | ||
118 | |||
119 | ///@} | ||
120 | ///@name Input and output | ||
121 | ///@{ | ||
122 | |||
123 | void print(int verbose,std::ostream& c=std::cout) const; | ||
124 | |||
125 | ///@} | ||
126 | ///@name Friends | ||
127 | ///@{ | ||
128 | |||
129 | ///@} | ||
130 | protected: | ||
131 | ///@name Protected static Member Variables | ||
132 | ///@{ | ||
133 | |||
134 | ///@} | ||
135 | ///@name Protected member Variables | ||
136 | ///@{ | ||
137 | |||
138 | ///@} | ||
139 | ///@name Protected Operators | ||
140 | ///@{ | ||
141 | |||
142 | ///@} | ||
143 | ///@name Protected Operations | ||
144 | ///@{ | ||
145 | |||
146 | ///@} | ||
147 | ///@name Protected Access | ||
148 | ///@{ | ||
149 | |||
150 | ///@} | ||
151 | ///@name Protected Inquiry | ||
152 | ///@{ | ||
153 | |||
154 | ///@} | ||
155 | ///@name Protected LifeCycle | ||
156 | ///@{ | ||
157 | |||
158 | ///@} | ||
159 | private: | ||
160 | ///@name Private static Member Variables | ||
161 | ///@{ | ||
162 | |||
163 | ///@} | ||
164 | ///@name Private member Variables | ||
165 | ///@{ | ||
166 | |||
167 | /// Vector STL which contains Felisce's currentFiniteElementWithBd. | ||
168 | std::vector<CurrentFiniteElementWithBd*> m_listCurrentFiniteElementWithBd; | ||
169 | |||
170 | ///@} | ||
171 | ///@name Private Operations | ||
172 | ///@{ | ||
173 | |||
174 | ///@} | ||
175 | ///@name Private Access | ||
176 | ///@{ | ||
177 | |||
178 | ///@} | ||
179 | ///@name Private Inquiry | ||
180 | ///@{ | ||
181 | |||
182 | ///@} | ||
183 | ///@name Private LifeCycle | ||
184 | ///@{ | ||
185 | |||
186 | ///@} | ||
187 | }; | ||
188 | ///@} | ||
189 | ///@name Type Definitions | ||
190 | ///@{ | ||
191 | |||
192 | ///@} | ||
193 | } /* namespace felisce.*/ | ||
194 | #endif | ||
195 | |||
196 |