GCC Code Coverage Report


Directory: ./
File: Geometry/Tools/locator.hpp
Date: 2024-04-14 07:32:34
Exec Total Coverage
Lines: 2 2 100.0%
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:
13 //
14
15 #ifndef FEL_LOCATOR_HPP
16 #define FEL_LOCATOR_HPP
17
18 // System includes
19
20 // External includes
21
22 // Project includes
23 #include "Core/shared_pointers.hpp"
24 #include "Geometry/geometricMeshRegion.hpp"
25 #include "Geometry/Tools/hashtable.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 class Locator
49 {
50 public:
51 ///@name Type Definitions
52 ///@{
53
54 static constexpr std::size_t HASHSIZ = 256;
55
56 typedef GeometricMeshRegion::seedElement seedElement;
57
58 typedef GeometricMeshRegion::ElementType ElementType;
59
60 /// Pointer definition of Locator
61 FELISCE_CLASS_POINTER_DEFINITION(Locator);
62
63 ///@}
64 ///@name Life Cycle
65 ///@{
66
67 Locator() = delete;
68
69 Locator(GeometricMeshRegion* mesh, const bool allowProjection = false, const double tolRescaling = 1., const int verbose = 0);
70
71 Locator(const Locator& ) = delete;
72
73 Locator(Locator&& ) = delete;
74
75 Locator& operator=(const Locator& ) = delete;
76
77 Locator& operator=(Locator&& ) = delete;
78
79 ~Locator();
80
81 ///@}
82 ///@name Variables
83 ///@{
84
85 ///@}
86 ///@name Operators
87 ///@{
88
89 ///@}
90 ///@name Operations
91 ///@{
92
93 void findListPointsInMesh(std::vector<felInt>& indElt, std::vector<ElementType>& typElt, const std::vector<Point>& listPoint);
94
95 void findListPointsInMesh(std::vector<seedElement>& elt, const std::vector<Point>& listPoint);
96
97 bool findPointInMesh(seedElement& elt, const Point& point);
98
99 seedElement localizePoint(seedElement seed, const Point& point, Point& pointInRefElm, std::size_t mark);
100
101 void resetMarkElement();
102
103 ///@}
104 ///@name Access
105 ///@{
106
107 inline const std::size_t & getMark() const { return m_mark; }
108 1805 inline std::size_t & getMark() { return m_mark; }
109
110 ///@}
111 ///@name Inquiry
112 ///@{
113
114 ///@}
115 ///@name Input and output
116 ///@{
117
118 ///@}
119 ///@name Friends
120 ///@{
121
122 ///@}
123 protected:
124 ///@name Protected static Member Variables
125 ///@{
126
127 ///@}
128 ///@name Protected member Variables
129 ///@{
130
131 /// Flag to allow projection
132 bool m_allowProjection = false;
133
134 /// Tolerance
135 double m_tol;
136
137 /// Verbose level
138 const int m_verbose;
139
140 /// Marked element counter
141 std::size_t m_mark;
142
143 /// Marked element vector
144 std::array<std::size_t*, GeometricMeshRegion::m_numTypesOfElement> m_markElement;
145
146 /// Geometric mesh
147 GeometricMeshRegion *m_mesh = nullptr;
148
149 /// Hash table
150 HashTable::Pointer m_hash = nullptr;
151
152 /// Bounding box
153 BoundingBox::Pointer m_bbox = nullptr;
154
155 ///@}
156 ///@name Protected Operators
157 ///@{
158
159 ///@}
160 ///@name Protected Operations
161 ///@{
162
163 ///@}
164 ///@name Protected Access
165 ///@{
166
167 ///@}
168 ///@name Protected Inquiry
169 ///@{
170
171 ///@}
172 ///@name Protected LifeCycle
173 ///@{
174
175 ///@}
176 private:
177 ///@name Private static Member Variables
178 ///@{
179
180 ///@}
181 ///@name Private member Variables
182 ///@{
183
184 ///@}
185 ///@name Private Operators
186 ///@{
187
188 ///@}
189 ///@name Private Operations
190 ///@{
191
192 bool projectPointOnMesh(seedElement& elt, const Point& pntIn);
193
194 ///@}
195 ///@name Private Access
196 ///@{
197
198 6358 inline std::size_t & markElement(ElementType ityp, felInt ind) { return m_markElement[ityp][ind]; }
199 inline std::size_t markElement(ElementType ityp, felInt ind) const { return m_markElement[ityp][ind]; }
200
201 ///@}
202 ///@name Private Inquiry
203 ///@{
204
205 ///@}
206 ///@name Private LifeCycle
207 ///@{
208
209 ///@}
210 };
211 ///@}
212 ///@name Type Definitions
213 ///@{
214
215 ///@}
216 } /* namespace felisce.*/
217
218 #endif /* FEL_LOCATOR_HPP defined */
219
220