New timing, moved MPI reduction into function call, started converting some of the pointers into std::vectors

This commit is contained in:
Yohai Meiron 2020-05-09 18:21:01 -04:00
parent 1a438449a8
commit 329dd2ca4d
5 changed files with 88 additions and 312 deletions

View file

@ -99,7 +99,7 @@ void Black_hole_physics::adjust_post_newtonian(
jrk2 += jrk2_corr;
}
void Black_hole_physics::write_bh_data(double time_cur, double m[], double3 x[], double3 v[], double pot[], double3 a[], double3 adot[], double dt[])
void Black_hole_physics::write_bh_data(double time_cur, double m[], double3 x[], double3 v[], const std::vector<double>& pot, double3 a[], double3 adot[], double dt[])
{
// This function logs data on the black hole(s). It uses both external data
// (the arguments to this function) and optionall internal data to this
@ -195,7 +195,7 @@ void Write_bh_nb_data::operator()(double time_cur)
fflush(out);
}
void Binary_smbh_influence_sphere_output::operator()(int ind_act[], int n_act, double timesteps, double time_cur)
void Binary_smbh_influence_sphere_output::operator()(const std::vector<int>& ind_act, int n_act, double timesteps, double time_cur)
{
double m_bh1 = m[0];
double m_bh2 = m[1];
@ -216,13 +216,13 @@ void Binary_smbh_influence_sphere_output::operator()(int ind_act[], int n_act, d
for (int i=0; i<n_act; i++) {
int j_act = ind_act[i];
if (j_act<2) continue;
double& pot_bh1 = pot[0];
double& pot_bh2 = pot[1];
double& m_act = m[j_act];
double3& x_act = x[j_act];
double3& v_act = v[j_act];
double& dt_act = dt[j_act];
double& pot_act = pot[j_act];
const double& pot_bh1 = pot[0];
const double& pot_bh2 = pot[1];
const double& m_act = m[j_act];
const double3& x_act = x[j_act];
const double3& v_act = v[j_act];
const double& dt_act = dt[j_act];
const double& pot_act = pot[j_act];
double tmp_r2 = (x_act - x_bbhc).norm2();
if (tmp_r2 < SEMI_a2*factor*factor) {
if (inf_event[j_act] == 0) {