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 |
|
|
// System includes |
16 |
|
|
|
17 |
|
|
// External includes |
18 |
|
|
|
19 |
|
|
// Project includes |
20 |
|
|
#include "Core/felisceTransient.hpp" |
21 |
|
|
|
22 |
|
|
namespace felisce |
23 |
|
|
{ |
24 |
|
|
|
25 |
|
454 |
FelisceTransient::FelisceTransient(): |
26 |
|
454 |
timeStep(FelisceParam::instance().timeStep), |
27 |
|
454 |
time(FelisceParam::instance().time), |
28 |
|
454 |
iteration(FelisceParam::instance().iteration) |
29 |
|
|
{ |
30 |
|
|
|
31 |
|
454 |
} |
32 |
|
|
|
33 |
|
|
/***********************************************************************************/ |
34 |
|
|
/***********************************************************************************/ |
35 |
|
|
|
36 |
|
462 |
FelisceTransient::FelisceTransient(const FelisceTransient& rFelisceTransient): |
37 |
|
462 |
timeStep(rFelisceTransient.timeStep), |
38 |
|
462 |
time(rFelisceTransient.time), |
39 |
|
462 |
iteration(rFelisceTransient.iteration) |
40 |
|
|
{ |
41 |
|
|
|
42 |
|
462 |
} |
43 |
|
|
|
44 |
|
|
/***********************************************************************************/ |
45 |
|
|
/***********************************************************************************/ |
46 |
|
|
|
47 |
|
✗ |
std::string FelisceTransient::itStr() const |
48 |
|
|
{ |
49 |
|
✗ |
const int N = 5; |
50 |
|
✗ |
std::stringstream aus; |
51 |
|
|
int k; |
52 |
|
✗ |
if ( iteration < 10 ) { |
53 |
|
✗ |
k=1; |
54 |
|
✗ |
} else if ( iteration < 100 ) { |
55 |
|
✗ |
k=2; |
56 |
|
✗ |
} else if ( iteration < 1000 ) { |
57 |
|
✗ |
k=3; |
58 |
|
|
} else { |
59 |
|
✗ |
k=4; |
60 |
|
|
} |
61 |
|
✗ |
for(int nzero = 0; nzero < N - k; ++nzero) |
62 |
|
✗ |
aus << "0"; |
63 |
|
✗ |
aus << iteration; |
64 |
|
✗ |
return aus.str().c_str(); |
65 |
|
|
} |
66 |
|
|
|
67 |
|
|
/***********************************************************************************/ |
68 |
|
|
/***********************************************************************************/ |
69 |
|
|
|
70 |
|
✗ |
void FelisceTransient::print() const |
71 |
|
|
{ |
72 |
|
|
std::cout << "==============================================================" |
73 |
|
|
<< "\nFelisceTransient\n" |
74 |
|
|
<< "==============================================================" |
75 |
|
✗ |
<< "\ntimeStep = " << timeStep |
76 |
|
✗ |
<< "\ntime = " << time |
77 |
|
✗ |
<< "\niteration = " << iteration << "\n" << std::endl; |
78 |
|
|
} |
79 |
|
|
|
80 |
|
|
} |
81 |
|
|
|