Skip to content

Commit 9d7d4ab

Browse files
sbryngelsonclaude
andcommitted
Simplify hyper_cleaning init and use size() for IB broadcast
- Remove redundant if(p>0) branch in psi initialization: z_cc(0)=0 in 2D, so the 3D formula produces identical results in both cases. - Replace hardcoded 3 with size(patch_ib(i)%VAR) in MPI_BCAST for vel/angular_vel/angles, consistent with other IB broadcasts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 097f6c7 commit 9d7d4ab

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

src/pre_process/m_mpi_proxy.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ contains
118118
end if
119119
! Broadcast IB variables
120120
#:for VAR in ['vel', 'angular_vel', 'angles']
121-
call MPI_BCAST(patch_ib(i)%${VAR}$, 3, mpi_p, 0, MPI_COMM_WORLD, ierr)
121+
call MPI_BCAST(patch_ib(i)%${VAR}$, size(patch_ib(i)%${VAR}$), mpi_p, 0, MPI_COMM_WORLD, ierr)
122122
#:endfor
123123
call MPI_BCAST(patch_ib(i)%geometry, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
124124
call MPI_BCAST(patch_ib(i)%model_filepath, len(patch_ib(i)%model_filepath), MPI_CHARACTER, 0, MPI_COMM_WORLD, ierr)

src/pre_process/m_start_up.fpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -790,11 +790,7 @@ contains
790790
do l = 0, p
791791
do k = 0, n
792792
do j = 0, m
793-
if (p > 0) then
794-
q_cons_vf(psi_idx)%sf(j, k, l) = 1.0e-2_wp*exp(-(x_cc(j)**2 + y_cc(k)**2 + z_cc(l)**2)/(2.0_wp*0.05_wp**2))
795-
else
796-
q_cons_vf(psi_idx)%sf(j, k, l) = 1.0e-2_wp*exp(-(x_cc(j)**2 + y_cc(k)**2)/(2.0_wp*0.05_wp**2))
797-
end if
793+
q_cons_vf(psi_idx)%sf(j, k, l) = 1.0e-2_wp*exp(-(x_cc(j)**2 + y_cc(k)**2 + z_cc(l)**2)/(2.0_wp*0.05_wp**2))
798794
q_prim_vf(psi_idx)%sf(j, k, l) = q_cons_vf(psi_idx)%sf(j, k, l)
799795
end do
800796
end do

0 commit comments

Comments
 (0)