Package: fenics-smart
Spatial Modeling Algorithms for Reaction-Transport [systems|models|equations]Statement of NeedSpatial 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 theFEniCS finite element library, provides a symbolic representation
framework for specifying reaction pathways, and supports large and irregular cell geometries in 2D and 3D.Documentation:https://rangamanilabucsd.github.io/smartSource code:https://github.com/RangamaniLabUCSD/smartInstallationUsing docker (recommended)The simplest way to usefenics-smartis to use the provided docker image. You can get this image by pulling it from the github registrydocker pull ghcr.io/rangamanilabucsd/smart:latestIt is also possible to pull a specific version by changing the tag, e.g.docker pull ghcr.io/rangamanilabucsd/smart:v2.0.1will use version 2.0.1.In order to start a container you can use thedocker runcommand. For example the commanddocker run --rm -v $(pwd):/home/shared -w /home/shared -ti ghcr.io/rangamanilabucsd/smart:latestwill run the latest version and share your current working directory with the container.
The source code of smart is located at/repoin the docker container.Running the example notebooksTo run the example notebooks, one can useghcr.io/rangamanilabucsd/smart-labdockerrun-ti-p8888:8888--rmghcr.io/rangamanilabucsd/smart-labto run interactively with Jupyter lab in browserConverting notebooks to Python filesIn thesmartandsmart-labimages, 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 runpython3examples/convert_notebooks_to_python.pyto convert all notebooks to python files.NOTEthis command overwrites existing files.Using pipfenics-smartis also available onpypiand can be installed withpython3 -m pip install fenics-smartHowever this requires FEniCS version 2019.2.0 or later to already be installed. Currently, FEniCS version 2019.2.0 needs to be builtfrom sourceor use some of thepre-built docker imagesExample usageThe SMART repository contains a number of examples in theexamplesdirectory which also run as continuous integration tests (see "Automated Tests" below):Example 1: Formation of Turing patterns in 2D reaction-diffusion (rectangular domain)Example 2: Simple cell signaling model in 2D (ellipse)Example 2 - 3D: Simple cell signaling model in 3D (realistic spine geometry)Example 3: Model of protein phosphorylation and diffusion in 3D (sphere)Example 4: Model of second messenger reaction-diffusion in 3D (ellipsoid-in-an-ellipsoid)Example 5: Simple cell signaling model in 3D (cube-in-a-cube)Example 6: Model of calcium dynamics in a neuron (sphere-in-a-sphere)Functionality documentationSMART is equipped to handle:Reaction-diffusion with any number of species, reactions, and compartments.3D-2D problems or 2D-1D problems; that is, you can solve a problem with many 3D sub-volumes coupled to many 2D sub-surfaces, or a problem with many 2D "sub-volumes" coupled to many 1D "sub-surfaces"Conversion of units at run-time viaPintso that models can be specified in whatever units are most natural/convenient to the user.Specification of a time-dependent function either algebraically or from data (SMART will numerically integrate the data points at each time-step).Customized reaction equations (e.g. irreversible Hill equation).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 usingMeshViews in parallel. However, SMART users can utilize MPI to run multiple simulations in parallel (one mesh per process), as demonstrated inExample 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 documentedhere.Our API documentation can be accessedhere.Automated testsUpon pushing new code to the SMART repository, a number of tests run:pre-commit tests.Installpre-commit:python3 -m pip install pre-commitRun pre-commit hooks:pre-commit run --allunit tests (can be found intestsfolder): test initialization of compartment, species, and parameter objects.Install test dependencies:python3 -m pip install fenics-smart[test]. Alternatively, if you have already installed SMART, you can installpytestandpytest-covusingpython3 -m pip install pytest pytest-cov.Run tests from the root of the repository:python3 -m pytestExamples 1-6: All 6 examples are run when building the docs. These serve as Contiuous Integration (CI) tests; within each run, there is a regression test comparing the output values from the simulation with values obtained from a previous build of SMART. Outputs from examples 2 and 3 are also compared to analytical solutions to demonstrate the accuracy of SMART simulations.Example 2 - 3DExample 3 with MPI: Example 3 is run using MPI to run differently sized meshes in parallel (each process is assigned a single mesh).Contributing guidelinesDetailed contributing guidelines are givenhere.DependenciesSMART usesFEniCSto assemble finite element matrices from the variational formSMART uses [PETSc4py] to solve the resultant linear algebra systems.SMART usespandasas an intermediate data structure to help organize and process models.SMART usesPintfor unit tracking and conversions.SMART usesmatplotlibto generate plots in examplesSMART usessympyto allow users to input custom reactions and also to determine the appopriate solution techniques (e.g. testing for non-linearities).SMART usesnumpyandscipyfor general array manipulations and basic calculations.SMART usestabulateto make ASCII tables.SMART usestermcolorfor colored terminal output.LicenseLGPL-3.0SMART development teamJustin Laughlin- original author of the repositoryChristopher LeeEmmet FrancisJorgen DokkenHenrik FinsbergPrevious contributors:Yuan GaoWilliam Xu