Skip to content

Commit

Permalink
forgot period BC in prevous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MennoVeerman committed Jul 31, 2024
1 parent 227da8a commit 8c2a737
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src_kernels_cuda_rt/raytracer_kernels_bw.cu
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,16 @@ void ray_tracer_kernel_bw(
{
const Float s = abs((position.z - grid_size.z)/direction.z);
position = position + direction * s - s_eps;

// Cyclic boundary condition in x.
position.x = fmod(position.x, grid_size.x);
if (position.x < Float(0.))
position.x += grid_size.x;

// Cyclic boundary condition in y.
position.y = fmod(position.y, grid_size.y);
if (position.y < Float(0.))
position.y += grid_size.y;
}

while ((position.z <= grid_size.z - s_eps) && (position.z > s_eps))
Expand Down

0 comments on commit 8c2a737

Please sign in to comment.