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, E. Schenone |
13 |
|
|
// |
14 |
|
|
|
15 |
|
|
#ifndef _SolutionBackup_HPP |
16 |
|
|
#define _SolutionBackup_HPP |
17 |
|
|
|
18 |
|
|
// System includes |
19 |
|
|
|
20 |
|
|
// External includes |
21 |
|
|
|
22 |
|
|
// Project includes |
23 |
|
|
#include "Core/felisce.hpp" |
24 |
|
|
#include "DegreeOfFreedom/listVariable.hpp" |
25 |
|
|
#include "InputOutput/io.hpp" |
26 |
|
|
|
27 |
|
|
namespace felisce { |
28 |
|
|
class SolutionBackup { |
29 |
|
|
/*! |
30 |
|
|
\class SolutionBackup |
31 |
|
|
\authors J-F. Gerbeau, E. Schenone |
32 |
|
|
\date July 2012 |
33 |
|
|
\brief To backup the variables |
34 |
|
|
|
35 |
|
|
*/ |
36 |
|
|
std::vector<IO::Pointer> m_io; |
37 |
|
|
std::vector<bool> m_meshIsWritten; |
38 |
|
|
|
39 |
|
|
public: |
40 |
|
|
SolutionBackup(); |
41 |
|
|
~SolutionBackup(); |
42 |
|
|
|
43 |
|
|
//! Copy constructor, to avoid warning due to user-declared destructor. |
44 |
|
✗ |
SolutionBackup(const SolutionBackup&) = default; |
45 |
|
|
|
46 |
|
|
void initialize(const std::string& inputDirectory,const std::string& inputFile, const std::vector<std::string>& inputMesh, const std::vector<std::string>& outputMesh, |
47 |
|
|
const std::string& meshDir, const std::string& resultDir, const std::vector<std::string>& prefixName); |
48 |
|
|
|
49 |
|
|
void print(int verbose, std::ostream& outstr) const; |
50 |
|
|
|
51 |
|
|
bool hasToBackup(int iter, int freq) const; |
52 |
|
|
|
53 |
|
|
void backup(double time, std::vector<GeometricMeshRegion::Pointer>& mesh, const int rank=0); |
54 |
|
|
|
55 |
|
|
const std::vector<IO::Pointer>& listIO() const { |
56 |
|
|
return m_io; |
57 |
|
|
} |
58 |
|
|
|
59 |
|
✗ |
std::vector<IO::Pointer>& listIO() { |
60 |
|
✗ |
return m_io; |
61 |
|
|
} |
62 |
|
|
|
63 |
|
|
const IO::Pointer io(int id=0) const { |
64 |
|
|
return m_io[id]; |
65 |
|
|
} |
66 |
|
|
|
67 |
|
✗ |
IO::Pointer io(int id=0) { |
68 |
|
✗ |
return m_io[id]; |
69 |
|
|
} |
70 |
|
|
|
71 |
|
|
}; |
72 |
|
|
} |
73 |
|
|
|
74 |
|
|
#endif |
75 |
|
|
|