From ab039cc8011b50c8f91c9e08e0d137fa957d50e7 Mon Sep 17 00:00:00 2001 From: loikki <loic.hausammann@protonmail.ch> Date: Mon, 8 Oct 2018 10:30:08 +0200 Subject: [PATCH] Grackle raises errors only with cosmo --- src/cooling/grackle/cooling.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/cooling/grackle/cooling.h b/src/cooling/grackle/cooling.h index 07741c9799..43d20d918a 100644 --- a/src/cooling/grackle/cooling.h +++ b/src/cooling/grackle/cooling.h @@ -491,10 +491,12 @@ __attribute__((always_inline)) INLINE static gr_float cooling_rate( const struct cosmology* restrict cosmo, const struct cooling_function_data* restrict cooling, const struct part* restrict p, struct xpart* restrict xp, double dt) { - - error( - "Check cosmology factors (physical vs. co-moving and drifted vs. " - "un-drifted)!"); + + if (cosmo->Omega_m != 0. || cosmo->Omega_r != 0. || cosmo->Omega_k != 0. || + cosmo->Omega_lambda != 0. || cosmo->Omega_b != 0.) + error( + "Check cosmology factors (physical vs. co-moving and drifted vs. " + "un-drifted)!"); /* set current time */ code_units units = cooling->units; @@ -646,9 +648,11 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part( struct part* restrict p, struct xpart* restrict xp, double dt, double dt_therm) { - error( - "Check cosmology factors (physical vs. co-moving and drifted vs. " - "un-drifted)!"); + if (cosmo->Omega_m != 0. || cosmo->Omega_r != 0. || cosmo->Omega_k != 0. || + cosmo->Omega_lambda != 0. || cosmo->Omega_b != 0.) + error( + "Check cosmology factors (physical vs. co-moving and drifted vs. " + "un-drifted)!"); if (dt == 0.) return; -- GitLab