From 89298be2af1434a17bf28c6d07f6ea9b2448ab3a Mon Sep 17 00:00:00 2001 From: Javiera Jilberto Vallejos Date: Fri, 21 Nov 2025 16:45:32 -0800 Subject: [PATCH 1/5] fixing bug --- Code/Source/solver/load_msh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Source/solver/load_msh.cpp b/Code/Source/solver/load_msh.cpp index c7c5a62ba..b874fedb3 100644 --- a/Code/Source/solver/load_msh.cpp +++ b/Code/Source/solver/load_msh.cpp @@ -132,7 +132,7 @@ void read_ndnlff(const std::string& file_name, faceType& face) face.nNo = node_ids.size(); face.gN = Vector(face.nNo); for (int i = 0; i < face.nNo; i++) { - face.gN[i] = node_ids[i] - 1; + face.gN[i] = node_ids[i]; //std::cout << "[read_ndnlff] a Ac: " << i+1 << " " << node_ids[i] << std::endl; } From 9e2c2f75258d91094fa3bc65e6c9b864440a2cdf Mon Sep 17 00:00:00 2001 From: Javiera Jilberto Vallejos Date: Wed, 26 Nov 2025 09:14:01 -0800 Subject: [PATCH 2/5] undo bad fix --- Code/Source/solver/load_msh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Source/solver/load_msh.cpp b/Code/Source/solver/load_msh.cpp index b874fedb3..c7c5a62ba 100644 --- a/Code/Source/solver/load_msh.cpp +++ b/Code/Source/solver/load_msh.cpp @@ -132,7 +132,7 @@ void read_ndnlff(const std::string& file_name, faceType& face) face.nNo = node_ids.size(); face.gN = Vector(face.nNo); for (int i = 0; i < face.nNo; i++) { - face.gN[i] = node_ids[i]; + face.gN[i] = node_ids[i] - 1; //std::cout << "[read_ndnlff] a Ac: " << i+1 << " " << node_ids[i] << std::endl; } From fd960d33d4de4043ebc3266ccfac3cf2944496ff Mon Sep 17 00:00:00 2001 From: Javiera Jilberto Vallejos Date: Wed, 26 Nov 2025 15:27:55 -0800 Subject: [PATCH 3/5] adding test for EP 1d-3d coupling --- .../cep/cylinder_purkinje_1d3d/README.md | 19 ++++ .../activation_10fps.gif | 3 + .../cylinder_purkinje_1d3d/mesh/cyl-tree.vtu | 3 + .../mesh/cyl-tree_domain.dat | 3 + .../mesh/cyl-tree_endnodes.txt | 81 +++++++++++++ .../cylinder_purkinje_1d3d/mesh/cylinder.vtu | 3 + .../mesh/cylinder_domain.dat | 3 + .../mesh/cylinder_fiber.vtu | 3 + .../mesh/mesh-surfaces/cylinder_inner.vtp | 3 + .../cep/cylinder_purkinje_1d3d/result_001.vtu | 3 + .../cep/cylinder_purkinje_1d3d/solver.xml | 107 ++++++++++++++++++ 11 files changed, 231 insertions(+) create mode 100755 tests/cases/cep/cylinder_purkinje_1d3d/README.md create mode 100644 tests/cases/cep/cylinder_purkinje_1d3d/activation_10fps.gif create mode 100644 tests/cases/cep/cylinder_purkinje_1d3d/mesh/cyl-tree.vtu create mode 100644 tests/cases/cep/cylinder_purkinje_1d3d/mesh/cyl-tree_domain.dat create mode 100644 tests/cases/cep/cylinder_purkinje_1d3d/mesh/cyl-tree_endnodes.txt create mode 100644 tests/cases/cep/cylinder_purkinje_1d3d/mesh/cylinder.vtu create mode 100644 tests/cases/cep/cylinder_purkinje_1d3d/mesh/cylinder_domain.dat create mode 100644 tests/cases/cep/cylinder_purkinje_1d3d/mesh/cylinder_fiber.vtu create mode 100644 tests/cases/cep/cylinder_purkinje_1d3d/mesh/mesh-surfaces/cylinder_inner.vtp create mode 100644 tests/cases/cep/cylinder_purkinje_1d3d/result_001.vtu create mode 100644 tests/cases/cep/cylinder_purkinje_1d3d/solver.xml diff --git a/tests/cases/cep/cylinder_purkinje_1d3d/README.md b/tests/cases/cep/cylinder_purkinje_1d3d/README.md new file mode 100755 index 000000000..e32e879ff --- /dev/null +++ b/tests/cases/cep/cylinder_purkinje_1d3d/README.md @@ -0,0 +1,19 @@ + +# **Problem Description** + +Simulate the propagation of an electric signal in a cylinder coupled with a network of Purkinje fibers using the ten-Tusscher-Panfilov cell activation model. + +Note: Conductivities in the myocardium were selected so that the propagation occurs in the myocardium (if too slow, due to the coarseness of the mesh, it does not propagation beyond the coupled nodes). + +

+ +

+ +## 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. + +K. H. W. J. ten Tusscher and A. V. Panfilov. Alternans and spiral breakup in a human +ventricular tissue model. American Journal of Physiology-Heart and Circulatory Physiology, +291(3):H1088–H1100, sep 2006. + diff --git a/tests/cases/cep/cylinder_purkinje_1d3d/activation_10fps.gif b/tests/cases/cep/cylinder_purkinje_1d3d/activation_10fps.gif new file mode 100644 index 000000000..bdf3734f5 --- /dev/null +++ b/tests/cases/cep/cylinder_purkinje_1d3d/activation_10fps.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fce1e5d81a12dd0e8935b79b61c126299f310259af6422854620b471e8014a8 +size 5013173 diff --git a/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cyl-tree.vtu b/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cyl-tree.vtu new file mode 100644 index 000000000..a61afb426 --- /dev/null +++ b/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cyl-tree.vtu @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c246d295275410c214d19ab9f96e813530aaa783ce138cf55dc72bf4afd98b8a +size 36058 diff --git a/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cyl-tree_domain.dat b/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cyl-tree_domain.dat new file mode 100644 index 000000000..75a62027e --- /dev/null +++ b/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cyl-tree_domain.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f0ee50981ad21964c089db40ba5ab3099c018e653dbc36215ca31c0cab3ca4d +size 890 diff --git a/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cyl-tree_endnodes.txt b/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cyl-tree_endnodes.txt new file mode 100644 index 000000000..4c3fbce73 --- /dev/null +++ b/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cyl-tree_endnodes.txt @@ -0,0 +1,81 @@ +1 +16 +54 +62 +66 +74 +84 +85 +91 +99 +101 +122 +123 +124 +128 +129 +137 +141 +149 +151 +164 +167 +175 +178 +203 +227 +231 +239 +252 +268 +283 +285 +287 +291 +294 +298 +302 +307 +323 +326 +327 +328 +329 +333 +334 +338 +342 +346 +350 +351 +355 +363 +364 +368 +369 +373 +376 +378 +379 +380 +381 +384 +392 +396 +400 +402 +409 +411 +414 +415 +419 +426 +430 +432 +436 +438 +441 +442 +443 +445 +446 diff --git a/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cylinder.vtu b/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cylinder.vtu new file mode 100644 index 000000000..0297e2499 --- /dev/null +++ b/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cylinder.vtu @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9195c6ef95a6490b68c40561ee6ec66cd7ac96cd893103e09df8152a7ff7dec1 +size 67480 diff --git a/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cylinder_domain.dat b/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cylinder_domain.dat new file mode 100644 index 000000000..192f5638b --- /dev/null +++ b/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cylinder_domain.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:306178540daa4fb17b2f3abd8059edb4f776a8e5f9a0ffbc3caa3548653dfa32 +size 4560 diff --git a/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cylinder_fiber.vtu b/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cylinder_fiber.vtu new file mode 100644 index 000000000..e9d9a5968 --- /dev/null +++ b/tests/cases/cep/cylinder_purkinje_1d3d/mesh/cylinder_fiber.vtu @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:248289d115368e3ae26c3661e86b455aabf9a1f886826f8ead4dff3a45d8d3aa +size 71037 diff --git a/tests/cases/cep/cylinder_purkinje_1d3d/mesh/mesh-surfaces/cylinder_inner.vtp b/tests/cases/cep/cylinder_purkinje_1d3d/mesh/mesh-surfaces/cylinder_inner.vtp new file mode 100644 index 000000000..7ebc3f425 --- /dev/null +++ b/tests/cases/cep/cylinder_purkinje_1d3d/mesh/mesh-surfaces/cylinder_inner.vtp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9fc93450da649483d18dd4ce041ee41d646514e53696f3cee36ffd237c84911 +size 22703 diff --git a/tests/cases/cep/cylinder_purkinje_1d3d/result_001.vtu b/tests/cases/cep/cylinder_purkinje_1d3d/result_001.vtu new file mode 100644 index 000000000..5fdb86311 --- /dev/null +++ b/tests/cases/cep/cylinder_purkinje_1d3d/result_001.vtu @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23aec8b3fc9a0e69a44f83990e98d8b50e8952b387fc2991098b70440d351caa +size 91659 diff --git a/tests/cases/cep/cylinder_purkinje_1d3d/solver.xml b/tests/cases/cep/cylinder_purkinje_1d3d/solver.xml new file mode 100644 index 000000000..a379af277 --- /dev/null +++ b/tests/cases/cep/cylinder_purkinje_1d3d/solver.xml @@ -0,0 +1,107 @@ + + + + + false + 3 + 1 + 0.1 + 0.50 + STOP_SIM + + true + result + 1 + 1 + + 1 + 0 + + 1 + 0 + 0 + + + + true + ./mesh/cyl-tree.vtu + + ./mesh/cyl-tree_endnodes.txt + + ./mesh/cyl-tree_domain.dat + 10 + + + + + ./mesh/cylinder.vtu + + + ./mesh/mesh-surfaces/cylinder_inner.vtp + + + ./mesh/cylinder_domain.dat + + ./mesh/cylinder_fiber.vtu + 10 + + + + + endo + -1.0 + + + + + true + 1 + 3 + 1e-12 + + + TTP + myocardium + 0.05 + 0.05 + RK + + + + TTP + pfib + 1.1 + RK + + + + TTP + pfib + 1.1 + RK + + -52.0 + 0.0 + 2.0 + 1000.0 + + + + + true + + + + + fsils + + 100 + 1e-12 + 50 + + + + + + + From f90253ae232cfa092b6cae34b2281fd64a084b5c Mon Sep 17 00:00:00 2001 From: Javiera Jilberto Vallejos Date: Sun, 30 Nov 2025 19:32:39 -0800 Subject: [PATCH 4/5] adding new test to test_cep.py --- tests/test_cep.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_cep.py b/tests/test_cep.py index 57c318460..6195019b8 100644 --- a/tests/test_cep.py +++ b/tests/test_cep.py @@ -32,6 +32,10 @@ def test_purkinje(n_proc): run_with_reference(base_folder, test_folder, fields, n_proc) +def test_cylinder_purkinje_1d3d(n_proc): + test_folder = "cylinder_purkinje_1d3d" + run_with_reference(base_folder, test_folder, fields, n_proc) + @pytest.mark.parametrize( "confs_ecgs", [ From d2b08467022a8e24e0fa183679c29473f86703da Mon Sep 17 00:00:00 2001 From: Javiera Jilberto Vallejos Date: Mon, 5 Jan 2026 13:20:38 -0800 Subject: [PATCH 5/5] minor revisions --- tests/cases/cep/cylinder_purkinje_1d3d/README.md | 2 +- tests/cases/cep/cylinder_purkinje_1d3d/solver.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cases/cep/cylinder_purkinje_1d3d/README.md b/tests/cases/cep/cylinder_purkinje_1d3d/README.md index e32e879ff..a8d3d7722 100755 --- a/tests/cases/cep/cylinder_purkinje_1d3d/README.md +++ b/tests/cases/cep/cylinder_purkinje_1d3d/README.md @@ -3,7 +3,7 @@ Simulate the propagation of an electric signal in a cylinder coupled with a network of Purkinje fibers using the ten-Tusscher-Panfilov cell activation model. -Note: Conductivities in the myocardium were selected so that the propagation occurs in the myocardium (if too slow, due to the coarseness of the mesh, it does not propagation beyond the coupled nodes). +Note: Conductivities in the myocardium were selected so that the propagation occurs in the myocardium (if too slow, due to the coarseness of the mesh, the action potential does not propagate beyond the coupled nodes).

diff --git a/tests/cases/cep/cylinder_purkinje_1d3d/solver.xml b/tests/cases/cep/cylinder_purkinje_1d3d/solver.xml index a379af277..35844bcb0 100644 --- a/tests/cases/cep/cylinder_purkinje_1d3d/solver.xml +++ b/tests/cases/cep/cylinder_purkinje_1d3d/solver.xml @@ -49,7 +49,7 @@ endo - -1.0 + -1.0