Skip to content

Conversation

@LasNikas
Copy link
Collaborator

@LasNikas LasNikas commented Sep 30, 2025

With this PR, we now have two ways to specify clamped particles:

  1. Manual ordering: Provide the number of clamped particles via n_clamped_particles,
    ensuring that these particles are the last entries in the InitialCondition
  2. Automatic ordering: Pass the indices of the particles to be clamped via clamped_particles.
    In this case, the specified particles will be internally reordered so that they become
    the last particles in the InitialCondition.

The second option can be helpful in more complex setups, for example, to avoid unions.

Here a snippet from the oscillating_beam_2d.jl example

structure_system = TotalLagrangianSPHSystem(structure, smoothing_kernel, smoothing_length,
                                            material.E, material.nu,
                                            # n_clamped_particles=nparticles(clamped_particles),
                                            clamped_particles=collect((nparticles(beam) + 1):nparticles(structure)),
                                            acceleration=(0.0, -gravity),
                                            penalty_force=nothing, viscosity=nothing)

@LasNikas LasNikas requested a review from efaulhaber September 30, 2025 15:58
@LasNikas LasNikas self-assigned this Sep 30, 2025
@LasNikas LasNikas requested a review from svchb September 30, 2025 15:58
@codecov
Copy link

codecov bot commented Sep 30, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.89%. Comparing base (c1db9a3) to head (1c71c74).

Files with missing lines Patch % Lines
...c/schemes/structure/total_lagrangian_sph/system.jl 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #931      +/-   ##
==========================================
+ Coverage   63.87%   63.89%   +0.02%     
==========================================
  Files         117      117              
  Lines        7842     7858      +16     
==========================================
+ Hits         5009     5021      +12     
- Misses       2833     2837       +4     
Flag Coverage Δ
unit 63.89% <75.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.

@LasNikas LasNikas added the enhancement New feature or request label Sep 30, 2025
Copy link
Collaborator

@svchb svchb left a comment

Choose a reason for hiding this comment

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

A test is missing.

If you remove the first option it is a breaking change.

@LasNikas LasNikas requested a review from svchb October 2, 2025 12:34
@LasNikas LasNikas mentioned this pull request Oct 13, 2025
13 tasks
@LasNikas LasNikas force-pushed the automatic-ordering-clamped-particles branch from 122e5ef to 88b09e3 Compare October 22, 2025 17:27
@LasNikas
Copy link
Collaborator Author

/run-gpu-tests

@LasNikas LasNikas requested a review from efaulhaber October 28, 2025 16:38
@LasNikas LasNikas requested a review from efaulhaber October 30, 2025 11:42
@LasNikas LasNikas requested a review from efaulhaber October 31, 2025 08:56
@LasNikas LasNikas requested a review from efaulhaber October 31, 2025 09:10
@LasNikas
Copy link
Collaborator Author

/run-gpu-tests

@LasNikas LasNikas enabled auto-merge (squash) October 31, 2025 12:53
@LasNikas LasNikas merged commit 418c9c2 into trixi-framework:main Oct 31, 2025
16 checks passed
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.

3 participants