@@ -167,8 +167,8 @@ contains
167167 y_centroid = patch_ib(ib_patch_id)%y_centroid
168168 z_centroid = patch_ib(ib_patch_id)%z_centroid
169169 lz = patch_ib(ib_patch_id)%length_z
170- inverse_rotation(:, :) = patch_ib(patch_id )%rotation_matrix_inverse(:, :)
171- rotation(:, :) = patch_ib(patch_id )%rotation_matrix(:, :)
170+ inverse_rotation(:, :) = patch_ib(ib_patch_id )%rotation_matrix_inverse(:, :)
171+ rotation(:, :) = patch_ib(ib_patch_id )%rotation_matrix(:, :)
172172
173173 z_max = z_centroid + lz/2
174174 z_min = z_centroid - lz/2
@@ -270,8 +270,8 @@ contains
270270 length_y = patch_ib(ib_patch_id)%length_y
271271 x_centroid = patch_ib(ib_patch_id)%x_centroid
272272 y_centroid = patch_ib(ib_patch_id)%y_centroid
273- inverse_rotation(:, :) = patch_ib(patch_id )%rotation_matrix_inverse(:, :)
274- rotation(:, :) = patch_ib(patch_id )%rotation_matrix(:, :)
273+ inverse_rotation(:, :) = patch_ib(ib_patch_id )%rotation_matrix_inverse(:, :)
274+ rotation(:, :) = patch_ib(ib_patch_id )%rotation_matrix(:, :)
275275
276276 top_right(1 ) = length_x/ 2
277277 top_right(2 ) = length_y/ 2
@@ -303,9 +303,11 @@ contains
303303 levelset%sf(i, j, 0 , ib_patch_id) = side_dists(idx)
304304 if (.not. f_approx_equal(side_dists(idx), 0._wp )) then
305305 if (idx == 1 .or. idx == 2 ) then
306+ ! vector points along the x axis
306307 levelset_norm%sf(i, j, 0 , ib_patch_id, 1 ) = side_dists(idx)/ &
307308 abs (side_dists(idx))
308309 else
310+ ! vector points along the y axis
309311 levelset_norm%sf(i, j, 0 , ib_patch_id, 2 ) = side_dists(idx)/ &
310312 abs (side_dists(idx))
311313 end if
@@ -333,6 +335,8 @@ contains
333335
334336 real (wp) :: x_centroid, y_centroid, z_centroid
335337 real (wp) :: length_x, length_y, length_z
338+ real (wp), dimension (1 :3 ) :: xyz_local !< x and y coordinates in local IB frame
339+ real (wp), dimension (1 :3 , 1 :3 ) :: rotation, inverse_rotation
336340
337341 integer :: i, j, k !< Loop index variables
338342
@@ -344,14 +348,17 @@ contains
344348 y_centroid = patch_ib(ib_patch_id)%y_centroid
345349 z_centroid = patch_ib(ib_patch_id)%z_centroid
346350
347- Right = x_centroid + length_x/ 2
348- Left = x_centroid - length_x/ 2
351+ inverse_rotation(:, :) = patch_ib(ib_patch_id)%rotation_matrix_inverse(:, :)
352+ rotation(:, :) = patch_ib(ib_patch_id)%rotation_matrix(:, :)
353+
354+ Right = length_x/ 2
355+ Left = - length_x/ 2
349356
350- Top = y_centroid + length_y/ 2
351- Bottom = y_centroid - length_y/ 2
357+ Top = length_y/ 2
358+ Bottom = - length_y/ 2
352359
353- Front = z_centroid + length_z/ 2
354- Back = z_centroid - length_z/ 2
360+ Front = length_z/ 2
361+ Back = - length_z/ 2
355362
356363 do i = 0 , m
357364 do j = 0 , n
0 commit comments