GCC Code Coverage Report


Directory: ./
File: Solver/lumpedModelBC.hpp
Date: 2024-04-14 07:32:34
Exec Total Coverage
Lines: 13 17 76.5%
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: J-F. Gerbeau
13 //
14
15 #ifndef _LUMPEDMODELBC_HPP
16 #define _LUMPEDMODELBC_HPP
17
18 // System includes
19 #include <string>
20
21 // External includes
22 #include "Core/NoThirdPartyWarning/Petsc/vec.hpp"
23
24 // Project includes
25 #include "Core/felisce.hpp"
26 #include "FiniteElement/geoElement.hpp"
27 #include "Core/felisceParam.hpp"
28 #include "Core/felisceTransient.hpp"
29
30 namespace felisce {
31 class LumpedModelBC {
32 FelisceTransient::Pointer m_fstransient;
33 std::size_t m_size;
34 std::vector<double> m_Rd;
35 std::vector<double> m_Rp;
36 std::vector<double> m_C;
37 std::vector<double> m_Pv;
38 std::vector<double> m_Pd0;
39 std::vector<double> m_Pd;
40 std::vector<double> m_PdOld;
41 std::vector<double> m_Pp;
42 std::vector<double> m_PpOld;
43 std::vector<double> m_Q;
44 std::vector<std::string> m_name;
45
46 // parameters for non linear compliance C=C(V)
47 //==============================
48 // volume at the last time step (explicit)
49 double m_volume_n_1;
50 double m_volumeMax;
51 double m_volumeMin;
52 double m_volumeMaxTilde;
53 double m_volumeMinTilde;
54 // volume at rest
55 double m_volume0;
56 double m_volume0ref;
57 int m_powerNonLinearCompliance;
58
59 double computeNonLinearCompliance(std::size_t& idBCwindk);
60
61 public:
62 //!Constructor.
63 LumpedModelBC(FelisceTransient::Pointer fstransient);
64 //!Destructor.
65 20 ~LumpedModelBC() = default;
66 void iterate();
67 void print(int verbose, std::ostream& c = std::cout) const;
68
69 44 void setRd( const std::vector<double>& rd ) {
70 44 m_Rd = rd;
71 44 }
72 44 void setC( const std::vector<double>& c ) {
73 44 m_C = c;
74 44 }
75
76 // access function
77 568 double& Q(int i) {
78 568 return m_Q[i];
79 }
80 double Q(int i) const {
81 return m_Q[i];
82 }
83
84 double& Pd(int i) {
85 return m_Pd[i];
86 }
87 double Pd(int i) const {
88 return m_Pd[i];
89 }
90
91 338 double Pp(int i) const {
92 338 return m_Pp[i];
93 }
94
95 double PpOld(int i) const {
96 return m_PpOld[i];
97 }
98
99 inline const std::vector<double>& Pp() const {
100 return m_Pp;
101 }
102 inline std::vector<double>& Pp() {
103 return m_Pp;
104 }
105
106 inline const std::size_t & size() const {
107 return m_size;
108 }
109 667752 inline std::size_t & size() {
110 667752 return m_size;
111 }
112
113 double& volume_n_1() {
114 return m_volume_n_1;
115 }
116 double volume_n_1() const {
117 return m_volume_n_1;
118 }
119
120 double& volume0() {
121 return m_volume0;
122 }
123 double volume0() const {
124 return m_volume0;
125 }
126
127 double& C(int i) {
128 return m_C[i];
129 }
130 double C(int i) const {
131 return m_C[i];
132 }
133
134 void write(std::string filename) const;
135
136 };
137 }
138
139 #endif
140
141