From 117a80c4a4767b0078263ec34fdaa6a780786c65 Mon Sep 17 00:00:00 2001
From: schoen <schoen@irmb.tu-bs.de>
Date: Wed, 30 Jun 2021 14:33:42 +0200
Subject: [PATCH] fix bug in CalcMac

---
 src/gpu/VirtualFluids_GPU/GPU/CalcMac27.cu | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gpu/VirtualFluids_GPU/GPU/CalcMac27.cu b/src/gpu/VirtualFluids_GPU/GPU/CalcMac27.cu
index 562140eb2..130702b5e 100644
--- a/src/gpu/VirtualFluids_GPU/GPU/CalcMac27.cu
+++ b/src/gpu/VirtualFluids_GPU/GPU/CalcMac27.cu
@@ -266,15 +266,15 @@ extern "C" __global__ void LBCalcMacCompSP27(real *vxD, real *vyD, real *vzD, re
 {
     const unsigned k = vf::gpu::getNodeIndex();
 
+    if (!vf::gpu::isValidFluidNode(k, size_Mat, geoD[k]))
+        return;
+
     pressD[k] = c0o1;
     rhoD[k]   = c0o1;
     vxD[k]    = c0o1;
     vyD[k]    = c0o1;
     vzD[k]    = c0o1;
 
-    if (!vf::gpu::isValidFluidNode(k, size_Mat, geoD[k]))
-        return;
-
     vf::gpu::DistributionWrapper distr_wrapper(distributions, size_Mat, isEvenTimestep, k, neighborX, neighborY,
                                                neighborZ);
     const auto &distribution = distr_wrapper.distribution;
-- 
GitLab