Skip to content

Commit 218b312

Browse files
committed
Add test case
1 parent d6c5fc3 commit 218b312

20 files changed

+38
-818
lines changed

Code/Source/solver/CepModTtp.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,6 @@ void CepModTtp::getf(const int i, const int nX, const int nG, const Vector<doubl
151151

152152
// I_Na: Fast sodium current
153153
double I_Na = G_Na * pow(m,3.0) * h * j * (V - E_Na);
154-
155-
// // Debug print for G_Na usage
156-
// static int debug_counter = 0;
157-
// if (debug_counter % 50 == 0) { // Only print every 50 times to avoid spam
158-
// std::cout << "[DEBUG] TTP getf: G_Na=" << G_Na << ", I_Na=" << I_Na
159-
// << ", V=" << V << ", m=" << m << ", h=" << h << ", j=" << j << std::endl;
160-
// }
161-
// debug_counter++;
162154

163155
// I_to: transient outward current
164156
double I_to = G_to[i-1] * r * s * (V - E_K);

Code/Source/solver/cep_ion.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "all_fun.h"
77
#include "post.h"
88
#include "utils.h"
9+
#include <iostream>
910
#include <math.h>
1011

1112
namespace cep_ion {
@@ -41,6 +42,21 @@ void cep_init(Simulation* simulation)
4142
continue;
4243
}
4344

45+
// Warn once on rank 0 if any TTP domain uses default initial conditions.
46+
bool any_ttp_defaults = false;
47+
for (int iDmn = 0; iDmn < eq.nDmn; iDmn++) {
48+
if (eq.dmn[iDmn].cep.cepType == ElectrophysiologyModelType::TTP
49+
&& !eq.dmn[iDmn].cep.ttp_user_initial_state) {
50+
any_ttp_defaults = true;
51+
break;
52+
}
53+
}
54+
static bool ttp_default_ic_warning_printed = false;
55+
if (any_ttp_defaults && !ttp_default_ic_warning_printed && cm.idcm() == 0) {
56+
std::cout << "[WARNING] Default initial conditions are being used for the TTP ionic model (zone-based: epi/endo/mid-myo). To set custom initial conditions, specify <TTP_initial_conditions> in the domain XML." << std::endl;
57+
ttp_default_ic_warning_printed = true;
58+
}
59+
4460
if (com_mod.dmnId.size() != 0) {
4561
Vector<double> sA(tnNo);
4662
Array<double> sF(nXion,tnNo);

Code/Source/solver/read_files.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,12 +1002,7 @@ void read_cep_domain(Simulation* simulation, EquationParameters* eq_params, Doma
10021002

10031003
// Set Ttp parameters.
10041004
//
1005-
if (domain_params->G_Na.defined()) {
1006-
lDmn.cep.ttp.G_Na = domain_params->G_Na.value();
1007-
// std::cout << "[DEBUG] G_Na assigned for domain " << domain_params->id.value()
1008-
// << " (myocardial zone: " << domain_params->myocardial_zone.value()
1009-
// << ", imyo: " << lDmn.cep.imyo << "): " << lDmn.cep.ttp.G_Na << std::endl;
1010-
}
1005+
if (domain_params->G_Na.defined()) { lDmn.cep.ttp.G_Na = domain_params->G_Na.value(); }
10111006
if (domain_params->G_Kr.defined()) { lDmn.cep.ttp.G_Kr = domain_params->G_Kr.value(); }
10121007
if (domain_params->G_Ks.defined()) { lDmn.cep.ttp.G_Ks[lDmn.cep.imyo - 1] = domain_params->G_Ks.value(); }
10131008
if (domain_params->G_to.defined()) { lDmn.cep.ttp.G_to[lDmn.cep.imyo - 1] = domain_params->G_to.value(); }

0 commit comments

Comments
 (0)