Commit 297b73f6 authored by Bert Vandenbroucke's avatar Bert Vandenbroucke
Browse files

Fixed some small issues in 2D Voronoi code. 2D Sod shock still does not work.

parent 77e62725
......@@ -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;
}
......
......@@ -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];
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment