Skip to content

f_check_interpolation_2D/3D returns only last edge's result #1219

@sbryngelson

Description

@sbryngelson

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions