@@ -52,7 +52,7 @@ void cep_init(Simulation* simulation)
5252 for (int iDmn = 0 ; iDmn < eq.nDmn ; iDmn++) {
5353 auto cPhys = eq.dmn [iDmn].phys ;
5454 int dID = eq.dmn [iDmn].Id ;
55- if ((cPhys != EquationType::phys_CEP) || !utils::btest (com_mod.dmnId (a),dID)) {
55+ if ((cPhys != EquationType::phys_CEP) || (dID >= 0 && !utils::btest (com_mod.dmnId (a),dID) )) {
5656 continue ;
5757 }
5858 int nX = eq.dmn [iDmn].cep .nX ;
@@ -62,7 +62,7 @@ void cep_init(Simulation* simulation)
6262 Vector<double > Xl (nX);
6363 Vector<double > Xgl (nG);
6464
65- cep_init_l (cep_mod, eq.dmn [iDmn].cep , nX, nG, Xl, Xgl);
65+ cep_init_l (eq.dmn [iDmn].cep , nX, nG, Xl, Xgl);
6666
6767 sA (a) = sA (a) + 1.0 ;
6868
@@ -97,7 +97,7 @@ void cep_init(Simulation* simulation)
9797 Vector<double > Xl (nX);
9898 Vector<double > Xgl (nG);
9999
100- cep_init_l (cep_mod, eq.dmn [1 ].cep , nX, nG, Xl, Xgl);
100+ cep_init_l (eq.dmn [0 ].cep , nX, nG, Xl, Xgl);
101101
102102 for (int i = 0 ; i < nX; i++) {
103103 cep_mod.Xion (i,a) = Xl (i);
@@ -114,24 +114,24 @@ void cep_init(Simulation* simulation)
114114// cep_init_l
115115// ------------
116116//
117- void cep_init_l (CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<double >& X, Vector<double >& Xg)
117+ void cep_init_l (cepModelType& cep, int nX, int nG, Vector<double >& X, Vector<double >& Xg)
118118{
119119 switch (cep.cepType ) {
120120
121121 case ElectrophysiologyModelType::AP:
122- cep_mod .ap .init (nX, X);
122+ cep .ap .init (nX, X);
123123 break ;
124124
125125 case ElectrophysiologyModelType::BO:
126- cep_mod .bo .init (nX, X);
126+ cep .bo .init (nX, X);
127127 break ;
128128
129129 case ElectrophysiologyModelType::FN:
130- cep_mod .fn .init (nX, X);
130+ cep .fn .init (nX, X);
131131 break ;
132132
133133 case ElectrophysiologyModelType::TTP:
134- cep_mod .ttp .init (cep.imyo , nX, nG, X, Xg);
134+ cep .ttp .init (cep.imyo , nX, nG, X, Xg);
135135 break ;
136136 }
137137}
@@ -220,9 +220,9 @@ void cep_integ(Simulation* simulation, const int iEq, const int iDof, const Arra
220220 auto cPhys = dmn.phys ;
221221 int dID = dmn.Id ;
222222
223- if (cPhys != Equation_CEP || !utils::btest (com_mod.dmnId (Ac),dID)) {
223+ if (cPhys != Equation_CEP || (dID >= 0 && !utils::btest (com_mod.dmnId (Ac),dID) )) {
224224 continue ;
225- }
225+ }
226226
227227 int nX = dmn.cep .nX ;
228228 int nG = dmn.cep .nG ;
@@ -383,12 +383,12 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
383383 } else {
384384 Istim = 0.0 ;
385385 }
386- cep_mod .ap .integ_fe (nX, X, t, cep.dt , Istim, Ksac);
386+ cep .ap .integ_fe (nX, X, t, cep.dt , Istim, Ksac);
387387
388388 // Electromechanics excitation-activation
389389 if (cem.aStress ) {
390390 double epsX;
391- cep_mod .ap .actv_strs (X (0 ), cep.dt , yl, epsX);
391+ cep .ap .actv_strs (X (0 ), cep.dt , yl, epsX);
392392 }
393393 }
394394 } break ;
@@ -402,12 +402,12 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
402402 } else {
403403 Istim = 0.0 ;
404404 }
405- cep_mod .ap .integ_rk (nX, X, t, cep.dt , Istim, Ksac);
405+ cep .ap .integ_rk (nX, X, t, cep.dt , Istim, Ksac);
406406
407407 // Electromechanics excitation-activation
408408 if (cem.aStress ) {
409409 double epsX;
410- cep_mod .ap .actv_strs (X (0 ), cep.dt , yl, epsX);
410+ cep .ap .actv_strs (X (0 ), cep.dt , yl, epsX);
411411 }
412412 }
413413 } break ;
@@ -422,12 +422,12 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
422422 Istim = 0.0 ;
423423 }
424424
425- cep_mod .ap .integ_cn2 (nX, X, t, cep.dt , Istim, Ksac, IPAR, RPAR);
425+ cep .ap .integ_cn2 (nX, X, t, cep.dt , Istim, Ksac, IPAR, RPAR);
426426
427427 // Electromechanics excitation-activation
428428 if (cem.aStress ) {
429429 double epsX;
430- cep_mod .ap .actv_strs (X (0 ), cep.dt , yl, epsX);
430+ cep .ap .actv_strs (X (0 ), cep.dt , yl, epsX);
431431 }
432432 }
433433 } break ;
@@ -453,14 +453,14 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
453453 Istim = 0.0 ;
454454 }
455455
456- cep_mod .bo .integ_fe (cep.imyo , nX, X, t, cep.dt , Istim, Ksac, RPAR);
456+ cep .bo .integ_fe (cep.imyo , nX, X, t, cep.dt , Istim, Ksac, RPAR);
457457
458458 // Electromechanics excitation-activation
459459 if (cem.aStress ) {
460460 double epsX;
461- cep_mod .bo .actv_strs (X (0 ), cep.dt , yl, epsX);
461+ cep .bo .actv_strs (X (0 ), cep.dt , yl, epsX);
462462 } else if (cem.aStrain ) {
463- cep_mod .bo .actv_strn (X (3 ), I4f, cep.dt , yl);
463+ cep .bo .actv_strn (X (3 ), I4f, cep.dt , yl);
464464 }
465465 }
466466 } break ;
@@ -475,14 +475,14 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
475475 Istim = 0.0 ;
476476 }
477477
478- cep_mod .bo .integ_rk (cep.imyo , nX, X, t, cep.dt , Istim, Ksac, RPAR);
478+ cep .bo .integ_rk (cep.imyo , nX, X, t, cep.dt , Istim, Ksac, RPAR);
479479
480480 // Electromechanics excitation-activation
481481 if (cem.aStress ) {
482482 double epsX;
483- cep_mod .bo .actv_strs (X (0 ), cep.dt , yl, epsX);
483+ cep .bo .actv_strs (X (0 ), cep.dt , yl, epsX);
484484 } else if (cem.aStrain ) {
485- cep_mod .bo .actv_strn (X (3 ), I4f, cep.dt , yl);
485+ cep .bo .actv_strn (X (3 ), I4f, cep.dt , yl);
486486 }
487487 }
488488 } break ;
@@ -497,14 +497,14 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
497497 Istim = 0.0 ;
498498 }
499499
500- cep_mod .bo .integ_cn2 (cep.imyo , nX, X, t, cep.dt , Istim, Ksac, IPAR, RPAR);
500+ cep .bo .integ_cn2 (cep.imyo , nX, X, t, cep.dt , Istim, Ksac, IPAR, RPAR);
501501
502502 // Electromechanics excitation-activation
503503 if (cem.aStress ) {
504504 double epsX;
505- cep_mod .bo .actv_strs (X (0 ), cep.dt , yl, epsX);
505+ cep .bo .actv_strs (X (0 ), cep.dt , yl, epsX);
506506 } else if (cem.aStrain ) {
507- cep_mod .bo .actv_strn (X (3 ), I4f, cep.dt , yl);
507+ cep .bo .actv_strn (X (3 ), I4f, cep.dt , yl);
508508 }
509509 }
510510 } break ;
@@ -530,7 +530,7 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
530530 } else {
531531 Istim = 0.0 ;
532532 }
533- cep_mod .fn .integ_fe (nX, X, t, cep.dt , Istim);
533+ cep .fn .integ_fe (nX, X, t, cep.dt , Istim);
534534 }
535535 } break ;
536536
@@ -543,7 +543,7 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
543543 } else {
544544 Istim = 0.0 ;
545545 }
546- cep_mod .fn .integ_rk (nX, X, t, cep.dt , Istim);
546+ cep .fn .integ_rk (nX, X, t, cep.dt , Istim);
547547 }
548548 } break ;
549549
@@ -556,7 +556,7 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
556556 } else {
557557 Istim = 0.0 ;
558558 }
559- cep_mod .fn .integ_cn2 (nX, X, t, cep.dt , Istim, IPAR, RPAR);
559+ cep .fn .integ_cn2 (nX, X, t, cep.dt , Istim, IPAR, RPAR);
560560 }
561561 } break ;
562562 }
@@ -580,14 +580,14 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
580580 } else {
581581 Istim = 0.0 ;
582582 }
583- cep_mod .ttp .integ_fe (cep.imyo , nX, nG, X, Xg, t, cep.dt , Istim, Ksac, RPAR);
583+ cep .ttp .integ_fe (cep.imyo , nX, nG, X, Xg, t, cep.dt , Istim, Ksac, RPAR);
584584
585585 // Electromechanics excitation-activation
586586 if (cem.aStress ) {
587587 double epsX;
588- cep_mod .ttp .actv_strs (X (3 ), cep.dt , yl, epsX);
588+ cep .ttp .actv_strs (X (3 ), cep.dt , yl, epsX);
589589 } else if (cem.aStrain ) {
590- cep_mod .ttp .actv_strn (X (3 ), I4f, cep.dt , yl);
590+ cep .ttp .actv_strn (X (3 ), I4f, cep.dt , yl);
591591 }
592592 }
593593 } break ;
@@ -602,14 +602,14 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
602602 Istim = 0.0 ;
603603 }
604604
605- cep_mod .ttp .integ_rk (cep.imyo , nX, nG, X, Xg, t, cep.dt , Istim, Ksac, RPAR);
605+ cep .ttp .integ_rk (cep.imyo , nX, nG, X, Xg, t, cep.dt , Istim, Ksac, RPAR);
606606
607607 // Electromechanics excitation-activation
608608 if (cem.aStress ) {
609609 double epsX;
610- cep_mod .ttp .actv_strs (X (3 ), cep.dt , yl, epsX);
610+ cep .ttp .actv_strs (X (3 ), cep.dt , yl, epsX);
611611 } else if (cem.aStrain ) {
612- cep_mod .ttp .actv_strn (X (3 ), I4f, cep.dt , yl);
612+ cep .ttp .actv_strn (X (3 ), I4f, cep.dt , yl);
613613 }
614614 }
615615 } break ;
@@ -624,14 +624,14 @@ void cep_integ_l(CepMod& cep_mod, cepModelType& cep, int nX, int nG, Vector<doub
624624 Istim = 0.0 ;
625625 }
626626
627- cep_mod .ttp .integ_cn2 (cep.imyo , nX, nG, X, Xg, t, cep.dt , Istim, Ksac, IPAR, RPAR);
627+ cep .ttp .integ_cn2 (cep.imyo , nX, nG, X, Xg, t, cep.dt , Istim, Ksac, IPAR, RPAR);
628628
629629 // Electromechanics excitation-activation
630630 if (cem.aStress ) {
631631 double epsX;
632- cep_mod .ttp .actv_strs (X (3 ), cep.dt , yl, epsX);
632+ cep .ttp .actv_strs (X (3 ), cep.dt , yl, epsX);
633633 } else if (cem.aStrain ) {
634- cep_mod .ttp .actv_strn (X (3 ), I4f, cep.dt , yl);
634+ cep .ttp .actv_strn (X (3 ), I4f, cep.dt , yl);
635635 }
636636 }
637637 } break ;
0 commit comments