Got rid of remaining manual allocations, moved some variable declarations to where they are needed

This commit is contained in:
Yohai Meiron 2020-10-28 19:18:37 -04:00
parent aef0f26878
commit d9ed8e5131
8 changed files with 67 additions and 90 deletions

View file

@ -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, 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[]);
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, const std::vector<double3> &a, const std::vector<double3> &adot, const std::vector<double> &dt);
public: //TODO make private
double m1, m2;
int count;
@ -83,7 +83,7 @@ private:
class Binary_smbh_influence_sphere_output {
public:
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)
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, const std::vector<double> &dt)
: factor(factor), m(m), x(x), v(v), pot(pot), dt(dt)
{
inf_event.assign(N, 0);
@ -97,9 +97,7 @@ 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;
const std::vector<double> &m;
double /**pot,*/ *dt;
const std::vector<double> &pot, &m, &dt;
const std::vector<double3> &x, &v;
std::vector<int> inf_event;
FILE *out;