Fix issue with the Fast Sweeping Method (FSM) for running it at start-up (after PR#38)
@pedro-jm is already working on this.
Since Aug 29, 2026.
- Dominant language
- Fortran
- Stars
- 11
- Forks
- 17
- Avg merge
- 21h 12m
- Merged PRs (30d)
- 1
Description
Fix the "explosion" in the center of the gradient field:
Using FSM at startup showed that most of the initial pockets are due to perimeter imprint. By smoothing the perimeter with FSM, the number of pockets decreases. So this is an important capability to have in the model.
A cell qualifies as "interface" if its sign flips against any cardinal neighbor, then gets distance = |lfn|/|∇lfn| with a central-difference gradient, which cancels to zero on one-cell-wide filaments even though the one-sided slopes are huge.
Recommended fix: cap the interface distance at the cell scale (one line):
lfn_s0(i, j) = min (abs (lfn_out(i, j)) / gradphi, 1.5 * max (dx, dy))
Why this solution works:
- It's geometrically exact as a bound: an interface cell has a sign change to an adjacent cardinal neighbor, so its center lies within one cell diagonal (≤ √2·dx ≈ 1.41·dx) of the zero contour. 1.5·max(dx,dy) is therefore a true upper bound on the distance being estimated.
- It matches an existing convention: the Russo–Smereka subcell distance is already capped at 1.5·dx, so the level-set code gets one consistent rule for "subcell distance estimates can't exceed 1.5 cells."
- Minimal blast radius: healthy interface cells produce estimates well below the cap (typically ≤ dx), so their values are bit-unchanged; only degenerate cells (central gradient ≈ 0, i.e., exactly the 1e8 cases) are modified.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.