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

Merge branch 'fix_gasoline_conduction' into 'master'

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

See merge request !1557
parents 595c7fc1 e505ff5a
Branches
Tags
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(
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;
/* Finish calculation of the velocity gradient tensor */
/* Finish calculation of the velocity gradient tensor, and
* guard against FPEs here. */
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 j = 0; j < 3; j++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment