Skip to content
Snippets Groups Projects
Commit 42b07bad authored by Matthieu Schaller's avatar Matthieu Schaller Committed by James Willis
Browse files

Also take the stars into account when computing the linking length

parent 753dd968
No related branches found
No related tags found
1 merge request!543Fof
......@@ -941,7 +941,7 @@ int main(int argc, char *argv[]) {
talking, restart_file);
/* Initialise the FOF parameters. */
if (with_fof) fof_init(&s, N_total[0], N_total[1]);
if (with_fof) fof_init(&s, N_total[0], N_total[1], N_total[2]);
if (myrank == 0) {
clocks_gettime(&toc);
......
......@@ -936,7 +936,7 @@ int main(int argc, char *argv[]) {
talking, restart_file);
/* Initialise the FOF parameters. */
fof_init(&s, N_total[0], N_total[1]);
fof_init(&s, N_total[0], N_total[1], N_total[2]);
if (myrank == 0) {
clocks_gettime(&toc);
......
......@@ -46,7 +46,7 @@ MPI_Datatype group_length_mpi_type;
size_t node_offset;
/* Initialises parameters for the FOF search. */
void fof_init(struct space *s, long long Ngas, long long Ngparts) {
void fof_init(struct space *s, long long Ngas, long long Ngparts, long long Nstars) {
struct engine *e = s->e;
......@@ -78,7 +78,7 @@ void fof_init(struct space *s, long long Ngas, long long Ngparts) {
/* Calculate the particle linking length based upon the mean inter-particle
* spacing of the DM particles. */
const int total_nr_dmparts = Ngparts - Ngas;
const long long total_nr_dmparts = Ngparts - Ngas - Nstars;
double l_x = l_x_scale * (s->dim[0] / cbrt(total_nr_dmparts));
l_x = parser_get_opt_param_double(e->parameter_file, "FOF:absolute_linking_length", l_x);
......
......@@ -62,7 +62,7 @@ struct cell_pair_indices {
} SWIFT_STRUCT_ALIGN;
/* Function prototypes. */
void fof_init(struct space *s, long long Ngas, long long Ngparts);
void fof_init(struct space *s, long long Ngas, long long Ngparts, long long Nstars);
void fof_search_cell(struct space *s, struct cell *c);
void fof_search_pair_cells(struct space *s, struct cell *ci, struct cell *cj);
void fof_search_pair_cells_foreign(struct space *s, struct cell *ci, struct cell *cj, int *link_count, struct fof_mpi **group_links, int *group_links_size);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment