Skip to content
Snippets Groups Projects
Commit 61457add authored by Pedro Gonnet's avatar Pedro Gonnet Committed by Matthieu Schaller
Browse files

Store h_max values as floats in the `struct cell`, as the h values themselves...

Store h_max values as floats in the `struct cell`, as the h values themselves are also just `float`s.
parent 8828b585
Branches
Tags
No related merge requests found
......@@ -94,8 +94,11 @@ struct pcell {
/*! Hydro variables */
struct {
/*! Number of #part in this cell. */
int count;
/*! Maximal smoothing length. */
double h_max;
float h_max;
/*! Minimal integer end-of-timestep in this cell for hydro tasks */
integertime_t ti_end_min;
......@@ -109,9 +112,6 @@ struct pcell {
/*! Integer time of the last drift of the #part in this cell */
integertime_t ti_old_part;
/*! Number of #part in this cell. */
int count;
} hydro;
/*! Gravity variables */
......@@ -159,7 +159,7 @@ struct pcell {
int count;
/*! Maximal smoothing length. */
double h_max;
float h_max;
/*! Minimal integer end-of-timestep in this cell for stars tasks */
integertime_t ti_end_min;
......@@ -179,7 +179,7 @@ struct pcell {
int count;
/*! Maximal smoothing length. */
double h_max;
float h_max;
/*! Minimal integer end-of-timestep in this cell for black hole tasks */
integertime_t ti_end_min;
......@@ -386,9 +386,6 @@ struct cell {
/*! Task for sorting the stars again after a SF event */
struct task *stars_resort;
/*! Max smoothing length in this cell. */
double h_max;
/*! Last (integer) time the cell's part were drifted forward in time. */
integertime_t ti_old_part;
......@@ -405,6 +402,9 @@ struct cell {
/*! Spin lock for various uses (#part case). */
swift_lock_type lock;
/*! Max smoothing length in this cell. */
float h_max;
/*! Maximum part movement in this cell since last construction. */
float dx_max_part;
......@@ -569,9 +569,6 @@ struct cell {
/*! Implicit tasks marking the exit of the stellar physics block of tasks */
struct task *stars_out;
/*! Max smoothing length in this cell. */
double h_max;
/*! Last (integer) time the cell's spart were drifted forward in time. */
integertime_t ti_old_part;
......@@ -587,6 +584,9 @@ struct cell {
/*! Nr of #spart this cell can hold after addition of new #spart. */
int count_total;
/*! Max smoothing length in this cell. */
float h_max;
/*! Values of h_max before the drifts, used for sub-cell tasks. */
float h_max_old;
......@@ -678,9 +678,6 @@ struct cell {
/*! Linked list of the tasks computing this cell's BH feedback. */
struct link *feedback;
/*! Max smoothing length in this cell. */
double h_max;
/*! Last (integer) time the cell's bpart were drifted forward in time. */
integertime_t ti_old_part;
......@@ -693,6 +690,9 @@ struct cell {
/*! Nr of #bpart this cell can hold after addition of new #bpart. */
int count_total;
/*! Max smoothing length in this cell. */
float h_max;
/*! Values of h_max before the drifts, used for sub-cell tasks. */
float h_max_old;
......
......@@ -472,7 +472,7 @@ void runner_do_stars_ghost(struct runner *r, struct cell *c, int timer) {
* Therefore we need to update h_max between the super- and top-levels */
if (c->stars.ghost) {
for (struct cell *tmp = c->parent; tmp != NULL; tmp = tmp->parent) {
atomic_max_d(&tmp->stars.h_max, h_max);
atomic_max_f(&tmp->stars.h_max, h_max);
}
}
......@@ -783,7 +783,7 @@ void runner_do_black_holes_density_ghost(struct runner *r, struct cell *c,
* Therefore we need to update h_max between the super- and top-levels */
if (c->black_holes.density_ghost) {
for (struct cell *tmp = c->parent; tmp != NULL; tmp = tmp->parent) {
atomic_max_d(&tmp->black_holes.h_max, h_max);
atomic_max_f(&tmp->black_holes.h_max, h_max);
}
}
......@@ -1379,7 +1379,7 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
* Therefore we need to update h_max between the super- and top-levels */
if (c->hydro.ghost) {
for (struct cell *tmp = c->parent; tmp != NULL; tmp = tmp->parent) {
atomic_max_d(&tmp->hydro.h_max, h_max);
atomic_max_f(&tmp->hydro.h_max, h_max);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment