GCC Code Coverage Report


Directory: ./
File: Geometry/geometricFaces.cpp
Date: 2024-04-14 07:32:34
Exec Total Coverage
Lines: 21 32 65.6%
Branches: 9 30 30.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/geometricFaces.hpp"
21 #include "Geometry/neighVolumesOfFaces.hpp"
22
23 namespace felisce {
24
25
26 1539584 Face::Face(const std::vector <felInt>& ptOfFace, const felInt & idFace):
27 1539584 m_ptrNext(nullptr),
28 1539584 m_vecFace(ptOfFace),
29 1539584 m_id(idFace)
30 1539584 {}
31
32 //----------------
33 1733021 Face::~Face() {
34
2/2
✓ Branch 1 taken 3052381 times.
✓ Branch 2 taken 1733021 times.
4785402 for ( std::size_t i(0); i<m_listNeighVolumes.size(); ++i)
35
1/2
✓ Branch 1 taken 3052381 times.
✗ Branch 2 not taken.
3052381 delete m_listNeighVolumes[i];
36 1733021 m_listNeighVolumes.clear();
37 1733021 }
38
39 //----------------
40 193437 void Face::copyFace(Face& face) {
41
1/2
✓ Branch 2 taken 193437 times.
✗ Branch 3 not taken.
193437 m_vecFace = face.vecFace();
42 193437 m_id = face.id();
43
1/2
✓ Branch 2 taken 193437 times.
✗ Branch 3 not taken.
193437 std::vector < NeighVolumesOfFaces* > aus = face.listNeighVolumes();
44
1/2
✓ Branch 2 taken 193437 times.
✗ Branch 3 not taken.
193437 m_listNeighVolumes.resize(aus.size());
45
2/2
✓ Branch 1 taken 193437 times.
✓ Branch 2 taken 193437 times.
386874 for ( std::size_t i = 0; i<aus.size();++i) {
46
1/2
✓ Branch 1 taken 193437 times.
✗ Branch 2 not taken.
193437 NeighVolumesOfFaces *current = new NeighVolumesOfFaces;
47 193437 *current = *aus[i];
48 193437 m_listNeighVolumes[i] = current;
49 }
50 193437 m_ptrNext = nullptr; //Why is it std::set to 0?
51 193437 }
52
53 //----------------
54 void Face::print( std::ostream& outstr, int verbose, bool printNextFace ) const {
55 for (auto it_vec = m_vecFace.begin(); it_vec != m_vecFace.end(); it_vec++) {
56 outstr << *it_vec << " " << std::flush;
57 }
58 outstr << " " << m_id << "\t=> " << std::flush;
59 for (unsigned int ineigh = 0 ; ineigh < m_listNeighVolumes.size(); ineigh++) {
60 m_listNeighVolumes[ineigh]->print(outstr, verbose);
61 }
62 outstr << std::endl;
63 if ( printNextFace ) {
64 if (m_ptrNext == nullptr) {
65 if ( verbose > 30 ) outstr << "-> NULL " << std::endl;
66 } else {
67 m_ptrNext->print(outstr, verbose);
68 }
69 }
70 }
71 }
72