Skip to content
Snippets Groups Projects
Commit e505ff5a authored by Josh Borrow's avatar Josh Borrow Committed by Matthieu Schaller
Browse files

Added fabsf to FPE check as kernel gradients are negative by construction

parent 595c7fc1
No related branches found
No related tags found
2 merge requests!1558Sync mhd canvas before is too late,!1557Added fabsf to FPE check as kernel gradients are negative by construction
...@@ -542,9 +542,11 @@ __attribute__((always_inline)) INLINE static void hydro_end_density( ...@@ -542,9 +542,11 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
p->smooth_pressure_gradient[1] *= hydro_gamma_minus_one * h_inv_dim_plus_one; p->smooth_pressure_gradient[1] *= hydro_gamma_minus_one * h_inv_dim_plus_one;
p->smooth_pressure_gradient[2] *= hydro_gamma_minus_one * h_inv_dim_plus_one; p->smooth_pressure_gradient[2] *= hydro_gamma_minus_one * h_inv_dim_plus_one;
/* Finish calculation of the velocity gradient tensor */ /* Finish calculation of the velocity gradient tensor, and
* guard against FPEs here. */
const float velocity_gradient_norm = const float velocity_gradient_norm =
p->weighted_wcount > 0.f ? 3.f * cosmo->a2_inv / p->weighted_wcount : 0.f; p->weighted_wcount == 0.f ? 0.f
: 3.f * cosmo->a2_inv / p->weighted_wcount;
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) { for (int j = 0; j < 3; j++) {
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment