Bug
f_check_interpolation_2D and f_check_interpolation_3D in src/common/m_model.fpp unconditionally overwrite the interpolate flag on every loop iteration, so only the last edge/triangle determines the return value:
do j = 1, boundary_edge_count
l1 = sqrt(...)
if (l1 > cell_width) then
interpolate = .true.
else
interpolate = .false. ! ← clobbers previous .true.
end if
end do
If edge 5 of 10 needs interpolation but edge 10 doesn't, the function returns .false., causing the caller to skip interpolation when it's needed. This can produce incorrect levelset fields for OBJ models where mesh resolution varies across the surface.
The same pattern exists in both the 2D (line ~750) and 3D (line ~793) versions.
Fix
PR #1215
Bug
f_check_interpolation_2Dandf_check_interpolation_3Dinsrc/common/m_model.fppunconditionally overwrite theinterpolateflag on every loop iteration, so only the last edge/triangle determines the return value:If edge 5 of 10 needs interpolation but edge 10 doesn't, the function returns
.false., causing the caller to skip interpolation when it's needed. This can produce incorrect levelset fields for OBJ models where mesh resolution varies across the surface.The same pattern exists in both the 2D (line ~750) and 3D (line ~793) versions.
Fix
PR #1215