This repository serves as a research environment for studying the application of high-order operator-splitting methods to the cardiac EMI (Extracellular–Membrane–Intracellular) model.
The repository is organized into the following key components:
| File | Description |
|---|---|
exp1_single_circular_cell.py |
Simulates a single circular cell. |
exp2_two_semicircular_cells.py |
Simulates two coupled semicircular cells. |
exp3_n_2D_idealized_cell.py |
Simulates an n×m grid of cells using the FHN or tTP cell model. |
exp4_channelopathy.py |
Simulates a 2×1 configuration of cells with the tTP model under Brugada and LQT1 syndromes. |
The meshes/ folder contains .geo files for generating meshes required for the experiments. To generate a mesh, use the following command:
gmsh -2 <file_name>.geo -o <output_file_name>.mshThe results/ directory contains scripts for post-processing and visualization. Due to the large size of the output data, please
request access by contacting carlos.ballesteros@usask.ca.
Once you have the data, you can use the following scripts:
| File | Description |
|---|---|
MRMS_exp<n>.py |
Computes and exports MRMS error data to an Excel file. |
take_plot_data_exp4.py |
Extracts voltage data for plotting from experiment 4. |
plot_data_exp4.py |
Generates plots from the extracted data. |
The following dependencies are required to run the simulations:
gmshfiredrakeirksomepythOS
You can install the dependencies manually, but for convenience, the repository includes container.def, a definition file for building a container using Apptainer (formerly Singularity) with Ubuntu Linux.
Run the following command to build the container:
singularity build container.sif container.defOnce built, the container.sif file will be available for execution.
To launch the container, use the following command:
apptainer shell --writable-tmpfs --bind ./:/container --bind <path-to-repo>/EMI-HighOrder-OperatorSplitting:<path-to-repo>/EMI-HighOrder-OperatorSplitting container.sifReplace <path-to-repo> with the actual path to your repository.
Once inside, navigate to the container directory:
cd /containerThen, activate the Firedrake virtual environment:
source /opt/firedrake/bin/activateYou're now ready to run simulations and process results!