Refactor flex strain constraints to be per-cell.

Each mjEQ_FLEXSTRAIN equality now represents a single cell within a flex. This allows for more efficient sparse Jacobian computation by only considering the degrees of freedom of the nodes within each specific cell. This change gives a speedup of about 10x on a 3x3x3 model.

PiperOrigin-RevId: 902164069
Change-Id: I78eedf1d5cf39b8989fe9863c22d164922fc0efb
This commit is contained in:
Alessio Quaglino
2026-04-19 07:20:49 -07:00
committed by Copybara-Service
parent a9e61966b5
commit 3d45a33190
7 changed files with 289 additions and 256 deletions
+4 -1
View File
@@ -4888,8 +4888,11 @@ constraint type is only supported for dimension 3 flexes with trilinear or quadr
:at:`flex`: :at-val:`string, required`
Name of the flex whose strain is being constrained.
.. _equality-flexstrain-cell:
:at:`cell`: :at-val:`int(3), optional`
3D grid index (i, j, k) identifying the cell in the flex object. The grid size is specified in the :ref:`cellcount
<deformable-flex-cellcount>` attribute.
.. _tendon: