Metadata-Version: 2.4
Name: ambit-fe
Version: 2026.1.0
Summary: A FEniCS-based cardiovascular multi-physics solver
Author-email: Marc Hirschvogel <marc.hirschvogel@ambit.net>
License: MIT License
        
        Copyright (c) 2026 Marc Hirschvogel
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/marchirschvogel/ambit
Project-URL: Bug Tracker, https://github.com/marchirschvogel/ambit/issues
Keywords: finite elements,solid mechanics,fluid mechanics,fluid-solid interaction,fsi,0D models,3D-0D coupling,monolithic,lumped-parameter models,model reduction,heart,circulation,cardiac
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mpmath
Requires-Dist: sympy
Requires-Dist: h5py
Requires-Dist: pytest
Dynamic: license-file

# README #

[![DOI](https://joss.theoj.org/papers/10.21105/joss.05744/status.svg)](https://doi.org/10.21105/joss.05744)

Ambit is an open-source multi-physics finite element solver written in Python, supporting solid and fluid mechanics, fluid-structure interaction (FSI), and lumped-parameter models.
It is tailored towards solving problems in cardiac mechanics, but may also be used for more general nonlinear finite element analysis. It uses the finite element backend FEniCSx and
linear algebra library PETSc.

https://github.com/user-attachments/assets/6a8a1f96-066d-4c68-a71e-b65ecf12d4da

**Fully coupled 3D fluid-structure interaction simulation (~3M dofs) in a patient-specific 4-chamber heart coupled to a closed-loop circulation model.**

https://github.com/marchirschvogel/ambit/assets/52761273/8e681cb6-7a4f-4d1f-b34a-cefb642f44b7

**FSI simulation (Turek benchmark, FSI2 case) of an elastic flag in incompressible channel flow.**

The following is supported:

* Solid mechanics
  - Finite strain elastodynamics, implementing a range of hyperelastic isotropic and anisotropic as well as viscous constitutive laws
  - Active stress for modeling of cardiac contraction mechanics
  - Quasi-static, generalized-alpha, or one-step theta time integration
  - Nearly incompressible as well as fully incompressible formulations
  - Inverse mechanics formulations for recovery of a stress-free reference configuration, and a so-called prestressing method (MULF)
  - Volumetric growth & remodeling: Prescribed, strain-, and stress-mediated growth
* Fluid dynamics
  - Incompressible Navier-Stokes/Stokes equations, either in nonconservative or conservative formulation
  - Navier-Stokes/Stokes flow in an Arbitrary Lagrangian Eulerian (ALE) reference frame
  - Cahn-Hilliard-Navier-Stokes equations (Eulerian or ALE) for multiphase flow
  - BDF2, one-step theta, or generalized-alpha time integration
  - SUPG/PSPG stabilization for equal-order approximations of velocity and pressure
* Scalar transport
  - Supports n scalar transport equations, either in Eulerian or ALE reference frame
  - Coupling between the individual equations provided by special constitutive laws or easily extensible by user
  - Can be hooked to any solid mechanics problem (fluid coupling to be implemented)
* Lumped (0D) models
  - Systemic and pulmonary circulation flow models
  - 2-element as well as 4-element Windkessel models
  - Signalling network model
* Coupling of different physics:
  - Fluid-solid interaction (FSI): Monolithic FSI in ALE formulation, single- or multiphase fluid
  - Monolithic coupling of 3D solid/fluid/ALE-fluid and FSI with lumped 0D flow models
  - Multiscale-in-time analysis of growth & remodeling (staggered solution of 3D-0D coupled solid-flow0d and G&R solid problem)
* Fluid-reduced-solid interaction (FrSI)
  - Boundary subspace-projected physics-reduced solid model (incl. hyperelastic, viscous, and active parts) in an ALE fluid reference frame
* POD-based model order reduction (MOR)
  - Projection-based model order reduction applicable to main fluid or solid field (also in a coupled problem), by either projecting
    the full problem or a boundary to a lower dimensional subspace spanned by POD modes

- author: Dr.-Ing. Marc Hirschvogel, marc.hirschvogel@ambit.net

Still experimental / to-do:

- Finite strain plasticity / sophisticated solid constitutive models beyond hyperelasticity
- Electrophysiology
- ... whatever might be wanted in some future ...

### Documentation ###

Documentation can be viewed at https://ambit.readthedocs.io

### Installation ###

In order to use Ambit, you need to [install FEniCSx](https://github.com/FEniCS/dolfinx#installation)

Latest Ambit-compatible dolfinx release version: v0.11.0.post0\
Latest tested Ambit-compatible dolfinx development version: to be tested...

Ambit can then be installed using pip, either the current release
```
python3 -m pip install ambit-fe
```

or latest development version:
```
python3 -m pip install git+https://github.com/marchirschvogel/ambit.git
```

Alternatively, you can pull a pre-built Docker image with FEniCSx and Ambit installed:
```
docker pull ghcr.io/marchirschvogel/ambit:latest
```

If a Docker image for development is desired, the following image contains all dependencies needed to install and run Ambit:
```
docker pull ghcr.io/marchirschvogel/ambit:devenv
```

### Usage ###

Check out the examples for the basic problem types in demos/ to quickly get started running solid, fluid, or 0D model problems. Further, you can have a look
at input files in tests/ and the file ambit_template.py in the main folder as example of all available input options.


Best, check if all testcases run and pass, by navigating to tests/ and executing
```
./runtests.py
```

Build your input file and run it with the command
```
mpiexec -n <NUMBER_OF_CORES> python3 your_file.py
```

### References ###

Software paper:

* Hirschvogel M. **Ambit – A FEniCS-based cardiovascular multi-physics solver.** *Journal of Open Source Software,* 9(93), 2024, DOI: https://doi.org/10.21105/joss.05744

Papers explicitly using and citing Ambit:

* Hirschvogel M, Bonini M, Balmus M, Nordsletten D. **Effective Block Preconditioners for Fluid Dynamics Coupled to Reduced Models of a Non-Local Nature.** *Computer Methods in Applied Mechanics and Engineering,* 435, 2025, DOI: https://doi.org/10.1016/j.cma.2024.117541
* Aróstica R, Nolte D, Brown A, Gebauer A, Karabelas E, Jilberto J, Salvador M, Bucelli M, Piersanti R, Osouli K, Augustin C, Finsberg H, Shi L, Hirschvogel M, Pfaller M, Africa PC, Gsell M, Marsden A, Nordsletten D, Regazzoni F, Plank G, Sundnes J, Dede' L, Peirlinck M, Vedula V, Wall WA, Bertoglio C. **A software benchmark for cardiac elastodynamics.** *Computer Methods in Applied Mechanics and Engineering,* 435, 2025, DOI: https://doi.org/10.1016/j.cma.2024.117485
