Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Code/Source/solver/CepMod.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
62 changes: 31 additions & 31 deletions Code/Source/solver/cep_ion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,19 @@ void cep_init_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doubl
switch (cep.cepType) {

case ElectrophysiologyModelType::AP:
cep_mod.ap.init(nX, X);
cep.ap.init(nX, X);
break;

case ElectrophysiologyModelType::BO:
cep_mod.bo.init(nX, X);
cep.bo.init(nX, X);
break;

case ElectrophysiologyModelType::FN:
cep_mod.fn.init(nX, X);
cep.fn.init(nX, X);
break;

case ElectrophysiologyModelType::TTP:
cep_mod.ttp.init(cep.imyo, nX, nG, X, Xg);
cep.ttp.init(cep.imyo, nX, nG, X, Xg);
break;
}
}
Expand Down Expand Up @@ -383,12 +383,12 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
} else {
Istim = 0.0;
}
cep_mod.ap.integ_fe(nX, X, t, cep.dt, Istim, Ksac);
cep.ap.integ_fe(nX, X, t, cep.dt, Istim, Ksac);

// Electromechanics excitation-activation
if (cem.aStress) {
double epsX;
cep_mod.ap.actv_strs(X(0), cep.dt, yl, epsX);
cep.ap.actv_strs(X(0), cep.dt, yl, epsX);
}
}
} break;
Expand All @@ -402,12 +402,12 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
} else {
Istim = 0.0;
}
cep_mod.ap.integ_rk(nX, X, t, cep.dt, Istim, Ksac);
cep.ap.integ_rk(nX, X, t, cep.dt, Istim, Ksac);

// Electromechanics excitation-activation
if (cem.aStress) {
double epsX;
cep_mod.ap.actv_strs(X(0), cep.dt, yl, epsX);
cep.ap.actv_strs(X(0), cep.dt, yl, epsX);
}
}
} break;
Expand All @@ -422,12 +422,12 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
Istim = 0.0;
}

cep_mod.ap.integ_cn2(nX, X, t, cep.dt, Istim, Ksac, IPAR, RPAR);
cep.ap.integ_cn2(nX, X, t, cep.dt, Istim, Ksac, IPAR, RPAR);

// Electromechanics excitation-activation
if (cem.aStress) {
double epsX;
cep_mod.ap.actv_strs(X(0), cep.dt, yl, epsX);
cep.ap.actv_strs(X(0), cep.dt, yl, epsX);
}
}
} break;
Expand All @@ -453,14 +453,14 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
Istim = 0.0;
}

cep_mod.bo.integ_fe(cep.imyo, nX, X, t, cep.dt, Istim, Ksac, RPAR);
cep.bo.integ_fe(cep.imyo, nX, X, t, cep.dt, Istim, Ksac, RPAR);

// Electromechanics excitation-activation
if (cem.aStress) {
double epsX;
cep_mod.bo.actv_strs(X(0), cep.dt, yl, epsX);
cep.bo.actv_strs(X(0), cep.dt, yl, epsX);
} else if (cem.aStrain) {
cep_mod.bo.actv_strn(X(3), I4f, cep.dt, yl);
cep.bo.actv_strn(X(3), I4f, cep.dt, yl);
}
}
} break;
Expand All @@ -475,14 +475,14 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
Istim = 0.0;
}

cep_mod.bo.integ_rk(cep.imyo, nX, X, t, cep.dt, Istim, Ksac, RPAR);
cep.bo.integ_rk(cep.imyo, nX, X, t, cep.dt, Istim, Ksac, RPAR);

// Electromechanics excitation-activation
if (cem.aStress) {
double epsX;
cep_mod.bo.actv_strs(X(0), cep.dt, yl, epsX);
cep.bo.actv_strs(X(0), cep.dt, yl, epsX);
} else if (cem.aStrain) {
cep_mod.bo.actv_strn(X(3), I4f, cep.dt, yl);
cep.bo.actv_strn(X(3), I4f, cep.dt, yl);
}
}
} break;
Expand All @@ -497,14 +497,14 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
Istim = 0.0;
}

cep_mod.bo.integ_cn2(cep.imyo, nX, X, t, cep.dt, Istim, Ksac, IPAR, RPAR);
cep.bo.integ_cn2(cep.imyo, nX, X, t, cep.dt, Istim, Ksac, IPAR, RPAR);

// Electromechanics excitation-activation
if (cem.aStress) {
double epsX;
cep_mod.bo.actv_strs(X(0), cep.dt, yl, epsX);
cep.bo.actv_strs(X(0), cep.dt, yl, epsX);
} else if (cem.aStrain) {
cep_mod.bo.actv_strn(X(3), I4f, cep.dt, yl);
cep.bo.actv_strn(X(3), I4f, cep.dt, yl);
}
}
} break;
Expand All @@ -530,7 +530,7 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
} else {
Istim = 0.0;
}
cep_mod.fn.integ_fe(nX, X, t, cep.dt, Istim);
cep.fn.integ_fe(nX, X, t, cep.dt, Istim);
}
} break;

Expand All @@ -543,7 +543,7 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
} else {
Istim = 0.0;
}
cep_mod.fn.integ_rk(nX, X, t, cep.dt, Istim);
cep.fn.integ_rk(nX, X, t, cep.dt, Istim);
}
} break;

Expand All @@ -556,7 +556,7 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
} else {
Istim = 0.0;
}
cep_mod.fn.integ_cn2(nX, X, t, cep.dt, Istim, IPAR, RPAR);
cep.fn.integ_cn2(nX, X, t, cep.dt, Istim, IPAR, RPAR);
}
} break;
}
Expand All @@ -580,14 +580,14 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
} else {
Istim = 0.0;
}
cep_mod.ttp.integ_fe(cep.imyo, nX, nG, X, Xg, t, cep.dt, Istim, Ksac, RPAR);
cep.ttp.integ_fe(cep.imyo, nX, nG, X, Xg, t, cep.dt, Istim, Ksac, RPAR);

// Electromechanics excitation-activation
if (cem.aStress) {
double epsX;
cep_mod.ttp.actv_strs(X(3), cep.dt, yl, epsX);
cep.ttp.actv_strs(X(3), cep.dt, yl, epsX);
} else if (cem.aStrain) {
cep_mod.ttp.actv_strn(X(3), I4f, cep.dt, yl);
cep.ttp.actv_strn(X(3), I4f, cep.dt, yl);
}
}
} break;
Expand All @@ -602,14 +602,14 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
Istim = 0.0;
}

cep_mod.ttp.integ_rk(cep.imyo, nX, nG, X, Xg, t, cep.dt, Istim, Ksac, RPAR);
cep.ttp.integ_rk(cep.imyo, nX, nG, X, Xg, t, cep.dt, Istim, Ksac, RPAR);

// Electromechanics excitation-activation
if (cem.aStress) {
double epsX;
cep_mod.ttp.actv_strs(X(3), cep.dt, yl, epsX);
cep.ttp.actv_strs(X(3), cep.dt, yl, epsX);
} else if (cem.aStrain) {
cep_mod.ttp.actv_strn(X(3), I4f, cep.dt, yl);
cep.ttp.actv_strn(X(3), I4f, cep.dt, yl);
}
}
} break;
Expand All @@ -624,14 +624,14 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
Istim = 0.0;
}

cep_mod.ttp.integ_cn2(cep.imyo, nX, nG, X, Xg, t, cep.dt, Istim, Ksac, IPAR, RPAR);
cep.ttp.integ_cn2(cep.imyo, nX, nG, X, Xg, t, cep.dt, Istim, Ksac, IPAR, RPAR);

// Electromechanics excitation-activation
if (cem.aStress) {
double epsX;
cep_mod.ttp.actv_strs(X(3), cep.dt, yl, epsX);
cep.ttp.actv_strs(X(3), cep.dt, yl, epsX);
} else if (cem.aStrain) {
cep_mod.ttp.actv_strn(X(3), I4f, cep.dt, yl);
cep.ttp.actv_strn(X(3), I4f, cep.dt, yl);
}
}
} break;
Expand Down
17 changes: 9 additions & 8 deletions Code/Source/solver/distribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1557,14 +1557,15 @@ void dist_eq(ComMod& com_mod, const CmMod& cm_mod, const cmType& cm, const std::
cm.bcast(cm_mod, &cep.odes.relTol);
}

cm.bcast(cm_mod, &cep_mod.ttp.G_Na);
cm.bcast(cm_mod, &cep_mod.ttp.G_CaL);
cm.bcast(cm_mod, &cep_mod.ttp.G_Kr);
cm.bcast(cm_mod, cep_mod.ttp.G_Ks);
cm.bcast(cm_mod, cep_mod.ttp.G_to);

cm.bcast(cm_mod, cep_mod.bo.tau_si);
cm.bcast(cm_mod, cep_mod.bo.tau_fi);
// Broadcast domain-specific model parameters
cm.bcast(cm_mod, &cep.ttp.G_Na);
cm.bcast(cm_mod, &cep.ttp.G_CaL);
cm.bcast(cm_mod, &cep.ttp.G_Kr);
cm.bcast(cm_mod, cep.ttp.G_Ks);
cm.bcast(cm_mod, cep.ttp.G_to);

cm.bcast(cm_mod, cep.bo.tau_si);
cm.bcast(cm_mod, cep.bo.tau_fi);
}

if ((dmn.phys == EquationType::phys_struct) || (dmn.phys == EquationType::phys_ustruct)) {
Expand Down
18 changes: 9 additions & 9 deletions Code/Source/solver/read_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,18 +999,18 @@ void read_cep_domain(Simulation* simulation, EquationParameters* eq_params, Doma
}
}

// Set Ttp parameters.
// Set Ttp parameters (domain-specific).
//
if (domain_params->G_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.
//
Expand Down