Skip to content

About

Focused port of GPU-accelerated, differentiable biomechanics in warp-python

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

FEBio-Warp-Python

GPU-accelerated, differentiable finite element mechanics for cardiovascular simulation, written in Python on Warp and built in concert with the FEBio team. The formulations follow FEBio. The architecture is designed for the GPU and for differentiation, follows the development conventions of Warp, and is meant to work with Newton, 3D Slicer and SlicerHeart.

FEBio-Warp is intended to stand next to FEBio, not to replace it. FEBio remains the place for broad constitutive modeling and general biomechanics. FEBio-Warp targets a focused set of applications where speed and gradients matter.

Project status

This project is at an early stage. Interfaces will change, and most areas listed below are in design or draft. Nothing here is released.

Development has now moved to a design-led process. Each area is specified in a design note, reviewed by the developers involved, implemented, and verified against FEBio reference problems where one exists. The pilot work is preserved in pilots/ and at the pilot-2026-11 tag.

Driving applications

The first targets set the scope. Capabilities are added because one of these needs them.

Application Needs
Atrioventricular valve closure and repair Quadrilateral shell leaflets, fiber-reinforced hyperelastic tissue, chordae as trusses or springs, pressure loading, leaflet self-contact
Self-expanding nitinol devices (transcatheter pulmonary valve replacement, septal occluders) Beam frames, nitinol material, device-to-vessel contact, hyperelastic vessel wall
Patch and material verification problems Small problems with known or FEBio reference solutions, used to verify each component

Development areas

Status as of November 26, 2026. "Draft" means code exists in a draft pull request and is under review. "Template" means a first working shape exists in the run path draft (PR #6), checked against FEBio on small cases and not settled. "Design" means a design note exists, with a flow diagram, a proposed approach, what has been explored and the decision points for the team, and no code. No application input runs end to end yet.

Start with the design overview for how the pieces fit, remaining areas for what is left and the decisions listed by reviewer, and the work plan for what has to be agreed first and which work packages can then be built in parallel. Until the drafts merge, these notes are on the branch of PR #6.

Area Package Scope for the first targets Status
Materials materials/ Common material interface; neo-Hookean, HGO, Ogden, Lee-Sacks, nitinol Draft (PR #2), under redesign. Design: material interface (decisions)
Contact contact/ Potential-based contact for leaflets and devices; sliding contact later Draft (PR #1). Design: contact potential (decisions), contact in a run (decisions)
Assembly assembly/ Full assembly of residual and tangent on the GPU Decided (note). Template: one block buffer and pattern map
Elements elements/ Shells, solids, trusses, springs, beams Template: hex8, tet4, quad4 shell. Design: trusses and springs for chordae (decisions), then three-field solid, penta6, tri3 shell (decisions). Beams: design shell
Mesh and discretization mesh/, discretization/ Mesh types, degree-of-freedom maps, quadrature Template: unknowns by (node, variable) (run path). The mesh is in the central model
Loads and constraints loads/, constraints/ Follower pressure, nodal loads, prescribed and multipoint constraints Template: pressure, fixed and prescribed displacements. Design: mass damping, normal displacement (decisions)
Solvers solvers/ Newton with line search; iterative linear solvers and preconditioners Template: full Newton, Warp's iterative solvers. Design: preconditioning for shells, line search, quasi-Newton (decisions)
Analysis analysis/ Static and implicit dynamic steps, load stepping, staged procedures Template: one static step with FEBio's time stepper (run path (decisions)) (PR #6). Design: dynamics and several steps (decisions)
Sensitivity sensitivity/ Gradients through equilibrium and through trajectories Template: adjoint through one equilibrium solve. Design: adjoints over steps (decisions)
Central model, input and output model/, io/ One model object holding what a FEBio input defines; FEBio input (.feb) and plot (.xplt) files read and written here; VTKHDF output and a VTK adapter for 3D Slicer Draft (PR #5). Design: model, input and output (decisions), output registry (decisions)
Verification tests/, references/ FEBio-Warp run on FEBio input files and compared with pinned FEBio references; cases from the FEBio test suite and the driving applications Draft (PR #4), tabled until input and output. Design: comparison with FEBio (decisions)

Design notes live in docs/design/.

Testing uses the FEBio test suite first, then the open models in the FEBio model repository user projects, with small generated inputs only where neither has a case that fits. The pilot examples are not test targets.

The four drafts are reviewed separately. They are also merged, and made consistent where they meet, on the branch mattjolley/integration-base; its note docs/design/integration.md says what that involved and what is left open.

Relation to FEBio's structure

The package layout under src/warp_febio/ follows FEBio's separation of concerns.

FEBio-Warp FEBio counterpart
mesh/, discretization/ FECore mesh, degrees of freedom, element traits
elements/ FEBioMech domains
materials/ FEBioMech materials
loads/, constraints/, contact/ FEBioMech loads, constraints and contact interfaces
assembly/, solvers/ FECore solver interfaces, NumCore linear solvers
analysis/ FECore analysis steps
io/ FEBioXML, FEBioPlot
sensitivity/ Added here

How code enters the package

  1. A design note in docs/design/ states the formulation, the FEBio source it follows, and how it will be verified.
  2. A draft pull request implements it and is reviewed.
  3. It is verified against FEBio reference problems where one exists, in double precision.

Exploratory work is welcome and belongs in pilots/ until it has been through these steps. See CONTRIBUTING.md.

Pilot work

The initial prototypes were contributed by @aslanseda9: an explicit membrane patch solver, Lee-Sacks and neo-Hookean material-point functions, and a solid elasticity check built on warp.fem. They were written to explore the approach, not as verified implementations, and each one lists what it does and does not establish. They remain available and runnable in pilots/. They are not maintained and are not a dependency of the package.

The FEBio inputs and results assembled during the pilot phase are kept in references/febio/. They will be reviewed for inclusion in the verification harness and should not be read as verified benchmarks until then.

Install

The project uses uv for environments and Ruff for linting and formatting, as Warp does.

uv sync --extra dev
uv run -m unittest discover -s tests -v

uv sync creates .venv with the versions recorded in uv.lock. Python 3.11 or later; 3.12 is the tested version and the one uv selects from .python-version. Warp is pinned to 1.19.0; see the Warp installation guide.

A plain pip install -e . in a virtual environment also works. See CONTRIBUTING.md for formatting and the pre-commit hooks.

Acknowledgments

FEBio-Warp builds on the formulations, documentation and test suites of FEBio, developed at the University of Utah, and on Warp.

License

FEBio-Warp-Python is released under the Apache License 2.0, the same license as Warp. Contributions are accepted under the same terms.

FEBio is distributed separately under the MIT license. Material in this repository that derives from FEBio, including the reference inputs under references/febio/, keeps its attribution to the FEBio project.

About

Focused port of GPU-accelerated, differentiable biomechanics in warp-python

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages