Refactor flex stiffness storage to support variable sizes.

This change introduces `nflexstiffness` and `flex_stiffnessadr` to allow flex stiffness matrices to have sizes other than the fixed 21 per element. Higher-order flexes can now store larger stiffness matrices based on their number of nodes. The `flex_stiffnessadr` array provides the starting index for each flex's stiffness data within the `flex_stiffness` array.

PiperOrigin-RevId: 899632263
Change-Id: Ie49182c46c3777acf0c6b492345edfcf62fb5e44
This commit is contained in:
Alessio Quaglino
2026-04-14 09:38:17 -07:00
committed by Copybara-Service
parent 08bb6e66f1
commit 5724158593
14 changed files with 100 additions and 48 deletions
+3 -1
View File
@@ -185,6 +185,7 @@
X( nflexedge ) \
X( nflexelem ) \
X( nflexelemdata ) \
X( nflexstiffness ) \
X( nflexelemedge ) \
X( nflexshelldata ) \
X( nflexevpair ) \
@@ -462,6 +463,7 @@
X ( int, flex_elemadr, nflex, 1 ) \
X ( int, flex_elemnum, nflex, 1 ) \
X ( int, flex_elemdataadr, nflex, 1 ) \
X ( int, flex_stiffnessadr, nflex, 1 ) \
X ( int, flex_elemedgeadr, nflex, 1 ) \
X ( int, flex_shellnum, nflex, 1 ) \
X ( int, flex_shelldataadr, nflex, 1 ) \
@@ -490,7 +492,7 @@
X ( mjtNum, flexedge_invweight0, nflexedge, 1 ) \
X ( mjtNum, flex_radius, nflex, 1 ) \
X ( mjtNum, flex_size, nflex, 3 ) \
X ( mjtNum, flex_stiffness, nflexelem, 21 ) \
X ( mjtNum, flex_stiffness, nflexstiffness, 1 ) \
X ( mjtNum, flex_bending, nflexedge, 17 ) \
X ( mjtNum, flex_damping, nflex, 1 ) \
X ( mjtNum, flex_edgestiffness, nflex, 1 ) \