@@ -529,9 +529,9 @@ contains
529529 ! Computing the beginning and the end x- and y-coordinates of the
530530 ! rectangle based on its centroid and lengths
531531 x_boundary%beg = -0.5_wp*length_x
532- x_boundary%end = 0.5_wp*length_x
532+ x_boundary%end = 0.5_wp*length_x
533533 y_boundary%beg = -0.5_wp*length_y
534- y_boundary%end = 0.5_wp*length_y
534+ y_boundary%end = 0.5_wp*length_y
535535
536536 ! Since the rectangular patch does not allow for its boundaries to
537537 ! be smoothed out, the pseudo volume fraction is set to 1 to ensure
@@ -545,7 +545,7 @@ contains
545545 ! variables of the current patch are assigned to this cell.
546546 do j = 0, n
547547 do i = 0, m
548- ! get the x and y coodinates in the local IB frame
548+ ! get the x and y coordinates in the local IB frame
549549 xy_local = [x_cc(i) - x_centroid, y_cc(j) - y_centroid, 0._wp]
550550 xy_local = matmul(inverse_rotation, xy_local)
551551 if (x_boundary%beg <= xy_local(1) .and. &
@@ -1004,36 +1004,36 @@ contains
10041004
10051005 ! construct the x, y, and z rotation matrices
10061006 if (num_dims == 3) then
1007- ! also compute the x and y axes in 3D
1008- angle = patch_ib(patch_id)%angles(1)
1009- rotation(1, 1, :) = [1._wp, 0._wp , 0._wp ]
1010- rotation(1, 2, :) = [0._wp, cos(angle), -sin(angle)]
1011- rotation(1, 3, :) = [0._wp, sin(angle), cos(angle) ]
1012-
1013- angle = patch_ib(patch_id)%angles(2)
1014- rotation(2, 1, :) = [cos(angle) , 0._wp, sin(angle)]
1015- rotation(2, 2, :) = [0._wp , 1._wp, 0._wp ]
1016- rotation(2, 3, :) = [-sin(angle), 0._wp, cos(angle)]
1017-
1018- ! apply the y rotation to the x rotation
1019- patch_ib(patch_id)%rotation_matrix(:, :) = matmul(rotation(1, :, :), rotation(2, :, :))
1020- patch_ib(patch_id)%rotation_matrix_inverse(:, :) = matmul(transpose(rotation(2, :, :)), transpose(rotation(1, :, :)))
1007+ ! also compute the x and y axes in 3D
1008+ angle = patch_ib(patch_id)%angles(1)
1009+ rotation(1, 1, :) = [1._wp, 0._wp, 0._wp]
1010+ rotation(1, 2, :) = [0._wp, cos(angle), -sin(angle)]
1011+ rotation(1, 3, :) = [0._wp, sin(angle), cos(angle)]
1012+
1013+ angle = patch_ib(patch_id)%angles(2)
1014+ rotation(2, 1, :) = [cos(angle), 0._wp, sin(angle)]
1015+ rotation(2, 2, :) = [0._wp, 1._wp, 0._wp]
1016+ rotation(2, 3, :) = [-sin(angle), 0._wp, cos(angle)]
1017+
1018+ ! apply the y rotation to the x rotation
1019+ patch_ib(patch_id)%rotation_matrix(:, :) = matmul(rotation(1, :, :), rotation(2, :, :))
1020+ patch_ib(patch_id)%rotation_matrix_inverse(:, :) = matmul(transpose(rotation(2, :, :)), transpose(rotation(1, :, :)))
10211021 end if
10221022
10231023 ! z component first, since it applies in 2D and 3D
10241024 angle = patch_ib(patch_id)%angles(3)
10251025 rotation(3, 1, :) = [cos(angle), -sin(angle), 0._wp]
1026- rotation(3, 2, :) = [sin(angle), cos(angle) , 0._wp]
1027- rotation(3, 3, :) = [0._wp , 0._wp , 1._wp]
1026+ rotation(3, 2, :) = [sin(angle), cos(angle), 0._wp]
1027+ rotation(3, 3, :) = [0._wp, 0._wp, 1._wp]
10281028
10291029 if (num_dims == 3) then
1030- ! apply the z rotation to the xy rotation in 3D
1031- patch_ib(patch_id)%rotation_matrix(:, :) = matmul(patch_ib(patch_id)%rotation_matrix(:, :), rotation(3, :, :))
1032- patch_ib(patch_id)%rotation_matrix_inverse(:, :) = matmul(transpose(rotation(3, :, :)), patch_ib(patch_id)%rotation_matrix_inverse(:, :))
1030+ ! apply the z rotation to the xy rotation in 3D
1031+ patch_ib(patch_id)%rotation_matrix(:, :) = matmul(patch_ib(patch_id)%rotation_matrix(:, :), rotation(3, :, :))
1032+ patch_ib(patch_id)%rotation_matrix_inverse(:, :) = matmul(transpose(rotation(3, :, :)), patch_ib(patch_id)%rotation_matrix_inverse(:, :))
10331033 else
1034- ! write out only the z rotation in 2D
1035- patch_ib(patch_id)%rotation_matrix(:, :) = rotation(3, :, :)
1036- patch_ib(patch_id)%rotation_matrix_inverse(:, :) = transpose(rotation(3, :, :))
1034+ ! write out only the z rotation in 2D
1035+ patch_ib(patch_id)%rotation_matrix(:, :) = rotation(3, :, :)
1036+ patch_ib(patch_id)%rotation_matrix_inverse(:, :) = transpose(rotation(3, :, :))
10371037 end if
10381038
10391039 end subroutine s_update_ib_rotation_matrix
0 commit comments