From a7e32838b0edb776076111b7a0ecc1e8e917b245 Mon Sep 17 00:00:00 2001
From: Christoph Alt <christoph.alt@fau.de>
Date: Fri, 14 Mar 2025 09:05:24 +0100
Subject: [PATCH] Fixed the type cast to avoid implicit conversions

---
 .../codegen/PSMWrapperKernels.cu                      | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/lbm_mesapd_coupling/partially_saturated_cells_method/codegen/PSMWrapperKernels.cu b/src/lbm_mesapd_coupling/partially_saturated_cells_method/codegen/PSMWrapperKernels.cu
index c18be22ea..880eebf12 100644
--- a/src/lbm_mesapd_coupling/partially_saturated_cells_method/codegen/PSMWrapperKernels.cu
+++ b/src/lbm_mesapd_coupling/partially_saturated_cells_method/codegen/PSMWrapperKernels.cu
@@ -47,9 +47,9 @@ __global__ void SetParticleVelocities(walberla::gpu::FieldAccessor< uint_t > nOv
    particleVelocitiesField.set(blockIdx_uint3, threadIdx_uint3);
 
    // Cell center is needed in order to compute the particle velocity at this WF point
-   const real_t cellCenter[] = { (blockStart.x + (threadIdx.x + real_t(0.5)) * dx),
-                                 (blockStart.y + (blockIdx.x + real_t(0.5)) * dx),
-                                 (blockStart.z + (blockIdx.y + real_t(0.5)) * dx) };
+   const real_t cellCenter[] = { real_t(blockStart.x + (threadIdx.x + real_t(0.5)) * dx),
+                                 real_t(blockStart.y + (blockIdx.x + real_t(0.5)) * dx),
+                                 real_t(blockStart.z + (blockIdx.y + real_t(0.5)) * dx) };
 
    // Compute the particle velocity at the cell center for all overlapping particles
    for (uint_t p = 0; p < nOverlappingParticlesField.get(); p++)
@@ -79,8 +79,9 @@ __global__ void ReduceParticleForces(walberla::gpu::FieldAccessor< uint_t > nOve
    particleForcesField.set(blockIdx_uint3, threadIdx_uint3);
 
    // Cell center is needed in order to compute the particle velocity at this WF point
-   const real_t cellCenter[] = { (blockStart.x + (threadIdx.x + real_t(0.5)) * dx), (blockStart.y + (blockIdx.x + real_t(0.5)) * dx),
-                                 (blockStart.z + (blockIdx.y + real_t(0.5)) * dx) };
+   const real_t cellCenter[] = { real_t(blockStart.x + (threadIdx.x + real_t(0.5)) * dx),
+                                 real_t(blockStart.y + (blockIdx.x + real_t(0.5)) * dx),
+                                 real_t(blockStart.z + (blockIdx.y + real_t(0.5)) * dx) };
 
    // Reduce the forces for all overlapping particles
    for (uint_t p = 0; p < nOverlappingParticlesField.get(); p++)
-- 
GitLab