SMART

SMART: Spatial Modeling Algorithms for Reactions and Transport - Published in JOSS (2023)

https://github.com/rangamanilabucsd/smart

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 7 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
    3 of 11 committers (27.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Mathematics Computer Science - 46% confidence
Earth and Environmental Sciences Physical Sciences - 40% confidence
Last synced: 4 months ago · JSON representation

Repository

Spatial Modeling Algorithms for Reactions and Transport

Basic Info
Statistics
  • Stars: 9
  • Watchers: 3
  • Forks: 3
  • Open Issues: 21
  • Releases: 21
Created over 6 years ago · Last pushed 5 months ago
Metadata Files
Readme Contributing License

README.md

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.

  • Documentation: https://rangamanilabucsd.github.io/smart
  • Source code: https://github.com/RangamaniLabUCSD/smart

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 bash 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 bash 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): * 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 documentation

SMART 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 via Pint so 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 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: * pre-commit tests. - Install pre-commit: python3 -m pip install pre-commit - Run pre-commit hooks: pre-commit run --all * unit tests (can be found in tests folder): 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 install pytest and pytest-cov using python3 -m pip install pytest pytest-cov. - Run tests from the root of the repository: python3 -m pytest * Examples 1-6: All 6 examples are run when building the docs. These serve as Continuous 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 - 3D * Example 3 with MPI: Example 3 is run using MPI to run differently sized meshes in parallel (each process is assigned a single mesh).

Contributing guidelines

Detailed contributing guidelines are given here.

Dependencies

  • SMART uses FEniCS to assemble finite element matrices from the variational form
  • SMART uses [PETSc4py] to solve the resultant linear algebra systems.
  • SMART uses pandas as an intermediate data structure to help organize and process models.
  • SMART uses Pint for unit tracking and conversions.
  • SMART uses matplotlib to generate plots in examples
  • SMART uses sympy to allow users to input custom reactions and also to determine the appopriate solution techniques (e.g. testing for non-linearities).
  • SMART uses numpy and scipy for general array manipulations and basic calculations.
  • SMART uses tabulate to make ASCII tables.
  • SMART uses termcolor for colored terminal output.

License

LGPL-3.0

SMART development team

Previous contributors: * Yuan Gao * William Xu

Owner

  • Name: RangamaniLabUCSD
  • Login: RangamaniLabUCSD
  • Kind: organization
  • Location: San Diego, CA

Laboratory for Computational Cellular Mechanobiology

JOSS Publication

SMART: Spatial Modeling Algorithms for Reactions and Transport
Published
October 19, 2023
Volume 8, Issue 90, Page 5580
Authors
Justin G. Laughlin ORCID
Department of Mechanical and Aerospace Engineering, University of California San Diego, La Jolla, CA, United States of America
Jørgen S. Dokken ORCID
Department of Numerical Analysis and Scientific Computing, Simula Research Laboratory, Oslo, Norway
Henrik N.t. Finsberg ORCID
Department of Computational Physiology, Simula Research Laboratory, Oslo, Norway
Emmet A. Francis ORCID
Department of Mechanical and Aerospace Engineering, University of California San Diego, La Jolla, CA, United States of America
Christopher T. Lee ORCID
Department of Mechanical and Aerospace Engineering, University of California San Diego, La Jolla, CA, United States of America
Marie E. Rognes ORCID
Department of Numerical Analysis and Scientific Computing, Simula Research Laboratory, Oslo, Norway
Padmini Rangamani ORCID
Department of Mechanical and Aerospace Engineering, University of California San Diego, La Jolla, CA, United States of America
Editor
Kevin M. Moerman ORCID
Tags
FEniCS reactions transport biophysics cellular processes

GitHub Events

Total
  • Release event: 6
  • Watch event: 2
  • Issue comment event: 4
  • Push event: 18
  • Pull request event: 2
  • Pull request review event: 16
  • Pull request review comment event: 19
  • Create event: 9
Last Year
  • Release event: 6
  • Watch event: 2
  • Issue comment event: 4
  • Push event: 19
  • Pull request event: 3
  • Pull request review event: 16
  • Pull request review comment event: 19
  • Create event: 9

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 723
  • Total Committers: 11
  • Avg Commits per committer: 65.727
  • Development Distribution Score (DDS): 0.658
Past Year
  • Commits: 16
  • Committers: 1
  • Avg Commits per committer: 16.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
justinlaughlin j****n@g****m 247
emmetfrancis e****s@g****m 224
Henrik Finsberg h****g@h****m 128
Jørgen S. Dokken d****n@s****o 77
Rabona17 y****o@u****u 14
Marie E. Rognes m****g@s****o 11
Christopher T. Lee c****e@u****u 8
willxu1234 w****u@u****u 6
Justin Laughlin j****n@u****l 5
Justin Laughlin j****n@u****1 2
JJ 1****l 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 25
  • Total pull requests: 104
  • Average time to close issues: 5 months
  • Average time to close pull requests: 27 days
  • Total issue authors: 7
  • Total pull request authors: 8
  • Average comments per issue: 1.4
  • Average comments per pull request: 0.63
  • Merged pull requests: 92
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 month
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • finsberg (7)
  • emmetfrancis (5)
  • justinlaughlin (4)
  • jorgensd (3)
  • mbarzegary (3)
  • oalii (2)
  • meg-simula (1)
Pull Request Authors
  • emmetfrancis (53)
  • finsberg (36)
  • jorgensd (10)
  • justinlaughlin (1)
  • Rabona17 (1)
  • meg-simula (1)
  • computerscienceiscool (1)
  • ctlee (1)
Top Labels
Issue Labels
enhancement: non-critical (3) bug (1) wontfix (1) documentation (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 273 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 17
  • Total maintainers: 2
pypi.org: fenics-smart

Spatial Modeling Algorithms for Reactions and Transport (SMART) is a high-performance finite-element-based simulation package for model specification and numerical simulation of spatially-varying reaction-transport processes in biological cells.

  • Documentation: https://fenics-smart.readthedocs.io/
  • License: GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. “The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.
  • Latest release: 2.3.0
    published 6 months ago
  • Versions: 17
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 273 Last month
Rankings
Dependent packages count: 7.2%
Average: 21.0%
Dependent repos count: 34.8%
Maintainers (2)
Last synced: 4 months ago

Dependencies

.github/workflows/build_docs.yml actions
  • actions/checkout v3 composite
  • actions/configure-pages v2 composite
  • actions/deploy-pages v1 composite
  • actions/upload-pages-artifact v1 composite
.github/workflows/deploy_docs.yml actions
  • actions/checkout v4 composite
  • actions/configure-pages v3 composite
  • actions/deploy-pages v2 composite
  • actions/download-artifact v3 composite
  • actions/upload-pages-artifact v1 composite
.github/workflows/docker-image.yml actions
  • actions/checkout v4 composite
  • docker/build-push-action v4 composite
  • docker/login-action v2 composite
  • docker/metadata-action v4 composite
  • docker/setup-buildx-action v2 composite
  • docker/setup-qemu-action v2 composite
.github/workflows/draft-pdf.yml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v1 composite
  • openjournals/openjournals-draft-action master composite
.github/workflows/pre-commit.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
.github/workflows/pypi.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/run_examples_mpi.yml actions
  • actions/checkout v4 composite
.github/workflows/test_fenics_smart.yml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v3 composite
Dockerfile docker
  • ghcr.io/scientificcomputing/fenics-gmsh 2023-08-16 build
  • smart_base latest build
pyproject.toml pypi
  • Pint *
  • cached-property *
  • dataclasses *
  • numpy >=1.16.0
  • pandas *
  • scipy >=1.1.0
  • sympy *
  • tabulate *
  • termcolor *
  • termplotlib *