RangamaniLabUCSD / smart

https://rangamanilabucsd.github.io/smart/
GNU Lesser General Public License v3.0
7 stars 4 forks source link

Test fenics_smart PyPI Deploy static content to Pages pre-commit DOI DOI

Spatial Modeling Algorithms for Reaction-Transport [systems|models|equations]

Statement of Need

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.

Installation

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.

Using docker (recommended)

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.

Running the example notebooks

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

Converting notebooks to Python files

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.

Using pip

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

Example usage

The SMART repository contains a number of examples in the examples directory which also run as continuous integration tests (see "Automated Tests" below):

Functionality documentation

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 MeshViews 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.

Automated tests

Upon pushing new code to the SMART repository, a number of tests run:

Contributing guidelines

Detailed contributing guidelines are given here.

Dependencies

License

LGPL-3.0

SMART development team

Previous contributors: