CosmoGRaPH v0.0
scalar.h
1 #ifndef COSMO_SCALAR
2 #define COSMO_SCALAR
3 
4 #include "../../cosmo_types.h"
5 #include "../bssn/bssn.h"
6 
7 
8 namespace cosmo
9 {
10 
11 typedef struct {
12 
13  // field values
14  real_t phi, Pi, psi1, psi2, psi3;
15 
16  // derivatives of fields
17  real_t d1phi, d2phi, d3phi;
18  real_t d1Pi, d2Pi, d3Pi;
19  real_t d1psi1, d2psi1, d3psi1;
20  real_t d1psi2, d2psi2, d3psi2;
21  real_t d1psi3, d2psi3, d3psi3;
22 
23 } ScalarData;
24 
29 class Scalar
30 {
31  // real_t (*_dV)(real_t);
32  // real_t (*_V)(real_t);
33 
34 public:
35  register_t phi;
36  register_t Pi;
37  register_t psi1;
38  register_t psi2;
39  register_t psi3;
40 
41  Scalar();
42  ~Scalar();
43 
44  void stepInit();
45  void K1Finalize();
46  void K2Finalize();
47  void K3Finalize();
48  void K4Finalize();
49  void RKEvolvePt(BSSNData *bd);
50 
51  ScalarData getScalarData(BSSNData *bd);
52 
53  real_t dt_phi(BSSNData *bd, ScalarData *sd);
54  real_t dt_Pi(BSSNData *bd, ScalarData *sd);
55  real_t dt_psi1(BSSNData *bd, ScalarData *sd);
56  real_t dt_psi2(BSSNData *bd, ScalarData *sd);
57  real_t dt_psi3(BSSNData *bd, ScalarData *sd);
58 
59  // Determine potential using an anonymous function?
60  // template<typename F>
61  // set_dV()
62  // {
63  // }
64 
65  real_t dV(real_t phi_in);
66  real_t V(real_t phi_in);
67  void addBSSNSource(BSSN * bssn);
68 
69  real_t scalarConstraint(idx_t i, idx_t j, idx_t k, idx_t dir);
70 
71 };
72 
73 } // namespace cosmo
74 
75 #endif
Definition: bardeen.cc:5
void K1Finalize()
Call RK4Register::K1Finalize for fields.
Definition: scalar.cc:49
BSSN Class: evolves BSSN metric fields, computes derived quantities.
Definition: bssn.h:24
Structure containing BSSN metric variables and various derived quantities, such as derivatives of BSS...
Definition: bssn_data.h:18
void stepInit()
Call RK4Register::stepInit for fields.
Definition: scalar.cc:37
Definition: scalar.h:11
Class implementing functionality for a scalar field that relies on a BSSN instance.
Definition: scalar.h:29
Scalar()
Constructor: initialize fields needed for scalar evolution, set timestep according to global dt...
Definition: scalar.cc:13