Skip to content

Feature/extend velocity along normals#73

Merged
maltezfaria merged 3 commits intomaltezfaria:mainfrom
Fastaxx:feature/extend-velocity-along-normals
Feb 24, 2026
Merged

Feature/extend velocity along normals#73
maltezfaria merged 3 commits intomaltezfaria:mainfrom
Fastaxx:feature/extend-velocity-along-normals

Conversation

@Fastaxx
Copy link
Copy Markdown
Collaborator

@Fastaxx Fastaxx commented Feb 19, 2026

Related issues

#70

Summary

This PR adds normal-velocity extension for interface-defined scalar speeds and a small API improvement to NormalMotionTerm.

  • NormalMotionTerm now accepts an optional update callback (like AdvectionTerm) so a mesh-based speed field can be mutated before each RK stage:
vfield = MeshField(x -> 0.0, grid)
term = NormalMotionTerm(vfield, (v, ϕ, t) -> (values(v) .= 0.25 + 0.1 * t))
term
  • Adds extend_along_normals! to extend an interface-only speed (common in Stefan problems where (v_n) is known only near ϕ=0) into a narrow band, then use it with NormalMotionTerm:
ϕext = LevelSetMethods.star(grid)
v = zeros(Float64, size(grid)...)
Δ = minimum(LevelSetMethods.meshsize(grid))
frozen = abs.(values(ϕext)) .<= 1.5Δ
for I in CartesianIndices(v)
    frozen[I] || continue
    x = grid[I]
    v[I] = 0.2 + 0.1 * cos(2π * atan(x[2], x[1]))
end
extend_along_normals!(v, ϕext; frozen, nb_iters = 80)
term = NormalMotionTerm(MeshField(v, grid, nothing))
term

Checklist

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 95.94595% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.34%. Comparing base (f69cfcb) to head (b1af1cc).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/velocityextension.jl 97.01% 2 Missing ⚠️
src/levelsetterms.jl 85.71% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (f69cfcb) and HEAD (b1af1cc). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (f69cfcb) HEAD (b1af1cc)
2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #73       +/-   ##
===========================================
- Coverage   78.16%   50.34%   -27.82%     
===========================================
  Files          14       15        +1     
  Lines         948     1007       +59     
===========================================
- Hits          741      507      -234     
- Misses        207      500      +293     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maltezfaria maltezfaria merged commit 2c32c19 into maltezfaria:main Feb 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants