[FEATURE] Enhance SAP coupler for coupling between Rigid body and Fem object.#1458
Merged
duburcqa merged 68 commits intoGenesis-Embodied-AI:mainfrom Aug 14, 2025
Merged
[FEATURE] Enhance SAP coupler for coupling between Rigid body and Fem object.#1458duburcqa merged 68 commits intoGenesis-Embodied-AI:mainfrom
duburcqa merged 68 commits intoGenesis-Embodied-AI:mainfrom
Conversation
YilingQiao
reviewed
Jul 28, 2025
YilingQiao
previously approved these changes
Jul 30, 2025
duburcqa
reviewed
Aug 8, 2025
duburcqa
reviewed
Aug 9, 2025
duburcqa
reviewed
Aug 9, 2025
duburcqa
reviewed
Aug 9, 2025
Collaborator
|
(Note: I'm unsubscribing myself, so please re-tag me if needed) |
Contributor
Author
|
@duburcqa First round fix finished. |
Contributor
Author
|
Please do so. Thank you!
…On Tue, Aug 12, 2025 at 8:38 PM Alexis DUBURCQ ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In genesis/engine/couplers/sap_coupler.py
<#1458 (comment)>
:
> + # Step 1: Solve w st. L^T @ w = y
+ for i_b, i_e in ti.ndrange(self._B, self.rigid_solver.n_entities):
+ if not self.batch_pcg_active[i_b]:
+ continue
+ entity_dof_start = self.rigid_solver.entities_info.dof_start[i_e]
+ entity_dof_end = self.rigid_solver.entities_info.dof_end[i_e]
+ n_dofs = self.rigid_solver.entities_info.n_dofs[i_e]
+ for i_d_ in range(n_dofs):
+ i_d = entity_dof_end - i_d_ - 1
+ out[i_b, i_d] = vec[i_b, i_d]
+ for j_d in range(i_d + 1, entity_dof_end):
+ out[i_b, i_d] -= self.rigid_solver.mass_mat_L[j_d, i_d, i_b] * out[i_b, j_d]
+
+ # Step 2: z = D^{-1} w
+ for i_b, i_d in ti.ndrange(self._B, self.rigid_solver.n_dofs):
+ if not self.batch_pcg_active[i_b]:
+ continue
+ out[i_b, i_d] *= self.rigid_solver.mass_mat_D_inv[i_d, i_b]
+
+ # Step 3: Solve x st. L @ x = z
+ for i_b, i_e in ti.ndrange(self._B, self.rigid_solver.n_entities):
+ if not self.batch_pcg_active[i_b]:
+ continue
+ entity_dof_start = self.rigid_solver.entities_info.dof_start[i_e]
+ entity_dof_end = self.rigid_solver.entities_info.dof_end[i_e]
+ n_dofs = self.rigid_solver.entities_info.n_dofs[i_e]
+ for i_d in range(entity_dof_start, entity_dof_end):
+ for j_d in range(entity_dof_start, i_d):
+ out[i_b, i_d] -= self.rigid_solver.mass_mat_L[i_d, j_d, i_b] * out[i_b, j_d]
The only way may be to have some very generic ti.func that does LTDL
decomposition and pass everything that it necessary in arguments, without
any simulation related data structure.
I can do this for you tomorrow if necessary.
—
Reply to this email directly, view it on GitHub
<#1458 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM3M7IJQTC23TYMLEQOG7ZD3NKXJVAVCNFSM6AAAAACCKJ23VOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTCMJTHAZTGNBYGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
winnieyangwannan
pushed a commit
to winnieyangwannan/Genesis
that referenced
this pull request
Sep 14, 2025
Kashu7100
pushed a commit
to Kashu7100/Genesis
that referenced
this pull request
Jan 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Related Issue
Resolves #1450
Motivation and Context
Making SAP solver more general.
How Has This Been / Can This Be Tested?
Tests are added.
Screenshots (if appropriate):
test_fem_articulated.mp4
test_dragon_rigid.mp4
test_fem_rigid.mp4
Checklist:
Submitting Code Changessection of CONTRIBUTING document.