Science Score: 67.0%

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

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.1%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Basic Info
Statistics
  • Stars: 1
  • Watchers: 3
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created over 4 years ago · Last pushed about 2 years ago
Metadata Files
Readme Citation

README.md

DOI

Cardiac benchmark

This is the contribution to the cardiac mechanics benchmark from Simula Research Laboratory

Installation

Docker (recommended)

Run the following command to start the container interactively and mount the current directory docker run --rm -v $PWD:/home/shared -w /home/shared -it ghcr.io/finsberg/cardiac_benchmark:latest This should spin up a container with everything installed. You will also find the Dockerfile used for creating this image in this repo.

Conda

Create the conda environment using the environment.yml file conda env create -f environment.yml Activate the environment conda activate cardiac-benchmark and finally install the cardiac-benchmark package (from the root of the repository) python3 -m pip install .

Note for M1 Mac

FEniCS is currently not available through conda for M1 mac (unless you use Rosetta 2). If you are using M1 mac then you can use the provided docker image.

For developers

Developers should also install the pre-commit hook

python -m pip install pre-commit pre-commit install

Quick start

Get the geometry

Before running the benchmark you need to first get a geometry. For benchmark 1 you can either use the provided geometry or create your own. To create your own geometry you can do

cardiac-benchmark create-geometry lv_ellipsoid.h5 which will save the geometry together with the fibers in a file called lv_ellipsoid.h5. You can also specify the mesh resolution and the fiber angles see cardiac-benchmark create-geometry --help for more info. Note that this requires fenics and gmsh to be be installed. To get this you can e.g use the fenics-gmsh docker image that we have created here: https://github.com/scientificcomputing/packages/pkgs/container/fenics-gmsh

To use the provided benchmark you first need to download the files to a folder. For benchmark 1 you can download the data to a folder called data_benchmark1 using the following command cardiac-benchmark download-data-benchmark1 --fiber-space=P2 --outdir=data_benchmark1 Here we also specify which space to use for the fibers (P1 or P2). Next we need to convert all the files to a single file containing both the mesh, markers and the microstructure using the command cardiac-benchmark convert-data-benchmark1 data_benchmark1 --outpath="lv_ellipsoid.h5" This will also generate some files in the same folder that can be visualized in paraview. You can use the same procedure to download the data for benchmark 2, e.g cardiac-benchmark download-data-benchmark2 coarse --outdir=data_coarse and cardiac-benchmark convert-data-benchmark2 data_benchmark2_coarse --outpath="biv_ellipsoid_coarse.h5" However, note that here we need to specify whether we want the fine or coarse resolution.

Running the benchmark

You can run the command line interface directly, e.g cardiac-benchmark benchmark1-step1 To see all steps that you can run, do cardiac-benchmark --help and to see the specific options for a given step you can do (for e.g step1) cardiac-benchmark benchmark1-step1 --geometry-path="lv_ellipsoid.h5" It is also possible to run the scripts using python3 -m cardiac-benchmark --help if you prefer that.

You can also use the python API ```python import cardiac_benchmark

cardiacbenchmark.benchmark1.run(geometrypath="lv_ellipsoid.h5") ``` which by default will run benchmark 1 - step 1.

Options

  • Create geometry for benchmark 1 (save lv ellipsoidal geometry to lv_ellipsoid.h5). Note: requires gmsh cardiac-benchmark create-geometry lv_ellipsoid.h5
  • Download provided for benchmark 1 to a folder called data_benchmark1 with P2 fibers cardiac-benchmark download-data-benchmark1 --fiber-space=P2 --outdir=data_benchmark1
  • Convert data for benchmark1 with P2 fiber space into a single file and files to be viewed in Paraview cardiac-benchmark convert-data-benchmark1 data_benchmark1 --outpath="lv_ellipsoid.h5"
  • Run benchmark 1 step 0 case A cardiac-benchmark benchmark1-step0 a --geometry-path="lv_ellipsoid.h5"
  • Run benchmark 1 step 0 case B cardiac-benchmark benchmark1-step0 b --geometry-path="lv_ellipsoid.h5"
  • Run benchmark 1 step 1 cardiac-benchmark benchmark1-step1 --geometry-path="lv_ellipsoid.h5"
  • Run benchmark 1 step 2 case A cardiac-benchmark benchmark1-step2 a --geometry-path="lv_ellipsoid.h5"
  • Run benchmark 1 step 2 case B cardiac-benchmark benchmark1-step2 b --geometry-path="lv_ellipsoid.h5"
  • Run benchmark 1 step 2 case C cardiac-benchmark benchmark1-step2 c --geometry-path="lv_ellipsoid.h5"
  • Download coarse data for benchmark 2 to a folder called data_coarse cardiac-benchmark download-data-benchmark2 coarse --outdir=data_coarse
  • Download fine data for benchmark 2 to a folder called data_fine cardiac-benchmark download-data-benchmark2 fine --outdir=data_fine
  • Convert data for benchmark 2 into a single file and files to be viewed in Paraview cardiac-benchmark convert-data-benchmark2 data_benchmark2_coarse --outpath="biv_ellipsoid_coarse.h5"
  • Run benchmark 2 with fine data cardiac-benchmark benchmark2 --geometry-path="biv_ellipsoid_coarse.h5"

License

MIT

Citing

@software{Finsberg_A_software_benchmark_2024, author = {Finsberg, Henrik and Sundnes, Joakim}, doi = {10.5281/zenodo.10875818}, month = mar, title = {{A software benchmark for cardiac elastodynamics}}, url = {https://github.com/finsberg/cardiac_benchmark.}, version = {1.0.0}, year = {2024} }

Authors

  • Henrik Finsberg (henriknf@simula.no)
  • Joakim Sundnes (sundnes@simula.no)

Owner

  • Name: Henrik Finsberg
  • Login: finsberg
  • Kind: user
  • Location: Oslo, Norway
  • Company: Simula Research Laboratoy

Senior Research Engineer working with Scientific Computing and Computational Physiology

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Finsberg"
  given-names: "Henrik"
  orcid: "https://orcid.org/0000-0003-3766-2393"
- family-names: "Sundnes"
  given-names: "Joakim"
title: "A software benchmark for cardiac elastodynamics"
version: "1.0.0"
date-released: 2024-03-13
url: "https://github.com/finsberg/cardiac_benchmark."
doi: 10.5281/zenodo.10875818

GitHub Events

Total
  • Watch event: 1
  • Fork event: 1
Last Year
  • Watch event: 1
  • Fork event: 1

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 2
  • Total pull requests: 41
  • Average time to close issues: about 2 hours
  • Average time to close pull requests: 2 days
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.05
  • Merged pull requests: 39
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: about 3 hours
  • Average time to close pull requests: about 2 hours
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 3.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Reidmen (1)
Pull Request Authors
  • finsberg (24)
Top Labels
Issue Labels
Pull Request Labels

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/docker-image.yml actions
  • actions/checkout v3 composite
  • docker/build-push-action v3 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/tests.yml actions
  • actions/checkout v3 composite
docker/Dockerfile docker
  • ghcr.io/scientificcomputing/fenics-gmsh 2023-04-21 build
pyproject.toml pypi
  • h5py *
  • importlib-metadata python_version < '3.8'
  • matplotlib *
  • meshio *
  • numpy *
  • rich *
  • scipy *
  • typer >=0.9.0
environment.yml conda
  • fenics 2019.1.0
  • h5py 3.3.0
  • matplotlib 3.5.0
  • meshio 5.0.4
  • numpy 1.21.4
  • pip 21.3.1
  • python 3.9.7
  • python-gmsh 4.8.4
  • rich 13.1.0
  • scipy 1.7.3
  • typer 0.9.0