Skip to content

Remove duplicate pressure limiting for Adami BC #839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

efaulhaber
Copy link
Member

The pressure limiting loop was run for every neighbor system.
I now moved it into the inverse state equation threaded loop/kernel, which also saves a bit of time on the GPU by doing two things in the same kernel.
I also change the code of the Adami pressure extrapolation to be a bit more readable and used @inbounds for slightly better GPU performance.

@efaulhaber efaulhaber requested review from LasNikas, svchb and Copilot June 17, 2025 13:13
@efaulhaber efaulhaber self-assigned this Jun 17, 2025
Copy link

@Copilot 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

Refactors pressure limiting to eliminate duplicate loops, improves GPU performance with @inbounds, and clarifies coordinate updates and Adami pressure extrapolation.

  • Moved non-negative pressure limiting into the inverse state equation kernel to avoid repeated loops.
  • Refactored the Adami pressure extrapolation for readability and added @inbounds annotations.
  • Added explanatory comments in update_positions! to clarify coordinate handling.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/schemes/solid/total_lagrangian_sph/system.jl Added comments clarifying that current_coordinates holds both fixed and integrated particles and copies the integrated ones from u.
src/schemes/boundary/dummy_particles/dummy_particles.jl Removed duplicate pressure-limiting loop, consolidated pressure calculation into one kernel, introduced @inbounds, and refactored variable naming for clarity.
Comments suppressed due to low confidence (1)

src/schemes/boundary/dummy_particles/dummy_particles.jl:533

  • [nitpick] The trailing underscore in dynamic_pressure_ may be confusing; consider renaming it to dynamic_pressure for clarity and consistency.
    dynamic_pressure_ = dynamic_pressure(boundary_density_calculator, density_neighbor,

Copy link

codecov bot commented Jun 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.46%. Comparing base (785ade6) to head (585838c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #839      +/-   ##
==========================================
+ Coverage   70.43%   70.46%   +0.02%     
==========================================
  Files         106      106              
  Lines        6867     6870       +3     
==========================================
+ Hits         4837     4841       +4     
+ Misses       2030     2029       -1     
Flag Coverage Δ
unit 70.46% <100.00%> (+0.02%) ⬆️

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant