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
+2
View File
@@ -962,6 +962,7 @@ public unsafe struct mjModel_ {
public UInt64 nflexedge;
public UInt64 nflexelem;
public UInt64 nflexelemdata;
public UInt64 nflexstiffness;
public UInt64 nflexelemedge;
public UInt64 nflexshelldata;
public UInt64 nflexevpair;
@@ -1208,6 +1209,7 @@ public unsafe struct mjModel_ {
public int* flex_elemadr;
public int* flex_elemnum;
public int* flex_elemdataadr;
public int* flex_stiffnessadr;
public int* flex_elemedgeadr;
public int* flex_shellnum;
public int* flex_shelldataadr;