diff --git a/src/hydro/Shadowswift/hydro_iact.h b/src/hydro/Shadowswift/hydro_iact.h index 7e2d5aaa6318af2bf3f66a92252c55d6af60793c..63f7bdc6900c8fe9887879f3ff7e6c5eaff1b281 100644 --- a/src/hydro/Shadowswift/hydro_iact.h +++ b/src/hydro/Shadowswift/hydro_iact.h @@ -143,7 +143,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_fluxes_common( float n_unit[3]; A = voronoi_get_face(&pi->cell, pj->id, xij_i); - if (!A) { + if (A == 0.0f) { /* this neighbour does not share a face with the cell, return */ return; } diff --git a/src/hydro/Shadowswift/voronoi2d_algorithm.h b/src/hydro/Shadowswift/voronoi2d_algorithm.h index 1a30d02e558f5b3810ff0ae25f66a264597a8fd9..750b9127da81065e69e0fb5a8f02ef4a35625537 100644 --- a/src/hydro/Shadowswift/voronoi2d_algorithm.h +++ b/src/hydro/Shadowswift/voronoi2d_algorithm.h @@ -479,6 +479,10 @@ __attribute__((always_inline)) INLINE float voronoi_cell_finalize( r2 = x[0] * x[0] + y[0] * y[0]; r2max = max(r2max, r2); + + x[0] -= x[1]; + y[0] -= y[1]; + cell->face_lengths[i] = sqrtf(x[0] * x[0] + y[0] * y[0]); } cell->volume *= 0.5f; @@ -517,6 +521,7 @@ __attribute__((always_inline)) INLINE float voronoi_get_face( midpoint[0] = cell->face_midpoints[i][0]; midpoint[1] = cell->face_midpoints[i][1]; + midpoint[2] = 0.0f; return cell->face_lengths[i]; }