Fix periodic ib issues#1618
Conversation
…ty when computing the radial vector
…umber of IB force communications. This limits the number of transmits and prevents double-counting in periodic cases.
|
Claude Code Review Head SHA: 4a2cb4c Files changed:
Findings: 1.
else ! general case
count = 0
moment = 0._wp ! zeros the intent(out) dummy
...
else if (sqrt(sum(moment**2)) < sgm_eps) then ! 0 < sgm_eps — always true
moment = 1._wp
return ! numerical integration below never runs
else
normal_axis = moment/sqrt(sum(moment**2)) ! unreachable
end if
! ... volume-integration loop — never reached for 3D general geometry
moment = moment*patch%mass/(count*cell_volume)In the old code 2.
! m_time_steppers.fpp:759
if (num_dims == 3) call s_compute_moment_of_inertia(patch_ib(i), patch_ib(i)%angular_vel)
! m_time_steppers.fpp:761
patch_ib(i)%angular_vel = patch_ib(i)%angular_vel/patch_ib(i)%momentAfter the call, 3.
integer, dimension(:), allocatable :: ib_gbl_idx_lookup
$:GPU_DECLARE(create='[ib_gbl_idx_lookup]')
|
|
Fixed all of the bugs that I have been made aware of, and now all minimum-reproducers I was given behave as anticipated. Final list of bugfixes:
Will add an example to make sure we don't regress on this. |
…her domain and that collide periodically
…C into fix-periodic-ib-issues
Description
I was made aware of several bugs in the IB MPI communication in periodic cases. This branch resolves all of the issues that I have been made aware of. They include
The good news is that the fix for number 2 is also a computational optimization in small cases by limiting the total number of communications to the minimum required to successfully sum. So we have a slight upside.
A new example will be added that should check for this behavior and ensure that it does not break again.
Type of change (delete unused ones)