diff --git a/src/CelerisLab/lbm/kernels/step/moving_circle.cu b/src/CelerisLab/lbm/kernels/step/moving_circle.cu index c58fe2d..360f4ee 100644 --- a/src/CelerisLab/lbm/kernels/step/moving_circle.cu +++ b/src/CelerisLab/lbm/kernels/step/moving_circle.cu @@ -71,9 +71,11 @@ __global__ void MovingCircleLinks( const float q = (float)qd; const float rx = (float)__dsub_rn(hx, cx), ry = (float)__dsub_rn(hy, cy); - // Same fallback rule as build_cut_links (q < 1/2 needs a fluid donor at x - c). + // Same two-stage order as build_cut_links + pack_cut_links_to_soa: the fallback + // class is chosen from the clamped FP64 q (q < 1/2 needs a fluid donor at x - c); + // only then are q, rx, ry rounded to FP32 for the BFL branch and spin velocity. unsigned char fallback = CURVED_FALLBACK_BOUZIDI; - if (q < 0.5f) { + if (qd < 0.5) { const int xd = x - ex, yd = y - ey; if (xd < 0 || xd >= (int)NX || yd < 0 || yd >= (int)NY || mc_inside(xd, yd, cx, cy, r) || (flag[linear_index((unsigned int)xd, (unsigned int)yd)] & FLAG_FLUID) == 0)