Repository navigation
Commit e3bd727
Add 2D and 3D stretching elasto-plasticity (
### Physical Model
- **Cell / Face Plastic Engineering Strain (`d->plastic`):**
- **3D Volume Interpolation (`interp > 0`, `elastic2d="none"`):** Each grid cell $e$ stores a 6-component symmetric plastic engineering strain tensor $\varepsilon^p\_e = (\varepsilon^p\_{xx}, \varepsilon^p\_{yy}, \varepsilon^p\_{zz}, \gamma^p\_{xy}, \gamma^p\_{xz}, \gamma^p\_{yz})$ (`6 * cx * cy * cz` entries per flex, allocated for the full `cellcount` grid).
- **2D Shell Interpolation (`interp < 0`, `dim="2"` with `elastic2d="stretch"` or `"both"`):** Each outer grid face $f$ stores a 3-component in-plane plastic engineering strain tensor $\varepsilon^p\_f = (\varepsilon^p\_{11}, \varepsilon^p\_{22}, \gamma^p\_{12})$ (`6 * (cy*cz + cx*cz + cx*cy)` entries per flex, i.e. 3 per outer face). With `elastic2d="bend"`, `yield` is ignored (bending plasticity is not supported for interpolated flexes) and the flex remains purely elastic.
- **Corotated Polar Decomposition on the Physical Jacobian:**
- In `mj_flexPassiveInterp` (and `mujoco_warp`'s `compute_interp_cell_quat` / `compute_interp_face_quat`), the cell/face rotation $R\_e$ is the standard polar decomposition of the physical Jacobian $J\_e = \partial x / \partial X$ at the cell/face center, obtained by scaling the columns of the parametric gradient $\partial x / \partial \xi$ by the reference cell extents $(1/\Delta x, 1/\Delta y, 1/\Delta z)$ (and the face tangents $t\_1 / \Delta\_0$, $t\_2 / \Delta\_1$ before the normal cross product in 2D). It does not read `d->plastic`: since the plastic strain is additive in the corotated frame, $R\_e$ is the exact rigid rotation at any rotated plastic rest configuration, including non-cubic cells.
- For large rotations (non-positive trace of the Jacobian), the iterative polar decomposition (`mju_flexPolarRotation` / `mat33_to_quat_polar`) is warm-started from the Gram-Schmidt rotation of the Jacobian columns, so it does not stall at the identity saddle point (e.g. 180 degree rotations, which are exact for cells with consistent physical scaling).
- Using the precomputed cell/face stiffness matrix $K\_e$, the nodal displacement vector in the local corotated frame is offset by the plastic deformation $\Delta d\_i = R\_e^T x\_i - X\_i - \varepsilon^p\_e (X\_i - X\_0)$, leaving $K\_e$ invariant while shifting the zero-force configuration.
- **Return Mapping (`advanceFinish` / `_next_plastic_flex_interp`):**
- At the end of each step, the cell-center corotated total strain $\varepsilon^{\text{tot}} = \mathrm{sym}(R\_e^T J\_e - I)$ is decomposed into elastic and plastic parts $\varepsilon^{\text{el}}\_e = \varepsilon^{\text{tot}} - \varepsilon^p\_e$, and radial return projects $\varepsilon^{\text{el}}\_e$ onto the von Mises ($J\_2$) yield surface (3D isochoric in 3D, plane-stress with out-of-plane thinning in tension in 2D) with threshold $\varepsilon\_y =$ `flex_yield[f]`.
- To prevent degenerate cell Jacobians under extreme repeated loading, $\varepsilon^p\_e$ is bounded in Frobenius norm ($\|\varepsilon^p\_e\|\_F \le 0.35$, guaranteeing $\lambda\_{\min}(I + \varepsilon^p\_e) > 0.71$).
- **Dimensionless Keyframe Scaling:** Because $\varepsilon^p\_e$ is a dimensionless engineering strain, `ScaleKeyframe` leaves interpolated flex entries invariant under spatial scaling (`flex_interp[f] != 0`).
PiperOrigin-RevId: 1010658301
Change-Id: I41a16150e9dfa56610794d27669e43d32599b6cayield) for interpolated flexes (dof="trilinear" and dof="quadratic").1 parent c39fe6f commit e3bd727
19 files changed
Lines changed: 1043 additions & 72 deletions
File tree
- doc
- mjx/mujoco/mjx/third_party/mujoco_warp/_src
- src
- engine
- user
- test/engine
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4876 | 4876 | | |
4877 | 4877 | | |
4878 | 4878 | | |
4879 | | - | |
4880 | | - | |
4881 | | - | |
4882 | | - | |
4883 | | - | |
4884 | | - | |
4885 | | - | |
4886 | | - | |
4887 | | - | |
| 4879 | + | |
| 4880 | + | |
| 4881 | + | |
| 4882 | + | |
| 4883 | + | |
| 4884 | + | |
| 4885 | + | |
| 4886 | + | |
| 4887 | + | |
| 4888 | + | |
| 4889 | + | |
| 4890 | + | |
| 4891 | + | |
| 4892 | + | |
| 4893 | + | |
4888 | 4894 | | |
4889 | 4895 | | |
4890 | 4896 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1643 | 1643 | | |
1644 | 1644 | | |
1645 | 1645 | | |
| 1646 | + | |
1646 | 1647 | | |
1647 | 1648 | | |
1648 | 1649 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2563 | 2563 | | |
2564 | 2564 | | |
2565 | 2565 | | |
| 2566 | + | |
2566 | 2567 | | |
2567 | 2568 | | |
2568 | 2569 | | |
| |||
2621 | 2622 | | |
2622 | 2623 | | |
2623 | 2624 | | |
2624 | | - | |
| 2625 | + | |
2625 | 2626 | | |
2626 | 2627 | | |
2627 | 2628 | | |
| |||
2900 | 2901 | | |
2901 | 2902 | | |
2902 | 2903 | | |
| 2904 | + | |
2903 | 2905 | | |
2904 | 2906 | | |
2905 | 2907 | | |
| |||
2969 | 2971 | | |
2970 | 2972 | | |
2971 | 2973 | | |
2972 | | - | |
| 2974 | + | |
2973 | 2975 | | |
2974 | 2976 | | |
2975 | 2977 | | |
| |||
3475 | 3477 | | |
3476 | 3478 | | |
3477 | 3479 | | |
| 3480 | + | |
3478 | 3481 | | |
3479 | 3482 | | |
3480 | 3483 | | |
| |||
3608 | 3611 | | |
3609 | 3612 | | |
3610 | 3613 | | |
| 3614 | + | |
3611 | 3615 | | |
3612 | 3616 | | |
3613 | 3617 | | |
| |||
3963 | 3967 | | |
3964 | 3968 | | |
3965 | 3969 | | |
| 3970 | + | |
3966 | 3971 | | |
3967 | 3972 | | |
3968 | 3973 | | |
| |||
0 commit comments