Published January 20, 2026 | Version 1.0.0

Toward Cardiac Electrophysiology Digital Twins with an Efficient Open Source Scalable Solver on GPU Clusters

Description

File description

The following repository contains all the necessary files to reproduce the manuscript "Toward Cardiac Electrophysiology Digital Twins with an Efficient Open Source Scalable Solver on GPU Clusters". Among the files are the following:

  • monoalg3d_config_files.zip = All the configuration files for the computational simulations: "Benchmark myocardium cuboid", "Purkinje-Muscle-Junction calibration" and "Large-scale biventricular simulations";
  • monoalg3d_purkinje_networks.zip = All the Purkinje networks and PMJ files for the "Purkinje-Muscle-Junction calibration" and "Large-scale biventricular simulations";
  • monoalg3d_polaris_job_files.zip = All the job files to execute the "Benchmark myocardium cuboid", "Large-scale biventricular simulations" and "Purkinje-Muscle-Junction calibration" simulations on the Polaris supercomputer;
  • monoalg3d_source_files.zip = the custom source files to build MonoAlg3D on Polaris. This file contains the implemented custom functions for the "domains_library", "extra_data_library" and "matrix_assembly_library". In addition, the modified version of the ToR-ORd cellular model for T-wave personalisation is also provided within the "models_library" folder;
  • monoalg3d_ventricular_meshes.zip = All the ventricular meshes in ALG format used for the "Purkinje-Muscle-Junction calibration" and "Large-scale biventricular simulations".

Build and configuration

MonoAlg3D is developed by Rafael Sachetto Oliveira et al., Int J Numer Method Biomed Eng (2018) (the original solver is available on GitHub at: MonoAlg3D_C).

To configure the solver for this study follow the build procedures on the solver`s GitHub repository and copy the source files from monoalg3d_source_files.zip. Build the solver again with the command:

./build.sh -f

Biventricular meshes

The human biventricular mesh and ECG electrodes positions were derived from MRI data in Lyon et al., Front Physiol (2018) and Minchole et al., Front Physiol (2019) and can be found in https://zenodo.org/records/14046617 (referred to as Subject/Control 2 as in Camps et al., Med Image Anal (2024)). The ALG columns for the biventricular meshes have the following syntax:

54250,21250,250,250,250,250,0.000399119,1,0.249467,1,1,0.626517,-0.775963,-0.00453349,0.168679,0.130518,0.97453,0.758425,0.614972,-0.213462,7.15285928592859
54750,21250,250,250,250,250,0.0196224,1,0.245434,1,1,0.590492,-0.781949,0.0278572,0.136531,0.13876,0.979878,0.770388,0.574527,-0.192601,7.15285928592859
55250,21250,250,250,250,250,0.0190111,1,0.2414,1,1,0.587508,-0.783926,0.0437592,0.10975,0.136908,0.982621,0.776757,0.573408,-0.170214,7.15285928592859
55750,21250,250,250,250,250,0.0183998,1,0.237367,1,1,0.584524,-0.785903,0.0596612,0.0829692,0.135057,0.985363,0.783125,0.572289,-0.147828,7.3178097809781
  • 1st Column: Coordinate x of the centre of the cell (units in micrometres);
  • 2nd Column: Coordinate y of the centre of the cell (units in micrometres); 
  • 3rd Column: Coordinate z of the centre of the cell (units in micrometres); 
  • 4th Column: Half discretization in the x direction (units in micrometres); 
  • 5th Column: Half discretization in the y direction (units in micrometres); 
  • 6th Column: Half discretization in the z direction (units in micrometres); 
  • 7th Column: Transmurality: range=[0, 1]; 
  • 8th Column: Transmurality labels: 1-ENDO, 2-MID, 3-EPI;
  • 9th Column: Base to apex heterogeneity: range=[0, 1]; 
  • 10th Column: Fast endocardium layer: 0=FAST ENDO, 1=NORMAL, 2=DENSE, 3=SPARSE;
  • 11th Column: Infarct stage: 1=Healthy, 2=Borderzone, 3=Infarcted-stage1, 4=Infarcted-stage2, ... 
  • 12th-14th Columns: Fiber orientation f vector: fx, fy and fz values 
  • 15th-17th Columns: Fiber orientation s vector: sx, sy and sz values
  • 18th-20th Columns: Fiber orientation n vector: nx, ny and nz values
  • 21th Column: IKs scaling factor. 

For the "Purkinje-Muscle-Junction calibration" simulations the dense/sparse biventricular wedges were generated using the "src/main_clip_mesh.c" script by extracting a part of the biventricular mesh with a box around the specified Purkinje terminals, as depicted on Figure 2A from the main manuscript.

Fibre fields were derived as in Doste et al., Int J Numer Method Biomed Eng (2019).

The fast endocardium layer region was generated following Camps et al., Med Image Anal (2024).

Scaling factors for the IKs current were calculated following Camps et al., Med Image Anal (2025).

Purkinje network

The Purkinje network and Purkinje-Muscle-Junctions were inferred in Camps et al., Med Image Anal (2024) by a minimal Purkinje network, which was later expanded by an extra branching procedure following Berg et al., Sci Rep (2023). 

Run and dispatch simulations

To execute the simulations located in the configuration files (monoalg3d_config_files.zip), just execute:

./bin/MonoAlg3D -c <configuration_file_path>

Simulations that use the MPI batch will need MPI configured and can be executed with:

mpiexec --np ${NMPIPROCESS} -ppn ${NRANKS_PER_NODE} --depth=${NDEPTH} --cpu-bind depth [GPU_AFFINITY_SCRIPT] ./bin/MonoAlg3D_batch -c <batch_configuration_file>

All simulations were dispatched on Polaris using the job files (monoalg3d_polaris_job_files.zip) with the command:

qsub <job_file>

Files

monoalg3d_config_files.zip

Files (210.5 MB)

Name Size Download all
md5:4ce1ad554ae0f20f50583fb21826b082
3.1 MB Preview Download
md5:ef9d7094145e5396a5ec9609de165d52
6.8 kB Preview Download
md5:726d20e8d4e9591c2735211f1cd2c30b
26.8 kB Preview Download
md5:6dfa05240cf9a96451e59ba21f5082c9
4.7 MB Preview Download
md5:28f0f52359fbf4f2d7c752a2357129c3
202.7 MB Preview Download

Additional details

Software

Repository URL
https://github.com/rsachetto/MonoAlg3D_C
Programming language
C , Cuda , Python
Development Status
Active

References

  • Sachetto Oliveira, R., Martins Rocha, B., Burgarelli, D., Meira, W., Constantinides, C., & Weber dos Santos, R. (2018). Performance evaluation of GPU parallelization, space-time adaptive algorithms, and their combination for simulating cardiac electrophysiology. International Journal for Numerical Methods in Biomedical Engineering, 34(2). https://doi.org/10.1002/cnm.2913
  • Lyon A, Ariga R, Mincholé A, Mahmod M, Ormondroyd E, Laguna P, de Freitas N, Neubauer S, Watkins H, Rodriguez B. (2018) Distinct ECG Phenotypes Identified in Hypertrophic Cardiomyopathy Using Machine Learning Associate With Arrhythmic Risk Markers. Frontiers in Physiology. 9:213. https://doi.org/10.3389/fphys.2018.00213
  • Mincholé, A., Zacur, E., Ariga, R., Grau, V., & Rodriguez, B. (2019). MRI-Based Computational Torso/Biventricular Multiscale Models to Investigate the Impact of Anatomical Variability on the ECG QRS Complex. Frontiers in Physiology, 10. https://doi.org/10.3389/fphys.2019.01103
  • Camps, J., Berg, L. A., Wang, Z. J., Sebastian, R., Riebel, L. L., Doste, R., Zhou, X., Sachetto, R., Coleman, J., Lawson, B., Grau, V., Burrage, K., Bueno-Orovio, A., Weber dos Santos, R., & Rodriguez, B. (2024). Digital twinning of the human ventricular activation sequence to Clinical 12-lead ECGs and magnetic resonance imaging using realistic Purkinje networks for in silico clinical trials. Medical Image Analysis, 94, 103108. https://doi.org/10.1016/j.media.2024.103108
  • Doste, R., Soto‐Iglesias, D., Bernardino, G., Alcaine, A., Sebastian, R., Giffard‐Roisin, S., Sermesant, M., Berruezo, A., Sanchez‐Quintana, D., & Camara, O. (2019). A rule‐based method to model myocardial fiber orientation in cardiac biventricular geometries with outflow tracts. International Journal for Numerical Methods in Biomedical Engineering, 35(4), e3185. https://doi.org/10.1002/cnm.3185
  • Berg, L. A., Rocha, B. M., Oliveira, R. S., Sebastian, R., Rodriguez, B., de Queiroz, R. A. B., Cherry, E. M., & dos Santos, R. W. (2023). Enhanced optimization-based method for the generation of patient-specific models of Purkinje networks. Scientific Reports, 13(1), 11788. https://doi.org/10.1038/s41598-023-38653-1
  • Camps, J., Wang, Z. J., Doste, R., Berg, L. A., Holmes, M., Lawson, B., Tomek, J., Burrage, K., Bueno-Orovio, A. & Rodriguez, B. (2025). Harnessing 12-lead ECG and MRI data to personalise repolarisation profiles in cardiac digital twin models for enhanced virtual drug testing. Medical Image Analysis, 100, 103361. https://doi.org/10.1016/j.media.2024.103361