Moved config to inside main and changed several arrays into vectors
This commit is contained in:
parent
329dd2ca4d
commit
747f9f9d89
7 changed files with 115 additions and 108 deletions
|
|
@ -46,7 +46,7 @@ public:
|
|||
const double dt_bh, // pn_usage should be const
|
||||
double3& acc1, double3& acc2,
|
||||
double3& jrk1, double3& jrk2);
|
||||
void write_bh_data(double time_cur, double m[], double3 x[], double3 v[], const std::vector<double>& pot, double3 a[], double3 adot[], double dt[]);
|
||||
void write_bh_data(double time_cur, const std::vector<double> &m, const std::vector<double3> &x, const std::vector<double3> &v, const std::vector<double> &pot, double3 a[], double3 adot[], double dt[]);
|
||||
public: //TODO make private
|
||||
double m1, m2;
|
||||
int count;
|
||||
|
|
@ -58,11 +58,9 @@ public: //TODO make private
|
|||
Bbh_gravity bbh_grav;
|
||||
};
|
||||
|
||||
//void write_bh_nb_data(int nb, int smbh_count, double time_cur, int N, double m[], double3 x[], double3 v[]);
|
||||
|
||||
class Write_bh_nb_data {
|
||||
public:
|
||||
Write_bh_nb_data(int nb, int smbh_count, int N, double *m, double3 *x, double3 *v)
|
||||
Write_bh_nb_data(int nb, int smbh_count, int N, const std::vector<double> &m, const std::vector<double3> &x, const std::vector<double3> &v)
|
||||
: nb(nb), smbh_count(smbh_count), N(N), m(m), x(x), v(v)
|
||||
{
|
||||
ind_sort.resize(N);
|
||||
|
|
@ -76,8 +74,8 @@ public:
|
|||
void operator()(double time_cur);
|
||||
private:
|
||||
int nb, smbh_count, N;
|
||||
double *m;
|
||||
double3 *x, *v;
|
||||
const std::vector<double> &m;
|
||||
const std::vector<double3> &x, &v;
|
||||
std::vector<int> ind_sort;
|
||||
std::vector<double> var_sort;
|
||||
FILE *out;
|
||||
|
|
@ -85,7 +83,7 @@ private:
|
|||
|
||||
class Binary_smbh_influence_sphere_output {
|
||||
public:
|
||||
Binary_smbh_influence_sphere_output(double factor, int N, double *m, double3 *x, double3 *v, const std::vector<double>& pot, double *dt)
|
||||
Binary_smbh_influence_sphere_output(double factor, int N, const std::vector<double> &m, const std::vector<double3> &x, const std::vector<double3> &v, const std::vector<double> &pot, double *dt)
|
||||
: factor(factor), m(m), x(x), v(v), pot(pot), dt(dt)
|
||||
{
|
||||
inf_event.assign(N, 0);
|
||||
|
|
@ -99,9 +97,10 @@ public:
|
|||
void operator()(const std::vector<int>& ind_act, int n_act, double timesteps, double time_cur);
|
||||
private:
|
||||
double factor;
|
||||
const std::vector<double>& pot;
|
||||
double *m, /**pot,*/ *dt;
|
||||
double3 *x, *v;
|
||||
const std::vector<double> &pot;
|
||||
const std::vector<double> &m;
|
||||
double /**pot,*/ *dt;
|
||||
const std::vector<double3> &x, &v;
|
||||
std::vector<int> inf_event;
|
||||
FILE *out;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue