-
Notifications
You must be signed in to change notification settings - Fork 3
/
simu.h
83 lines (54 loc) · 1.23 KB
/
simu.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
#ifndef _SIMU_H_
#define _SIMU_H_
class sim_data
{
public:
// sim_data {}
int set_no_of_particles(int nn) {
h_=std::sqrt(1.0/FT(nn));
no_of_particles_=nn;
return nn;
}
void set_totalV (const FT totalV ) {
totalV_ = totalV;
}
void set_innerV (const FT innerV ) {
innerV_ = innerV;
meanV_ = innerV / FT( no_of_particles_ );
}
FT totalV() const {
return totalV_;
}
FT meanV() const {
return meanV_;
}
int current_step() const {return current_step_;}
int next_step() {return ++current_step_;}
FT set_dt(FT tt) {return dt_ = tt ;}
FT dt() const {return dt_ ;}
FT advance_time() {return time_+=dt() ;}
FT time() const {return time_ ;}
bool perturb() const {return perturb_;}
FT do_perturb( FT pp=0 ) { perturb_ = true ; return pert_rel_ = pp ; }
FT pert_rel() const {
if(perturb_) return pert_rel_;
else return 0.0;
}
FT h() const { return h_; }
int no_of_particles() const { return no_of_particles_;}
private:
int no_of_particles_;
FT h_;
int Nsteps_;
int every_;
int current_step_;
FT dt_;
FT time_;
bool perturb_;
FT pert_rel_;
FT totalV_;
FT innerV_;
FT meanV_;
};
extern sim_data simu;
#endif