Make dv_shifting, surface_tension_force and adhesion_force inplace#1124
Make dv_shifting, surface_tension_force and adhesion_force inplace#1124LasNikas merged 7 commits intotrixi-framework:mainfrom
dv_shifting, surface_tension_force and adhesion_force inplace#1124Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1124 +/- ##
==========================================
- Coverage 88.71% 88.70% -0.01%
==========================================
Files 128 128
Lines 9752 9764 +12
==========================================
+ Hits 8651 8661 +10
- Misses 1101 1103 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refactors SPH interaction terms (dv_shifting, surface_tension_force, adhesion_force) to be in-place updates (no-ops when disabled) instead of returning/accumulating zero vectors, aiming to reduce live SSA values and register pressure (notably on older GPUs).
Changes:
- Replaced returned-vector helpers with in-place
...!variants and updated fluid/structure RHS interaction loops to accumulate into a single mutable accumulator. - Updated surface tension and shifting technique implementations to add their contributions directly into the accumulator (including passing a
surface_tension_correctionfactor in-place). - Adjusted VTK output computation to use the in-place surface tension force to accumulate per-particle diagnostics.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/schemes/structure/structure.jl |
Switches structure–fluid interaction to an in-place adhesion contribution via a mutable accumulator. |
src/schemes/structure/rigid_body/system.jl |
Converts rigid-body adhesion force helper into an in-place adhesion_force!. |
src/schemes/fluid/weakly_compressible_sph/rhs.jl |
Updates WCSPH RHS interaction loop to accumulate shifting/surface tension/adhesion contributions in-place. |
src/schemes/fluid/surface_tension.jl |
Refactors surface tension + boundary adhesion force APIs to ...! and applies correction factor internally. |
src/schemes/fluid/shifting_techniques.jl |
Refactors shifting momentum-term API to in-place dv_shifting! and updates implementations accordingly. |
src/schemes/fluid/entropically_damped_sph/rhs.jl |
Updates EDAC RHS interaction loop to use in-place shifting/surface tension/adhesion accumulation. |
src/io/write_vtk.jl |
Updates surface tension diagnostic accumulation to use the new in-place API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/run-gpu-tests |
|
/run-gpu-tests |
This PR makes
dv_shifting,surface_tension_forceandadhesion_forceinplace and is part of #1131. Instead of accumulating zeroSVectors when no shifting/surface tension/adhesion is used, these functions are now no-ops. It also reduces the number of live variables, which reduces register pressure.Note that these optimizations make almost no difference on modern Hopper GPUs, but are very noticable on older Ampere GPUs.