TorchCor: High-Performance Cardiac Electrophysiology Simulations with the Finite Element Method on GPUs
Bei Zhou, Maximilian Balmus, Cesare Corrado, Ludovica Cicci, Shuang Qian, Steven A. Niederer
TL;DR
Cardiac electrophysiology (CEP) simulations demand substantial HPC resources, creating barriers for many researchers and clinicians. The authors introduce TorchCor, a GPU-accelerated FEM solver for the monodomain equation implemented in PyTorch, designed for large 3D heart meshes and easy local execution. The method combines a linear FEM spatial discretization with a θ-time stepping scheme and a PCG solver, and is rigorously validated via manufactured solutions and the $N$-version benchmark, showing accuracy on par with established codes. By unifying high-fidelity CEP modelling with the PyTorch ecosystem, TorchCor enables hybrid physics-ML workflows (e.g., PINNs, neural operators) and broad accessibility through a pure Python API and Docker-based deployment. The work demonstrates significant speedups over CPU-based solvers on modern GPUs, supports high-throughput studies, and lays groundwork for future multi-GPU, adaptive-time, and bidomain extensions toward real-time whole-heart simulations and digital twins.
Abstract
Cardiac electrophysiology (CEP) simulations are increasingly used for understanding cardiac arrhythmias and guiding clinical decisions. However, these simulations typically require high-performance computing resources with numerous CPU cores, which are often inaccessible to many research groups and clinicians. To address this, we present TorchCor, a high-performance Python library for CEP simulations using the finite element method on general-purpose GPUs. Built on PyTorch, TorchCor significantly accelerates CEP simulations, particularly for large 3D meshes. The accuracy of the solver is verified against manufactured analytical solutions and the $N$-version benchmark problem. TorchCor is freely available for both academic and commercial use without restrictions.
