Directory: | ./ |
---|---|
File: | Geometry/Tools/boundingBox.cpp |
Date: | 2024-04-14 07:32:34 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 10 | 10 | 100.0% |
Branches: | 6 | 6 | 100.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 | // System includes | ||
16 | |||
17 | // External includes | ||
18 | |||
19 | // Project includes | ||
20 | #include "Geometry/Tools/boundingBox.hpp" | ||
21 | |||
22 | namespace felisce | ||
23 | { | ||
24 | |||
25 | 17 | BoundingBox::BoundingBox(const GeometricMeshRegion& mesh): | |
26 | 17 | BoundingBox::BoundingBox(mesh.numCoor(), mesh.listPoints()) {} | |
27 | |||
28 | /***********************************************************************************/ | ||
29 | /***********************************************************************************/ | ||
30 | |||
31 | 17 | void BoundingBox::computeDelta(const int dim) | |
32 | { | ||
33 | double tmp; | ||
34 | 17 | double delta = -1; | |
35 |
2/2✓ Branch 0 taken 41 times.
✓ Branch 1 taken 17 times.
|
58 | for (int i = 0; i < dim; ++i) { |
36 | 41 | tmp = std::fabs( m_max.coor(i) - m_min.coor(i) ); | |
37 | // if ( tmp > m_delta.coor(i) ) m_delta.coor(i) = tmp; | ||
38 |
2/2✓ Branch 0 taken 17 times.
✓ Branch 1 taken 24 times.
|
41 | if ( tmp > delta ) delta = tmp; |
39 | } | ||
40 | |||
41 |
2/2✓ Branch 0 taken 41 times.
✓ Branch 1 taken 17 times.
|
58 | for (int i = 0; i < dim; ++i) |
42 | 41 | m_delta.coor(i) = delta; | |
43 | 17 | } | |
44 | |||
45 | } | ||
46 |