-
Notifications
You must be signed in to change notification settings - Fork 0
/
sim_controller.h
48 lines (41 loc) · 1.4 KB
/
sim_controller.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
#ifndef SIM_C
#define SIM_C
#include "sim_dat.h"
#include "integrator.h"
#define MAX_STEPS 100000
class SimController {
private:
float pop_m, pop_q, pop_T;
SimDat * sd = NULL;
float t_final, dt;
bool created_particles=false, pop_set=false;
public:
int N_particles;
Particle * init_pop;
const char * outname;
bool uniform_E = false;
Particle draw_particle(int cell_idx);
Particle draw_radial_particle(float r);
void run_sim();
void run_radius(float r, int N_p);
void run_cell(int i, int j, int k, int label);
void write_cell_data(int cell_idx, float * positions_start, float * velocities_start, float * positions_end, float * velocities_end,int * all_status);
void set_particle_pop(float mass, float charge, float temperature);
bool eval_cell(int cell_idx);
void setup_datawriter();
void setup_particlewriter();
void write_particle(int cell_idx, int p_idx, int N, float pdata[6][MAX_STEPS]);
SimController(int new_N_particles,
float new_t_final,
float new_dt,
SimDat & new_sd,
const char * new_outname) :
N_particles(new_N_particles), t_final(new_t_final),
dt(new_dt), sd(&new_sd), outname(new_outname){}
~SimController(){
if (created_particles){
delete[] init_pop;
}
}
};
#endif