Skip to content

Solves the Monodomain Equation on a Purkinje fiber by using the Finite Volume Method.

Notifications You must be signed in to change notification settings

bergolho1337/Purkinje-Microscopic-MVF

Repository files navigation

Purkinje-Microscopic-MVF

Solve the monodomain equation using Finite Volume Method.

Monodomain equation

The project is divided in 4 parts.

  • Skeleton_Mesh
  • Mesh_Generator
  • Pk-Noble
  • Pk-LiRudy

Skeleton_Mesh

  • PURPOSE: Build the skeleton for the network mesh.
  • INPUT: Length of the fiber
  • INPUT: Number of fibers leaving a bifurcation
  • INPUT: Type of network
  • INPUT: Name of the output file
  • The output file is using the .vtk extension.
  • To visualize the structure open the output file using Paraview
  • There are 3 types of network that could be generated:
    • Fiber with a bifurcation at the endpoints (Type 1);
    • Fiber with iterative growth (Type 2);
    • Fiber with iterative growth and angle control (Type 3).
  • For the Type 2 and 3 network the maximum number of iterations and angle control can be adjusted by the variables MAX_ITER and ANG, respectevely.

Build and execute

$ make
$ ./skeletonMesh <xMax> <biff> <type> <out_VTK_file>

Example

$ ./skeletonMesh 1.0 2 3 example.vtk

This example will build a network of type 3 with two segments leaving each bifurcation and a fiber length of 1cm.

Generated network

Mesh_Generator

  • PURPOSE: Build the mesh network that will be used to solve FVM. The mesh is constructed by providing a type of cell, which is size of the space discretization.
  • INPUT: network generated by the SkeletonMesh program must be provided.
  • INPUT: type of the cell that make up the fiber
    • pig = 68 um
    • dog = 164 um
    • test1 = 75 um
    • test2 = 100 um
    • test3 = 125 um
    • test4 = 150 um
    • test5 = 175 um
    • test6 = 200 um
  • The output file must defined with the extension ".msh".
  • The syntax of the ".msh" file is defined as

Generated network

Build and execute

$ make
$ ./meshGenerator example.vtk example.msh

FLAGS

  • These flags are turned on by editing the Makefile.
  • -DDIAMETER: Activate the variable diameter length of the Purkinje cells between each growing iteration (for Experiment 4 and 5).

Pk-Noble

  • PURPOSE: Solve the monodomain equation using the Noble celullar model from 1962 (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1359535/pdf/jphysiol01248-0130.pdf)
  • INPUT: Type of the solution
    • -t: SteadyState
    • -s: Solver
  • INPUT: Size of the time discretization
  • INPUT: Maximum simulation time
  • INPUT: Mesh file generated by the MeshGenerator (use the extension ".msh")
  • INPUT: SteadyState filename (use the extension ".sst")
  • INPUT: Plot filename (use extension ".plt")
  • INPUT: Gamma parameter (for the PMJ simulations)
  • INPUT: Diameter of the Purkinje cell

DEPENDENCIES

  • To run this program the Eigen library version 3.3.4 must be installed.
  • To install the Eigen library follow these steps:
    1. Download the version 3.3.4 library at: http://bitbucket.org/eigen/eigen/get/3.3.4.tar.gz
    2. Extract the ".zip" file to a folder
    3. On that folder do the following
    $ mkdir build; cd build
    $ cmake ..
    $ make
    $ make install
  • The CMake plataform should be also be installed to proper build the Eigen library.
  • To install the CMake plataform just execute
$ sudo apt-get install cmake; sudo apt-get upgrade

FLAGS

  • These flags are turned on by editing the Makefile.
  • -DOUTPUT: Activate the visual output on the terminal screen
  • -DVTK: Activate the writing of the ".vtk" files, enabling the visualization of the simulation on Paraview. Files are written on the folder ./VTK
  • -DDIAMETER: Activate the variable diameter length of the Purkinje cells between each growing iteration (for Experiment 4 and 5).
  • -DPMJ: Activate the PMJs.

Pk-LiRudy

  • PURPOSE: Solve the monodomain equation using the Li and Rudy celullar model from 2011 (http://circres.ahajournals.org/content/109/1/71.long)
  • INPUT: Type of the solution
    • -t: SteadyState
    • -s: Solver
  • INPUT: Size of the time discretization
  • INPUT: Maximum simulation time
  • INPUT: Mesh file generated by the MeshGenerator (use the extension ".msh")
  • INPUT: SteadyState filename (use the extension ".sst")
  • INPUT: Plot filename (use extension ".plt")
  • INPUT: Gamma parameter (for the PMJ simulations)
  • INPUT: Diameter of the Purkinje cell

DEPENDENCIES

  • To run this program the Eigen library version 3.3.4 must be installed.
  • To install the Eigen library follow these steps:
    1. Download the version 3.3.4 library at: http://bitbucket.org/eigen/eigen/get/3.3.4.tar.gz
    2. Extract the ".zip" file to a folder
    3. On that folder do the following
    $ mkdir build; cd build
    $ cmake ..
    $ make
    $ make install
  • The CMake plataform should be also be installed to proper build the Eigen library.
  • To install the CMake plataform just execute
$ sudo apt-get install cmake; sudo apt-get upgrade

FLAGS

  • These flags are turned on by editing the Makefile.
  • -DOUTPUT: Activate the visual output on the terminal screen
  • -DVTK: Activate the writing of the ".vtk" files, enabling the visualization of the simulation on Paraview. Files are written on the folder ./VTK
  • -DDIAMETER: Activate the variable diameter length of the Purkinje cells between each growing iteration (for Experiment 4 and 5).
  • -DPMJ: Activate the PMJs.

Other_Codes

  • There are additional codes used in this project:
    1. Python scripts to build the figures
    2. A graph network reader/parser for VTK files
    3. A network visualizer

Experiments

  • It is possible to run each experiment by just executing the following shell script locate on the folder of each celullar model.
  • Example of how to execute the Experiment 3 simulations:
  $ ./genExp3.sh --sst; ./genExp3.sh --solver
  • This will first execute the steady state simulation for the range of parameters defined on the header of the script.
  • Store the output files with the state variables of all control volumes on the SteadyState folder
  • And then execute the solver simulation
  • The output files are then stored on the Results folder

About

Solves the Monodomain Equation on a Purkinje fiber by using the Finite Volume Method.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published