Skip to content

Fix interpolation and small fixes to callbacks#1101

Draft
efaulhaber wants to merge 3 commits intotrixi-framework:mainfrom
efaulhaber:callback-fixes
Draft

Fix interpolation and small fixes to callbacks#1101
efaulhaber wants to merge 3 commits intotrixi-framework:mainfrom
efaulhaber:callback-fixes

Conversation

@efaulhaber
Copy link
Member

@efaulhaber efaulhaber commented Mar 16, 2026

This PR

  • fixes wall velocity in the interpolation if include_wall_velocity == true and cut_off_bnd == false,
  • fixes the conditions for callbacks,
  • makes density reinit callback work when a WCSPH system with SummationDensity is in the simulation.

@efaulhaber efaulhaber self-assigned this Mar 16, 2026
@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 25.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.25%. Comparing base (2d42821) to head (72cf15e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/callbacks/steady_state_reached.jl 0.00% 5 Missing ⚠️
...rc/schemes/fluid/weakly_compressible_sph/system.jl 0.00% 5 Missing ⚠️
src/callbacks/density_reinit.jl 0.00% 1 Missing ⚠️
src/general/initial_condition.jl 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (2d42821) and HEAD (72cf15e). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (2d42821) HEAD (72cf15e)
total 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1101       +/-   ##
===========================================
- Coverage   89.51%   67.25%   -22.27%     
===========================================
  Files         126      126               
  Lines        9614     9601       -13     
===========================================
- Hits         8606     6457     -2149     
- Misses       1008     3144     +2136     
Flag Coverage Δ
total ?
unit 67.25% <25.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines callback behavior around density reinitialization / steady-state detection / solution saving, and fixes an initial-condition wrapping bug in the fluid pipeline.

Changes:

  • Add density-calculator-based dispatch for reinit_density! in WeaklyCompressibleSPHSystem.
  • Fix InitialCondition(sol, ...) to wrap the velocity state with wrap_v (not wrap_u).
  • Unify/adjust callback implementations: steady-state check scheduling, preset-time saving initialization, and mark density reinit as modifying the integrator state.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/schemes/fluid/weakly_compressible_sph/system.jl Dispatch reinit_density! based on density_calculator (Continuity vs Summation).
src/general/initial_condition.jl Correctly wrap the velocity ODE state via wrap_v.
src/callbacks/steady_state_reached.jl Consolidate affect! and move discrete-callback triggering to interval-based condition.
src/callbacks/solution_saving.jl Add save_positions and initialize to the preset-time saving callback path.
src/callbacks/density_reinit.jl Clarify dt semantics in docs and notify the integrator that u was modified after density reinit.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

of integration time. This callback does not add extra time
steps / `tstops`; instead, reinitialization is triggered at
the first solver step after each `dt` interval has elapsed.
- `reinit_initial_solution`: Reinitialize the initial solution (default=false)
Comment on lines 106 to 110
if length(save_times) > 0
return PresetTimeCallback(save_times, solution_callback)
return PresetTimeCallback(save_times, solution_callback,
save_positions=(false, false),
initialize=(initialize_save_cb!))
elseif dt > 0
@efaulhaber efaulhaber changed the title Small fixes to callbacks Fix interpolation and small fixes to callbacks Mar 17, 2026
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