[FEATURE] MPM rigid attachment #2205
Draft
+310
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.