MorphOpt —— A Differentiable Optimization Framework for Soft Structure & Morphology Design
Developed by Zenan Song
A differentiable structural optimization framework that eliminates manual sensitivity derivation by fusing the adjoint method with automatic differentiation (AD). The sensitivity corresponds to the virtual work of residual force derivatives on the adjoint displacement field, computed via a single backpropagation through the residual graph. MorphOpt provides a unified interface for geometry, load, and material definition, calls torchfea for GPU-accelerated differentiable nonlinear FEA and adjoint-AD sensitivity, and employs a trust-region optimizer with L-BFGS for design updates. Validated on SIMP topology optimization with B-spline density fields and pneumatic soft robot shape optimization with deformation-dependent follower loads.
Features
- Custom model definition covering geometry, material, and load parameters
- Differentiable FEA via torchfea with automatic solving and sensitivity propagation
- L-BFGS and trust-region methods for parameter updates within a subproblem framework
- Fully extensible via inheritance — users customize every component in their definition scripts
Quick Start
pip install morphopt
- Install dependencies. Python ≥ 3.12, PyTorch (float64) recommended.
- Run a minimal example:
# Shape optimization
python examples/basic/shapeoptimization.py
# SIMP topology optimization
python examples/basic/simp.py
- More usage examples:
- Task definition guide:
docs/module_definition_guide.md - Module API reference:
docs/module_reference.md - Theory & papers:
docs/theory/
Directory Overview
src/morphopt/optcore— Core package (controller, params, solver, objective, updaters)shapeopt/— B-spline shape optimizationsimp/— SIMP topology optimization
examples/— Example tasks (bending actuator, gripper, etc.)docs/— Usage guides, API reference, and theory paperstests/— Gradient checks, geometry tests, UI tests
License
Research use preferred. For production or commercial use, please evaluate and ensure numerical and engineering robustness first.
Citation
If you use MorphOpt in your research, please cite:
- TRO 2023 — Morphology Design
- TRO 2026 — Jacobian-based Optimization
- TMECH 2026 — Contact-aware Design
Metadata
Release files for morphopt 3.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| morphopt-3.1.5.tar.gz | 94.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| morphopt-3.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 212.4 kB
Release files / morphopt-3.1.5.tar.gz
| Download URL | morphopt-3.1.5.tar.gz |
|---|---|
| Size | 94.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9cb2eb79c49ab64a3f4c36a99d2ea35c30f0c1911ee327ea5c3198ae6fc45d78
|
|
BLAKE2b-256 checksum How to use checksums |
c1b004050f8fc4c8264442ea380b29a139073b93a8989e6a8cf2b827364d09f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / morphopt-3.1.5-py3-none-any.whl
| Download URL | morphopt-3.1.5-py3-none-any.whl |
|---|---|
| Size | 118.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4a490a13c2b3653abdad161898fc23fcdf610da52c007673636735551c686f6
|
|
BLAKE2b-256 checksum How to use checksums |
09435044e8efe69045acbfd17aa7942533988d29eef18b091b5b63e583e9e1d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|