Skip to content
Snippets Groups Projects
Commit 59c8e5d0 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Do things in double precision for now.

parent a21e6959
Branches
Tags
1 merge request!331Gravity multi dt
...@@ -2095,11 +2095,11 @@ void space_split_recursive(struct space *s, struct cell *c, ...@@ -2095,11 +2095,11 @@ void space_split_recursive(struct space *s, struct cell *c,
gravity_multipole_add(&c->multipole->m_pole, &temp); gravity_multipole_add(&c->multipole->m_pole, &temp);
/* Upper limit of max CoM<->gpart distance */ /* Upper limit of max CoM<->gpart distance */
const float dx = c->multipole->CoM[0] - cp->multipole->CoM[0]; const double dx = c->multipole->CoM[0] - cp->multipole->CoM[0];
const float dy = c->multipole->CoM[1] - cp->multipole->CoM[1]; const double dy = c->multipole->CoM[1] - cp->multipole->CoM[1];
const float dz = c->multipole->CoM[2] - cp->multipole->CoM[2]; const double dz = c->multipole->CoM[2] - cp->multipole->CoM[2];
const float r2 = dx * dx + dy * dy + dz * dz; const double r2 = dx * dx + dy * dy + dz * dz;
r_max = max(r_max, cp->multipole->r_max + sqrtf(r2)); r_max = max(r_max, cp->multipole->r_max + sqrt(r2));
} }
} }
/* Alternative upper limit of max CoM<->gpart distance */ /* Alternative upper limit of max CoM<->gpart distance */
...@@ -2115,7 +2115,7 @@ void space_split_recursive(struct space *s, struct cell *c, ...@@ -2115,7 +2115,7 @@ void space_split_recursive(struct space *s, struct cell *c,
/* Take minimum of both limits */ /* Take minimum of both limits */
c->multipole->r_max = min(r_max, sqrt(dx * dx + dy * dy + dz * dz)); c->multipole->r_max = min(r_max, sqrt(dx * dx + dy * dy + dz * dz));
} } /* Deal with gravity */
} }
/* Otherwise, collect the data for this cell. */ /* Otherwise, collect the data for this cell. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment