Skip to content

Commit 0c138b7

Browse files
author
Daniel Vickers
committed
Format and spelling
1 parent 375e324 commit 0c138b7

3 files changed

Lines changed: 14 additions & 12 deletions

File tree

src/simulation/m_global_parameters.fpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -862,9 +862,9 @@ contains
862862
863863
do i = 1, num_patches_max
864864
patch_ib(i)%geometry = dflt_int
865-
patch_ib(i)%x_centroid = dflt_real
866-
patch_ib(i)%y_centroid = dflt_real
867-
patch_ib(i)%z_centroid = dflt_real
865+
patch_ib(i)%x_centroid = 0._wp
866+
patch_ib(i)%y_centroid = 0._wp
867+
patch_ib(i)%z_centroid = 0._wp
868868
patch_ib(i)%length_x = dflt_real
869869
patch_ib(i)%length_y = dflt_real
870870
patch_ib(i)%length_z = dflt_real

src/simulation/m_ib_patches.fpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -899,18 +899,17 @@ contains
899899
type(t_model), pointer :: model
900900
901901
real(wp) :: eta
902-
real(wp), dimension(1:3) :: point, local_point
902+
real(wp), dimension(1:3) :: point, local_point, offset
903903
real(wp), dimension(1:3) :: center, xyz_local
904904
real(wp), dimension(1:3, 1:3) :: inverse_rotation
905905
906906
model => models(patch_id)%model
907907
center = 0._wp
908-
if (.not. f_is_default(patch_ib(patch_id)%x_centroid)) center(1) = patch_ib(patch_id)%x_centroid
909-
if (.not. f_is_default(patch_ib(patch_id)%y_centroid)) center(2) = patch_ib(patch_id)%y_centroid
910-
if (p > 0) then
911-
if (.not. f_is_default(patch_ib(patch_id)%z_centroid)) center(3) = patch_ib(patch_id)%z_centroid
912-
end if
908+
center(1) = patch_ib(patch_id)%x_centroid
909+
center(2) = patch_ib(patch_id)%y_centroid
910+
if (p > 0) center(3) = patch_ib(patch_id)%z_centroid
913911
inverse_rotation(:, :) = patch_ib(patch_id)%rotation_matrix_inverse(:, :)
912+
offset(:) = patch_ib(patch_id)%centroid_offset(:)
914913
915914
do i = 0, m
916915
do j = 0, n
@@ -921,6 +920,7 @@ contains
921920
xyz_local(3) = z_cc(k) - center(3)
922921
end if
923922
xyz_local = matmul(inverse_rotation, xyz_local)
923+
xyz_local = xyz_local - offset
924924
925925
if (grid_geometry == 3) then
926926
xyz_local = f_convert_cyl_to_cart(xyz_local)

src/simulation/m_ibm.fpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ contains
9292
moving_immersed_boundary_flag = .true.
9393
end if
9494
call s_update_ib_rotation_matrix(i)
95-
call s_compute_centroid_offset(i)
9695
end do
97-
! $:GPU_ENTER_DATA(copyin='[patch_ib(1:num_ibs)]')
9896
$:GPU_UPDATE(device='[patch_ib(1:num_ibs)]')
9997

10098
! GPU routines require updated cell centers
@@ -109,8 +107,12 @@ contains
109107
! recompute the new ib_patch locations and broadcast them.
110108
ib_markers%sf = 0._wp
111109
call s_apply_ib_patches(ib_markers%sf(0:m, 0:n, 0:p))
112-
call s_populate_ib_buffers()
113110
$:GPU_UPDATE(device='[ib_markers%sf]')
111+
call s_populate_ib_buffers()
112+
$:GPU_UPDATE(host='[ib_markers%sf]')
113+
do i = 1, num_ibs
114+
if (patch_ib(i)%moving_ibm /= 0) call s_compute_centroid_offset(i) ! offsets are computed after IB markers are generated
115+
end do
114116

115117
! find the number of ghost points and set them to be the maximum total across ranks
116118
call s_find_num_ghost_points(num_gps, num_inner_gps)

0 commit comments

Comments
 (0)