Python optimization engine for FEBio
Project description
pyFEBiOpt
pyFEBiOpt wraps FEBio simulations with a flexible Python optimization engine. FEBio provides an optimization workflow, but it is limited when a project needs custom post-processing, several objectives, or SciPy-level control. This project binds SciPy optimizers to FEBio simulations so you can optimize flexible multi-objective cost functions while keeping FEBio as the solver.
Highlights
- Inverse optimization engine with reparameterization, clean logging, monitoring, Jacobian helpers, FEB template bindings, and configurable runners/storage. Build parameter grids, run multiple cases, and keep artifacts organized with automatic cleanup/persistence policies.
- Post-processing via a fast binary
.xpltreader with sliceable views for nodes, elements, faces, and regions (no copies until needed). - Visualization utilities built on
pyvistafor quick mesh/result plotting. - Extensible design: adapters for experiment data, telemetry hooks, series export, and structured configuration dataclasses to keep projects reproducible. Plug in your own experiment loaders or monitoring sinks without changing the engine.
Workflow
Most scripts declare experiment data, fitted parameters, FEB template bindings,
one or more simulation cases, and EngineOptions. Engine.run() then renders FEB
files, launches FEBio, reads .xplt outputs through adapters, assembles residuals
for SciPy, and records logs/artifacts.
Roadmap
- Extensively document the API (usage, configuration, and extension points).
- Add more examples for the
.xpltmodule, visualization, and optimization workflows. - Expand monitoring UI (history pagination, richer iteration drill-down, export).
- Strengthen test coverage and benchmarks across optimization and I/O paths.
- Harden packaging/release automation (semantic-release, CI/CD, PyPI publishing).
- Add CI matrices for multiple Python versions and check FEBio compatibility against the latest stable releases.
Project Info
- Source: https://gitlab.com/autrera-group/pyfebiopt/
- Issues: https://gitlab.com/autrera-group/pyfebiopt/-/issues
- License: MIT (see
LICENSE)
Quickstart
Tested on Ubuntu LTS (latest). Other platforms are untested.
-
Create an environment and install.
Python virtual environment:
python -m venv .venv source .venv/bin/activate python -m pip install --upgrade pipConda environment:
conda create -n pyfebiopt python=3.11 conda activate pyfebiopt python -m pip install --upgrade pipInstall the published package with pip:
pip install pyfebioptOr clone the repository and install from the local checkout:
git clone https://gitlab.com/autrera-group/pyfebiopt.git cd pyfebiopt pip install . -
Run a simple example:
python examples/simple_biaxial_fit.pyThis will execute a basic optimization and log progress. Adjust the example input paths to point at your FEBio files if needed.
-
Launch the monitoring UI (optional):
pyfebiopt-monitorFollow the printed URL to view live runs; the UI lists active runs, cost per iteration, series plots, and system metrics.
-
(Optional) Install the monitor as a service via the helper CLI:
# run ad-hoc with overrides pyfebiopt-monitorctl run --host 0.0.0.0 --port 8765 --registry /tmp/pyfebiopt-registry.json --socket /tmp/pyfebiopt.sock # install user-level systemd service (default host/port 127.0.0.1:8765) pyfebiopt-monitorctl install # install system-wide (needs sudo) with custom host/port sudo pyfebiopt-monitorctl install --system --host 0.0.0.0 --port 8000 --force # uninstall pyfebiopt-monitorctl uninstall # user sudo pyfebiopt-monitorctl uninstall --systemFlags:
--host,--port: bind address/port for the web UI.--registry: path to the run registry JSON.--socket: path to the event socket used by workers. Exposing the monitor publicly is your responsibility—use VPN/reverse proxy if needed.
Contributing
See CONTRIBUTING.md for coding standards, CI details, and hook setup tips.
Support
Open an issue at https://gitlab.com/autrera-group/pyfebiopt/-/issues with details about your environment, FEBio version, Python version, and minimal reproduction steps. Questions, bug reports, and feature requests are welcome.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyfebiopt-0.2.0.tar.gz.
File metadata
- Download URL: pyfebiopt-0.2.0.tar.gz
- Upload date:
- Size: 215.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73978d1f03ec4b1a685bfb2a775c4601c57e828229c7627246dfef7a376fee51
|
|
| MD5 |
2ccb369fe0eb0545402468361aa03d7e
|
|
| BLAKE2b-256 |
23e514f29b548c6e17ed7c1649cb15c0132f9f96458b6b5d264fdc3c8b55e68d
|
File details
Details for the file pyfebiopt-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pyfebiopt-0.2.0-py3-none-any.whl
- Upload date:
- Size: 126.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f704615d770e686304987934b868143d6e879f00621866d80ca26429a25756d7
|
|
| MD5 |
502492d078ff96b1e81615e7ac8c769b
|
|
| BLAKE2b-256 |
915116ba4b73601b3fa934346f815c91f761a9df8fc1016709c56ae841098bd6
|