Spatial Modeling Algorithms for Reactions and Transport (SMART) is a finite-element-based simulation package for model specification and numerical simulation of spatially-varying reaction-transport processes, especially tailored to modeling such systems within biological cells. SMART is based on the FEniCS finite element library, provides a symbolic representation framework for specifying reaction pathways, and supports large and irregular cell geometries in 2D and 3D.
SMART has been installed and tested on Linux for AMD, ARM, and x86_64 systems, primarily via Ubuntu 20.04 or 22.04. On Windows devices, we recommend using Windows Subsystem for Linux to run the provided docker image (see below). SMART has also been tested on Mac OS using docker. Installation using docker should take less than 30 minutes on a normal desktop computer.
The simplest way to use fenics-smart
is to use the provided docker image. You can get this image by pulling it from the github registry
docker pull ghcr.io/rangamanilabucsd/smart:latest
It is also possible to pull a specific version by changing the tag, e.g.
docker pull ghcr.io/rangamanilabucsd/smart:v2.0.1
will use version 2.0.1.
In order to start a container you can use the docker run
command. For example the command
docker run --rm -v $(pwd):/home/shared -w /home/shared -ti ghcr.io/rangamanilabucsd/smart:latest
will run the latest version and share your current working directory with the container.
The source code of smart is located at /repo
in the docker container.
To run the example notebooks, one can use ghcr.io/rangamanilabucsd/smart-lab
docker run -ti -p 8888:8888 --rm ghcr.io/rangamanilabucsd/smart-lab
to run interactively with Jupyter lab in browser
In the smart
and smart-lab
images, these files exist under /repo/examples/**/example*.py
.
If you clone the git repository or make changes to the notebooks that should be reflected in the python files, you can run
python3 examples/convert_notebooks_to_python.py
to convert all notebooks to python files. NOTE this command overwrites existing files.
fenics-smart
is also available on pypi and can be installed with
python3 -m pip install fenics-smart
However this requires FEniCS version 2019.2.0 or later to already be installed. Currently, FEniCS version 2019.2.0 needs to be built from source or use some of the pre-built docker images
The SMART repository contains a number of examples in the examples
directory which also run as continuous integration tests (see "Automated Tests" below):
SMART is equipped to handle:
The current version of SMART is not compatible with MPI-based mesh parallelization; this feature is in development pending a future release of DOLFIN addressing some issues when using MeshView
s in parallel. However, SMART users can utilize MPI to run multiple simulations in parallel (one mesh per process), as demonstrated in Example 3 with MPI.
The general form of the mixed-dimensional partial differential equations (PDEs) solved by SMART, along with mathematical details of the numerical implementation, are documented here.
Our API documentation can be accessed here.
Upon pushing new code to the SMART repository, a number of tests run:
pre-commit
: python3 -m pip install pre-commit
pre-commit run --all
tests
folder): test initialization of compartment, species, and parameter objects.
python3 -m pip install fenics-smart[test]
. Alternatively, if you have already installed SMART, you can install pytest
and pytest-cov
using python3 -m pip install pytest pytest-cov
.python3 -m pytest
Detailed contributing guidelines are given here.
LGPL-3.0
Previous contributors: