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

Merge branch 'fix-unused-variables-timestepping' into 'master'

Fixed more compiler warnings with GIZMO in runner

See merge request !614
parents c06291ad dc387bc7
Branches
Tags
1 merge request!614Fixed more compiler warnings with GIZMO in runner
...@@ -719,13 +719,10 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) { ...@@ -719,13 +719,10 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
const struct hydro_space *hs = &s->hs; const struct hydro_space *hs = &s->hs;
const struct cosmology *cosmo = e->cosmology; const struct cosmology *cosmo = e->cosmology;
const struct chemistry_global_data *chemistry = e->chemistry; const struct chemistry_global_data *chemistry = e->chemistry;
const double time_base = e->time_base;
const integertime_t ti_end = e->ti_current;
const float hydro_h_max = e->hydro_properties->h_max; const float hydro_h_max = e->hydro_properties->h_max;
const float eps = e->hydro_properties->h_tolerance; const float eps = e->hydro_properties->h_tolerance;
const float hydro_eta_dim = const float hydro_eta_dim =
pow_dimension(e->hydro_properties->eta_neighbours); pow_dimension(e->hydro_properties->eta_neighbours);
const int with_cosmology = (e->policy & engine_policy_cosmology);
const int max_smoothing_iter = e->hydro_properties->max_smoothing_iterations; const int max_smoothing_iter = e->hydro_properties->max_smoothing_iterations;
int redo = 0, count = 0; int redo = 0, count = 0;
...@@ -820,12 +817,14 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) { ...@@ -820,12 +817,14 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
hydro_reset_gradient(p); hydro_reset_gradient(p);
#else #else
/* As of here, particle force variables will be set. */ /* Calculate the time-step for passing to hydro_prepare_force, used
* for the evolution of alpha factors (i.e. those involved in the
/* Calculate the time-step for passing to hydro_prepare_force. * artificial viscosity and thermal conduction terms) */
* This is the physical time between the start and end of the const int with_cosmology = (e->policy & engine_policy_cosmology);
* time-step without any scale-factor powers. */ const double time_base = e->time_base;
const integertime_t ti_end = e->ti_current;
double dt_alpha; double dt_alpha;
if (with_cosmology) { if (with_cosmology) {
const integertime_t ti_step = get_integer_timestep(p->time_bin); const integertime_t ti_step = get_integer_timestep(p->time_bin);
dt_alpha = dt_alpha =
...@@ -834,6 +833,8 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) { ...@@ -834,6 +833,8 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
dt_alpha = get_timestep(p->time_bin, time_base); dt_alpha = get_timestep(p->time_bin, time_base);
} }
/* As of here, particle force variables will be set. */
/* Compute variables required for the force loop */ /* Compute variables required for the force loop */
hydro_prepare_force(p, xp, cosmo, dt_alpha); hydro_prepare_force(p, xp, cosmo, dt_alpha);
...@@ -914,12 +915,14 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) { ...@@ -914,12 +915,14 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
hydro_reset_gradient(p); hydro_reset_gradient(p);
#else #else
/* As of here, particle force variables will be set. */ /* Calculate the time-step for passing to hydro_prepare_force, used for
* the evolution of alpha factors (i.e. those involved in the artificial
/* Calculate the time-step for passing to hydro_prepare_force. * viscosity and thermal conduction terms) */
* This is the physical time between the start and end of the time-step const int with_cosmology = (e->policy & engine_policy_cosmology);
* without any scale-factor powers. */ const integertime_t ti_end = e->ti_current;
const double time_base = e->time_base;
double dt_alpha; double dt_alpha;
if (with_cosmology) { if (with_cosmology) {
const integertime_t ti_step = get_integer_timestep(p->time_bin); const integertime_t ti_step = get_integer_timestep(p->time_bin);
dt_alpha = cosmology_get_delta_time(cosmo, ti_end - ti_step, ti_end); dt_alpha = cosmology_get_delta_time(cosmo, ti_end - ti_step, ti_end);
...@@ -927,6 +930,8 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) { ...@@ -927,6 +930,8 @@ void runner_do_ghost(struct runner *r, struct cell *c, int timer) {
dt_alpha = get_timestep(p->time_bin, time_base); dt_alpha = get_timestep(p->time_bin, time_base);
} }
/* As of here, particle force variables will be set. */
/* Compute variables required for the force loop */ /* Compute variables required for the force loop */
hydro_prepare_force(p, xp, cosmo, dt_alpha); hydro_prepare_force(p, xp, cosmo, dt_alpha);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment