From 00f78531ffad1b49d46395e2b49ff03360e9387c Mon Sep 17 00:00:00 2001 From: Javiera Jilberto Vallejos Date: Wed, 11 Feb 2026 10:51:19 -0800 Subject: [PATCH 1/5] adding domain specific conductances --- Code/Source/solver/CepMod.h | 12 ++++++ Code/Source/solver/cep_ion.cpp | 62 +++++++++++++++---------------- Code/Source/solver/distribute.cpp | 17 +++++---- Code/Source/solver/read_files.cpp | 18 ++++----- 4 files changed, 61 insertions(+), 48 deletions(-) diff --git a/Code/Source/solver/CepMod.h b/Code/Source/solver/CepMod.h index 55e112bb7..783d1dd1b 100644 --- a/Code/Source/solver/CepMod.h +++ b/Code/Source/solver/CepMod.h @@ -165,6 +165,18 @@ class cepModelType /// @brief Time integration options odeType odes; + + /// @brief Domain-specific interface for Aliev-Panfilov cellular activation model + CepModAp ap; + + /// @brief Domain-specific interface for Bueno-Orovio cellular activation model + CepModBo bo; + + /// @brief Domain-specific interface for Fitzhugh-Nagumo cellular activation model + CepModFn fn; + + /// @brief Domain-specific interface for Tusscher-Panfilov cellular activation model + CepModTtp ttp; }; /// @brief Cardiac electromechanics model type diff --git a/Code/Source/solver/cep_ion.cpp b/Code/Source/solver/cep_ion.cpp index 2f805e66a..f340f0c28 100644 --- a/Code/Source/solver/cep_ion.cpp +++ b/Code/Source/solver/cep_ion.cpp @@ -119,19 +119,19 @@ void cep_init_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, VectorG_Na.defined()) { cep_mod.ttp.G_Na = domain_params->G_Na.value(); } - if (domain_params->G_Kr.defined()) { cep_mod.ttp.G_Kr = domain_params->G_Kr.value(); } - if (domain_params->G_Ks.defined()) { cep_mod.ttp.G_Ks[lDmn.cep.imyo - 1] = domain_params->G_Ks.value(); } - if (domain_params->G_to.defined()) { cep_mod.ttp.G_to[lDmn.cep.imyo - 1] = domain_params->G_to.value(); } - if (domain_params->G_CaL.defined()) { cep_mod.ttp.G_CaL = domain_params->G_CaL.value(); } + if (domain_params->G_Na.defined()) { lDmn.cep.ttp.G_Na = domain_params->G_Na.value(); } + if (domain_params->G_Kr.defined()) { lDmn.cep.ttp.G_Kr = domain_params->G_Kr.value(); } + if (domain_params->G_Ks.defined()) { lDmn.cep.ttp.G_Ks[lDmn.cep.imyo - 1] = domain_params->G_Ks.value(); } + if (domain_params->G_to.defined()) { lDmn.cep.ttp.G_to[lDmn.cep.imyo - 1] = domain_params->G_to.value(); } + if (domain_params->G_CaL.defined()) { lDmn.cep.ttp.G_CaL = domain_params->G_CaL.value(); } - // Set Bo parameters. + // Set Bo parameters (domain-specific). // - if (domain_params->tau_si.defined()) { cep_mod.bo.tau_si[lDmn.cep.imyo - 1] = domain_params->tau_si.value(); } - if (domain_params->tau_fi.defined()) { cep_mod.bo.tau_fi[lDmn.cep.imyo - 1] = domain_params->tau_fi.value(); } + if (domain_params->tau_si.defined()) { lDmn.cep.bo.tau_si[lDmn.cep.imyo - 1] = domain_params->tau_si.value(); } + if (domain_params->tau_fi.defined()) { lDmn.cep.bo.tau_fi[lDmn.cep.imyo - 1] = domain_params->tau_fi.value(); } // Set stimulus parameters. // From f46eedc46a1f2380881eea9e89b371cebbd4f518 Mon Sep 17 00:00:00 2001 From: Javiera Jilberto Vallejos Date: Wed, 11 Feb 2026 11:44:58 -0800 Subject: [PATCH 2/5] adding test for domain --- tests/cases/cep/slab_domains/README.md | 11 + tests/cases/cep/slab_domains/domains.png | 3 + tests/cases/cep/slab_domains/mesh/VOLUME.vtu | 3 + tests/cases/cep/slab_domains/mesh/domain.txt | 3360 +++++++++++++++++ .../cep/slab_domains/mesh/surface_x0.vtp | 3 + .../cep/slab_domains/mesh/surface_x20.vtp | 3 + tests/cases/cep/slab_domains/result_020.vtu | 3 + tests/cases/cep/slab_domains/solver.xml | 106 + 8 files changed, 3492 insertions(+) create mode 100755 tests/cases/cep/slab_domains/README.md create mode 100644 tests/cases/cep/slab_domains/domains.png create mode 100644 tests/cases/cep/slab_domains/mesh/VOLUME.vtu create mode 100644 tests/cases/cep/slab_domains/mesh/domain.txt create mode 100644 tests/cases/cep/slab_domains/mesh/surface_x0.vtp create mode 100644 tests/cases/cep/slab_domains/mesh/surface_x20.vtp create mode 100644 tests/cases/cep/slab_domains/result_020.vtu create mode 100644 tests/cases/cep/slab_domains/solver.xml diff --git a/tests/cases/cep/slab_domains/README.md b/tests/cases/cep/slab_domains/README.md new file mode 100755 index 000000000..1295b64f0 --- /dev/null +++ b/tests/cases/cep/slab_domains/README.md @@ -0,0 +1,11 @@ + +# **Problem Description** + +Simulate the propagation of a planar wave in a slab with different domain conductances using the ten-Tusscher-Panfilov cell activation model. + +![Slab domains visualization](domains.png) + +## References +K. H. W. J. ten Tusscher, D. Noble, P. J. Noble, and A. V. Panfilov. A model for human ventricular tissue. American Journal of Physiology-Heart and Circulatory Physiology, +286(4):H1573–H1589, apr 2004. + diff --git a/tests/cases/cep/slab_domains/domains.png b/tests/cases/cep/slab_domains/domains.png new file mode 100644 index 000000000..5d34e8463 --- /dev/null +++ b/tests/cases/cep/slab_domains/domains.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6d518a844a4fbba6b7b558ae40ae8ebcbbea160dc226c6fd3fc0164a25c01f5 +size 40034 diff --git a/tests/cases/cep/slab_domains/mesh/VOLUME.vtu b/tests/cases/cep/slab_domains/mesh/VOLUME.vtu new file mode 100644 index 000000000..1af37fdce --- /dev/null +++ b/tests/cases/cep/slab_domains/mesh/VOLUME.vtu @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69bb6a21296fa79919d0a19669a33a28ae28efdb1bd38124f854815d5d406e8f +size 89215 diff --git a/tests/cases/cep/slab_domains/mesh/domain.txt b/tests/cases/cep/slab_domains/mesh/domain.txt new file mode 100644 index 000000000..ff6768cac --- /dev/null +++ b/tests/cases/cep/slab_domains/mesh/domain.txt @@ -0,0 +1,3360 @@ +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 +3 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+1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 diff --git a/tests/cases/cep/slab_domains/mesh/surface_x0.vtp b/tests/cases/cep/slab_domains/mesh/surface_x0.vtp new file mode 100644 index 000000000..eaebcc0eb --- /dev/null +++ b/tests/cases/cep/slab_domains/mesh/surface_x0.vtp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c0889ad4a8a4659996309b5bba825c1ac5c3f03d2faca2e84e48f1e035ca240 +size 5219 diff --git a/tests/cases/cep/slab_domains/mesh/surface_x20.vtp b/tests/cases/cep/slab_domains/mesh/surface_x20.vtp new file mode 100644 index 000000000..07ad82435 --- /dev/null +++ b/tests/cases/cep/slab_domains/mesh/surface_x20.vtp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8248936f54f9537dcad8e2344beb804485d0f5cbfb960f0a8b025310e1af99ae +size 5128 diff --git a/tests/cases/cep/slab_domains/result_020.vtu b/tests/cases/cep/slab_domains/result_020.vtu new file mode 100644 index 000000000..861423d34 --- /dev/null +++ b/tests/cases/cep/slab_domains/result_020.vtu @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebe1c77349ecc5143c5b62e0cb6cfb62d8730a5f2ac0e3516d3c56790f27d4a1 +size 75127 diff --git a/tests/cases/cep/slab_domains/solver.xml b/tests/cases/cep/slab_domains/solver.xml new file mode 100644 index 000000000..50fcfbd6f --- /dev/null +++ b/tests/cases/cep/slab_domains/solver.xml @@ -0,0 +1,106 @@ + + + + + false + 3 + 20 + 0.1 + 0.50 + STOP_SIM + + true + result + 1 + 0 + + 1000 + 0 + + 1 + 1 + 0 + + + + ./mesh/VOLUME.vtu + + + ./mesh/surface_x0.vtp + + + + ./mesh/surface_x20.vtp + + + ./mesh/domain.txt + + 1.0 + + + + + true + 1 + 20 + 1e-10 + + + TTP + 29.68 + 7.96e-5 + 0.31 + epi + 0.033192 + RK + + + + TTP + 7.42 + 1.99e-5 + 0.08 + epi + 0.033192 + RK + + + + TTP + + 29.68 + 7.96e-5 + 0.31 + + epi + + 0.033192 + + + -35.714 + 0.0 + 2.0 + 10000.0 + + + RK4 + + + + true + + + + + fsils + + 500 + 1e-10 + 50 + + + + + + + From 15c866d94cfe8f99e9732a864c401614a9f7e09d Mon Sep 17 00:00:00 2001 From: Javiera Jilberto Vallejos Date: Wed, 11 Feb 2026 19:01:36 -0800 Subject: [PATCH 3/5] adding test to test_cep.py --- tests/test_cep.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_cep.py b/tests/test_cep.py index 6195019b8..9ad915dd0 100644 --- a/tests/test_cep.py +++ b/tests/test_cep.py @@ -36,6 +36,12 @@ def test_cylinder_purkinje_1d3d(n_proc): test_folder = "cylinder_purkinje_1d3d" run_with_reference(base_folder, test_folder, fields, n_proc) + +def test_slab_domains(n_proc): + test_folder = "slab_domains" + run_with_reference(base_folder, test_folder, fields, n_proc, t_max=20) + + @pytest.mark.parametrize( "confs_ecgs", [ From 06a3f3354bb6aa4eca104f5463c56ef8498c3b15 Mon Sep 17 00:00:00 2001 From: Javiera Jilberto Vallejos Date: Thu, 12 Feb 2026 15:33:28 -0800 Subject: [PATCH 4/5] removing unused function parameter; clarifying comments; fixing bug in cep_ion.cpp --- Code/Source/solver/CepMod.h | 8 ++++---- Code/Source/solver/cep_ion.cpp | 6 +++--- Code/Source/solver/cep_ion.h | 2 +- Code/Source/solver/read_files.cpp | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Code/Source/solver/CepMod.h b/Code/Source/solver/CepMod.h index 783d1dd1b..b9edf28f8 100644 --- a/Code/Source/solver/CepMod.h +++ b/Code/Source/solver/CepMod.h @@ -166,16 +166,16 @@ class cepModelType /// @brief Time integration options odeType odes; - /// @brief Domain-specific interface for Aliev-Panfilov cellular activation model + /// @brief Interface for Aliev-Panfilov cellular activation model CepModAp ap; - /// @brief Domain-specific interface for Bueno-Orovio cellular activation model + /// @brief Interface for Bueno-Orovio cellular activation model CepModBo bo; - /// @brief Domain-specific interface for Fitzhugh-Nagumo cellular activation model + /// @brief Interface for Fitzhugh-Nagumo cellular activation model CepModFn fn; - /// @brief Domain-specific interface for Tusscher-Panfilov cellular activation model + /// @brief Interface for Tusscher-Panfilov cellular activation model CepModTtp ttp; }; diff --git a/Code/Source/solver/cep_ion.cpp b/Code/Source/solver/cep_ion.cpp index f340f0c28..53aa4cadb 100644 --- a/Code/Source/solver/cep_ion.cpp +++ b/Code/Source/solver/cep_ion.cpp @@ -62,7 +62,7 @@ void cep_init(Simulation* simulation) Vector Xl(nX); Vector Xgl(nG); - cep_init_l(cep_mod, eq.dmn[iDmn].cep, nX, nG, Xl, Xgl); + cep_init_l(eq.dmn[iDmn].cep, nX, nG, Xl, Xgl); sA(a) = sA(a) + 1.0; @@ -97,7 +97,7 @@ void cep_init(Simulation* simulation) Vector Xl(nX); Vector Xgl(nG); - cep_init_l(cep_mod, eq.dmn[1].cep, nX, nG, Xl, Xgl); + cep_init_l(eq.dmn[0].cep, nX, nG, Xl, Xgl); for (int i = 0; i < nX; i++) { cep_mod.Xion(i,a) = Xl(i); @@ -114,7 +114,7 @@ void cep_init(Simulation* simulation) // cep_init_l //------------ // -void cep_init_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector& X, Vector& Xg) +void cep_init_l(cepModelType& cep, int nX, int nG, Vector& X, Vector& Xg) { switch (cep.cepType) { diff --git a/Code/Source/solver/cep_ion.h b/Code/Source/solver/cep_ion.h index d5831da89..0eeb3c0ac 100644 --- a/Code/Source/solver/cep_ion.h +++ b/Code/Source/solver/cep_ion.h @@ -17,7 +17,7 @@ namespace cep_ion { void cep_init(Simulation* simulation); -void cep_init_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector& X, Vector& Xg); +void cep_init_l(cepModelType& cep, int nX, int nG, Vector& X, Vector& Xg); void cep_integ(Simulation* simulation, const int iEq, const int iDof, const Array& Dg); diff --git a/Code/Source/solver/read_files.cpp b/Code/Source/solver/read_files.cpp index 84d03d7e6..6d9ac8a8d 100644 --- a/Code/Source/solver/read_files.cpp +++ b/Code/Source/solver/read_files.cpp @@ -999,7 +999,7 @@ void read_cep_domain(Simulation* simulation, EquationParameters* eq_params, Doma } } - // Set Ttp parameters (domain-specific). + // Set Ttp parameters. // if (domain_params->G_Na.defined()) { lDmn.cep.ttp.G_Na = domain_params->G_Na.value(); } if (domain_params->G_Kr.defined()) { lDmn.cep.ttp.G_Kr = domain_params->G_Kr.value(); } @@ -1007,7 +1007,7 @@ void read_cep_domain(Simulation* simulation, EquationParameters* eq_params, Doma if (domain_params->G_to.defined()) { lDmn.cep.ttp.G_to[lDmn.cep.imyo - 1] = domain_params->G_to.value(); } if (domain_params->G_CaL.defined()) { lDmn.cep.ttp.G_CaL = domain_params->G_CaL.value(); } - // Set Bo parameters (domain-specific). + // Set Bo parameters. // if (domain_params->tau_si.defined()) { lDmn.cep.bo.tau_si[lDmn.cep.imyo - 1] = domain_params->tau_si.value(); } if (domain_params->tau_fi.defined()) { lDmn.cep.bo.tau_fi[lDmn.cep.imyo - 1] = domain_params->tau_fi.value(); } From bb4887b8b822a149f45366eaa329bf07e5002d87 Mon Sep 17 00:00:00 2001 From: Javiera Jilberto Vallejos Date: Wed, 18 Feb 2026 21:37:01 -0800 Subject: [PATCH 5/5] no domains in equations fixed; updated parameter assignment --- Code/Source/solver/cep_ion.cpp | 6 +++--- Code/Source/solver/read_files.cpp | 29 +++++++++++++++++++---------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Code/Source/solver/cep_ion.cpp b/Code/Source/solver/cep_ion.cpp index 53aa4cadb..2cf78b836 100644 --- a/Code/Source/solver/cep_ion.cpp +++ b/Code/Source/solver/cep_ion.cpp @@ -52,7 +52,7 @@ void cep_init(Simulation* simulation) for (int iDmn = 0; iDmn < eq.nDmn; iDmn++) { auto cPhys = eq.dmn[iDmn].phys; int dID = eq.dmn[iDmn].Id; - if ((cPhys != EquationType::phys_CEP) || !utils::btest(com_mod.dmnId(a),dID)) { + if ((cPhys != EquationType::phys_CEP) || (dID >= 0 && !utils::btest(com_mod.dmnId(a),dID))) { continue; } int nX = eq.dmn[iDmn].cep.nX; @@ -220,9 +220,9 @@ void cep_integ(Simulation* simulation, const int iEq, const int iDof, const Arra auto cPhys = dmn.phys; int dID = dmn.Id; - if (cPhys != Equation_CEP || !utils::btest(com_mod.dmnId(Ac),dID)) { + if (cPhys != Equation_CEP || (dID >= 0 && !utils::btest(com_mod.dmnId(Ac),dID))) { continue; - } + } int nX = dmn.cep.nX; int nG = dmn.cep.nG; diff --git a/Code/Source/solver/read_files.cpp b/Code/Source/solver/read_files.cpp index 6d9ac8a8d..846f03d6b 100644 --- a/Code/Source/solver/read_files.cpp +++ b/Code/Source/solver/read_files.cpp @@ -1000,17 +1000,26 @@ void read_cep_domain(Simulation* simulation, EquationParameters* eq_params, Doma } // Set Ttp parameters. - // - if (domain_params->G_Na.defined()) { lDmn.cep.ttp.G_Na = domain_params->G_Na.value(); } - if (domain_params->G_Kr.defined()) { lDmn.cep.ttp.G_Kr = domain_params->G_Kr.value(); } - if (domain_params->G_Ks.defined()) { lDmn.cep.ttp.G_Ks[lDmn.cep.imyo - 1] = domain_params->G_Ks.value(); } - if (domain_params->G_to.defined()) { lDmn.cep.ttp.G_to[lDmn.cep.imyo - 1] = domain_params->G_to.value(); } - if (domain_params->G_CaL.defined()) { lDmn.cep.ttp.G_CaL = domain_params->G_CaL.value(); } + // Scalar params + std::map*,double*> simple_ttp_params{ + {&domain_params->G_Na, &lDmn.cep.ttp.G_Na}, + {&domain_params->G_Kr, &lDmn.cep.ttp.G_Kr}, + {&domain_params->G_CaL, &lDmn.cep.ttp.G_CaL} + }; - // Set Bo parameters. - // - if (domain_params->tau_si.defined()) { lDmn.cep.bo.tau_si[lDmn.cep.imyo - 1] = domain_params->tau_si.value(); } - if (domain_params->tau_fi.defined()) { lDmn.cep.bo.tau_fi[lDmn.cep.imyo - 1] = domain_params->tau_fi.value(); } + for (auto& [param, value] : simple_ttp_params) { + if (param->defined()) { + *value = param->value(); + } + } + + // Array params + if (domain_params->G_Ks.defined()) { + lDmn.cep.ttp.G_Ks[lDmn.cep.imyo - 1] = domain_params->G_Ks.value(); + } + if (domain_params->G_to.defined()) { + lDmn.cep.ttp.G_to[lDmn.cep.imyo - 1] = domain_params->G_to.value(); + } // Set stimulus parameters. //