Giter Site home page Giter Site logo

cardiac_benchmark_toolkit's Introduction

MIT Black

Cardiac Benchmark Toolkit

This repository contains basic scripts that allow you to reproduce the mesh as well as the fibers in the cardiac mechanics benchmark in dolfin (legacy).

For the dolfinx implementation of the tools, check here

fiber_directions

Installation

Docker (Recommended) Run the following command to start a container with all the required dependencies:

docker run --name dolfin-stable -v $(pwd):/home/shared -w /home/shared -ti ghcr.io/scientificcomputing/fenics-gmsh:2023-04-21

In order to enter the shell, use:

docker exec -ti dolfin-stable /bin/bash -l

Note docker image is courtesy of Simula Lab.

Local Installation

If your system has already fenics version 2019.1.0.post0, you can install this package typing:

pip3 install .

Quickstart

To have an overview of the options available through this package, execute it your terminal

cardiac-benchmark-toolkit --help

It the installation was succesfull you should be prompted with the following: prompt-help

Mesh Generation

Ellipsoid domain

The ellipsoid domain can be created with a characteristic element size (default is 0.005 [m]) using the script mesh_generation.py. It will create a folder structure ./results to stores xdmf as well as pvd formats for further usage.

To execute it, consider the following command:

cardiac-benchmark-toolkit create-ellipsoid --char-length 0.007

Its command details can be seen with:

cardiac-benchmark-toolkit create-ellipsoid --help

prompt-ellipsoid-help

It will create an ellipsoid mesh with characteristic element size of 0.007 [m]. You can use it in conjuntion with the ellipsoid_fiber_generation to create the fiber directions for your specific simulation (and benchmark).

Examples of mesh at two different element sizes can be seen below: comparison-meshes

Biventricular domain

The biventricular domain is provided in the ./data/ including source files in vtk, pvd for fine and coarse sizes. Example of a fine geometry is depicted below: biventricular-fine

Ellipsoid Fiber Generation

This repository provides a tagged ellipsoid geometry for reference purposes in the folder ./data/monoventricle_mesh/. Using the mesh ./monoventricle_mesh/ellipsoid_0.005.xdmf, you can create the fibers as follows:

cardiac-benchamrk-toolkit create-fibers-for-ellipsoid-mesh ./monoventricle_mesh/ellipsoid_0.005.xdmf

If succesfull, the script will create fibers in xdmf and vtk files in a ./results/ folder.

Further options can be found with:

cardiac-benchmark-toolkit create-fibers-for-ellipsoid-mesh --help

Biventricular Fiber Generation (LifeX -> FEniCS)

Reference fibers created using the lifex can be found in the subfolder in ./data/ as fiber_biv.vtk. This repository includes options to generate FEniCS-compatible h5 format for fiber directions.

To crate fibers for the fine mesh in P2, run in your shell:

cardiac-benchmark-toolkit create-biv-domain-from-mesh-and-fibers data/biv_mesh_and_fibers_fine_p2/ --element_degree 2

The command line above will create fiber, sheet and sheet-normal directions from the vtk source files in ./data/biv_mesh_and_fibers_fine_p2.

Depicted below are fiber (left) and sheet (right) directions created from this procedure. fiber-sheet-biv

cardiac_benchmark_toolkit's People

Contributors

reidmen avatar

Watchers

David avatar  avatar

cardiac_benchmark_toolkit's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.