CosmoGRaPH v0.0
sim.h
1 #ifndef COSMO_SIM_H
2 #define COSMO_SIM_H
3 
4 #include "../cosmo_includes.h"
5 #include "../cosmo_types.h"
6 
7 #include "../utils/Fourier.h"
8 #include "../utils/FRW.h"
9 
10 #include "../IO/io.h"
11 #include "../components/bssn/bssn.h"
12 #include "../components/bssn/bardeen.h"
13 
14 namespace cosmo
15 {
16 
17 class CosmoSim
18 {
19 protected:
20  idx_t step;
21  idx_t num_steps;
22  bool dt_flip;
23  idx_t dt_flip_step;
24  real_t t;
25 
26  std::string simulation_type;
27  IOData * iodata;
28  Fourier * fourier;
29 
30  BSSN * bssnSim;
31 
32  Bardeen * bardeen;
33  bool use_bardeen;
34 
35  int verbosity;
36 
37 # if USE_COSMOTRACE
38  bool ray_integrate;
39  idx_t ray_flip_step;
40  std::vector<RayTrace<real_t, idx_t> *> rays;
41  bool simple_raytrace;
42 # endif
43 
44 public:
45  CosmoSim();
46  virtual ~CosmoSim() {};
47 
48  // These functions will be called in main();
49  // Each derived class should implement them.
50  virtual void init() = 0;
51  virtual void runStep() = 0;
52  virtual void setICs() = 0;
53 
54  void simInit();
55  void run();
56  void runCommonStepTasks();
57 
58 # if USE_COSMOTRACE
59  void runRayTraceStep();
60  void outputRayTraceStep();
61 # endif
62 
63  void prepBSSNOutput();
64  void outputStateInformation();
65 
66  idx_t simNumNaNs();
67  void setVerbosity(int verbosity_in);
68 
69 };
70 
71 } /* namespace cosmo */
72 
73 #endif
Definition: IOData.h:18
void simInit()
Initialize individual simulation class instances.
Definition: sim.cc:59
Definition: bardeen.cc:5
void run()
Run the simulation.
Definition: sim.cc:101
Definition: bardeen.h:25
Definition: Fourier.h:21
BSSN Class: evolves BSSN metric fields, computes derived quantities.
Definition: bssn.h:24
Definition: sim.h:17
real_t t
Time @ current step.
Definition: sim.h:24