-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProblem.h
96 lines (62 loc) · 1.67 KB
/
Problem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef __PROBLEM__RYR
#define __PROBLEM__RYR
#include "Mesh.h"
#include "helpers/Helpers.h"
#include "Stimul.h"
#include "Matrix.h"
#include "models/ModelFactory.h"
#include "pio/PIO.h"
#include <fstream>
namespace ryr
{
class Problem
{
public:
Problem(): matrix_(NULL), time_(0), linear_solver_(NULL) {}
virtual ~Problem() {
delete matrix_;
delete linear_solver_;
}
void init(mpi::MPIComm* comm);
void solve_operator_splitting();
protected:
void create_matrix_map();
void create_matrix_operator_splitting();
void iteration_operator_splitting();
void calc_rhs_operator_splitting(std::vector<double>& rhs);
void process_stimuli();
void integrate_ionic_models();
// void init_ionic_models();
void add_ionic_models();
void save_to_disc();
void mpi_read();
void mpi_write(double time);
void read_restart(std::istream& file);
void write_restart(std::ostream& file);
void update_calcium();
private:
void close_probe_files();
factory::ModelFactory factory_;
std::string probe_prefix_;
std::list<cell::MainCell*> probe_cells_;
std::list<std::ofstream*> probe_files_;
double save_dt_;
mesh::Mesh mesh_;
std::list<Stimul> stimul_;
double dt_, duration_, time_;
sparse_matrix::HypreMatrix *matrix_;
mpi::MPIComm* comm_;
std::vector<int> n_cols_per_row_;
std::vector<int> matrix_cols_;
std::vector<double> matrix_vals_;
linear_solver::LinearSolver* linear_solver_;
//restart
bool save_restart_, read_restart_;
double restart_interval_, restart_start_, restart_end_;
std::string restart_file_name_, restart_prefix_;
double calcium_resistance_factor_;
bool single_output_;
pio::PIO pio;
};
}
#endif