Skip to content

Use a symmetric pair-local near-zero cutoff for DEM - #1347

Merged
svchb merged 13 commits into
mainfrom
refactor/uniform-near-zero-distance
Oct 8, 2026
Merged

svchb merged 13 commits into
mainfrom
refactor/uniform-near-zero-distance

Conversation

@svchb

@svchb svchb commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow up on #1349 by making the DEM near-zero distance cutoff symmetric and pair-local:

distance < almostzero(max(r_a, r_b))
  • Use the larger radius of the interacting pair as the length scale for the almostzero helper introduced in Use simpler almostzero without computing a sqrt #1349.
  • Give both directions of a contact the same skip decision, preserving equal-and-opposite forces for systems with different particle radii.
  • Make the cutoff independent of unrelated large particles elsewhere in either system.
  • Add Float32/Float64 regressions for coincidence, a separation between the old system-based cutoffs, the exact strict-comparison boundary, a retained separation, and an unrelated large particle.

Dependency

This PR follows #1349. Its base branch, simpler-almostzero in trixi-framework/TrixiParticles.jl, mirrors #1349's fork head at 62ea696efe6bb76c554d05355173606c337d4a7f so the follow-up diff can be reviewed directly. Retarget to main after #1349 merges.

Validation

1,212/1,212 tests passed on Julia 1.11.9 with bounds checking: all existing smoothing-kernel tests and DEM system/contact-model tests, including 36 new DEM regression assertions.

JuliaFormatter 2.1.1 and whitespace checks passed.

@codecov

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.94%. Comparing base (f24a312) to head (2dd8b9b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1347      +/-   ##
==========================================
+ Coverage   90.71%   90.94%   +0.22%     
==========================================
  Files         143      143              
  Lines       11493    11508      +15     
==========================================
+ Hits        10426    10466      +40     
+ Misses       1067     1042      -25     
Flag Coverage Δ
total 90.94% <100.00%> (+0.22%) ⬆️
unit 78.55% <100.00%> (+0.41%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@svchb
svchb marked this pull request as ready for review October 3, 2026 11:12
@svchb svchb self-assigned this Oct 3, 2026
@svchb
svchb requested a review from efaulhaber October 3, 2026 11:12
@svchb svchb added the enhancement New feature or request label Oct 3, 2026
@svchb

svchb commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

superseeded by 1349. DEM fix needs still followup.

@svchb
svchb marked this pull request as draft October 5, 2026 10:46
@svchb svchb changed the title Use a uniform relative squared-distance zero criterion Use a symmetric pair-local near-zero cutoff for DEM Oct 5, 2026
@svchb
svchb changed the base branch from main to simpler-almostzero October 5, 2026 13:26
@svchb
svchb marked this pull request as ready for review October 5, 2026 13:45
@svchb
svchb changed the base branch from simpler-almostzero to main October 5, 2026 16:52
svchb added a commit that referenced this pull request Oct 5, 2026
…-fluid-reaction-forces

Resolve conflicts in favor of this branch's structure-fluid reaction-force
implementation while adopting the base branch's changes:

- Keep structure.jl deleted; its content moved to fluid_interaction.jl and
  the owning schemes.
- Port check_compact_support_fsi into fluid_interaction.jl.
- Base the structure-side pair force on the shared add_momentum_equation so
  the reaction on the structure is the exact negative of the fluid force,
  while evaluating the fluid-side gradient with the fluid-first position
  vector (corrected gradients need not be odd).
- Use the almostzero near-zero distance check from #1349.
- Keep both NEWS entries for #1338 and the pair-local DEM cutoff (#1347).
@svchb svchb closed this Oct 6, 2026
@svchb svchb reopened this Oct 6, 2026
Comment thread NEWS.md Resolved
@svchb
svchb requested a review from efaulhaber October 7, 2026 12:23
@svchb

svchb commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author

/run-gpu-tests

@svchb
svchb enabled auto-merge (squash) October 7, 2026 21:49
@svchb
svchb merged commit 20a1585 into main Oct 8, 2026
18 checks passed
@svchb
svchb deleted the refactor/uniform-near-zero-distance branch October 8, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants