Finished moving the BH stuff into their compilation unit
This commit is contained in:
parent
19ce85da88
commit
df5d89a0c8
4 changed files with 127 additions and 236 deletions
|
|
@ -1,4 +1,6 @@
|
|||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
#include "double3.h"
|
||||
|
||||
struct Bbh_gravity {
|
||||
|
|
@ -56,4 +58,49 @@ 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[]);
|
||||
//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)
|
||||
: nb(nb), smbh_count(smbh_count), N(N), m(m), x(x), v(v)
|
||||
{
|
||||
ind_sort.resize(N);
|
||||
var_sort.resize(N);
|
||||
out = fopen("bh_neighbors.dat", "w");
|
||||
}
|
||||
~Write_bh_nb_data()
|
||||
{
|
||||
fclose(out);
|
||||
}
|
||||
void operator()(double time_cur);
|
||||
private:
|
||||
int nb, smbh_count, N;
|
||||
double *m;
|
||||
double3 *x, *v;
|
||||
std::vector<int> ind_sort;
|
||||
std::vector<double> var_sort;
|
||||
FILE *out;
|
||||
};
|
||||
|
||||
class Binary_smbh_influence_sphere_output {
|
||||
public:
|
||||
Binary_smbh_influence_sphere_output(double factor, int N, double *m, double3 *x, double3 *v, double *pot, double *dt)
|
||||
: factor(factor), m(m), x(x), v(v), pot(pot), dt(dt)
|
||||
{
|
||||
inf_event.assign(N, 0);
|
||||
out = fopen("bbh_inf.dat", "w");
|
||||
}
|
||||
|
||||
~Binary_smbh_influence_sphere_output()
|
||||
{
|
||||
fclose(out);
|
||||
}
|
||||
void operator()(int ind_act[], int n_act, double timesteps, double time_cur);
|
||||
private:
|
||||
double factor;
|
||||
double *m, *pot, *dt;
|
||||
double3 *x, *v;
|
||||
std::vector<int> inf_event;
|
||||
FILE *out;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue