-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[FEATURE] Adds support for attaching MPM particles to rigid links. #2205
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
[FEATURE] Adds support for attaching MPM particles to rigid links. #2205
Conversation
| @pytest.mark.required | ||
| def test_mpm_particle_constraints(show_viewer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should flag this test as slow if it is (>200s). Beware that it means that it will only run on production CI, so only do this if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not slow on my machine, but I'm happy to add the tag to make our generic CI not too slow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not slow on my machine, but I'm happy to add the tag to make our generic CI not too slow
The speed must be benched on the generic CI runners. Not your machine. So you need to run the entire CI pipeline without "slow" mark at least once, otherwise you will never know since it will be skipped.
|
|
|
Comments are addressed |
|
Note that you are still not using zero-copy but I will let that slip in I don't think it is a bottleneck. |
Removed slow marker from test_mpm_particle_constraints.
Updated particle constraint size check to include a multiplier for dimensions and improved error message.
Refactor particles_mask handling for constraint removal.
3686057 to
858d511
Compare
Adds support for attaching MPM particles to rigid links using soft constraints, similar to the existing FEM vertex constraint system.
mpm_attachment.mp4
Changes
genesis/options/solvers.pyenable_particle_constraintsoption toMPMOptions(default: False)genesis/engine/solvers/mpm_solver.pyparticle_constraint_infostruct for constraint datainit_constraints()for lazy field initialization_kernel_set_particle_constraints()and_kernel_remove_particle_constraints()kernelsapply_particle_constraints()kernel withti.staticbranching for zero overhead when disabledsubstep_post_coupling()after G2Pgenesis/engine/entities/mpm_entity.pyget_particles_in_bbox()helper to find particles in a regionset_particle_constraints()to attach particles to a rigid linkremove_particle_constraints()to detach particlesUsage
Tests
tests/test_mpm.py: Unit tests for constraint API and behaviorExample
examples/coupling/rigid_mpm_attachment.py: Demo of MPM cube attached to oscillating rigid boxScreenshots (if appropriate):
Checklist:
Submitting Code Changessection of CONTRIBUTING document.