CEPS  24.01
Cardiac ElectroPhysiology Simulator
ORdmD16.hpp
Go to the documentation of this file.
1 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2  This file is part of CEPS.
3 
4  CEPS is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  CEPS is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with CEPS (see file LICENSE at root of project).
16  If not, see <https://www.gnu.org/licenses/>.
17 
18 
19  Copyright 2019-2024 Inria, Universite de Bordeaux
20 
21  Authors, in alphabetical order:
22 
23  Pierre-Elliott BECUE, Florian CARO, Yves COUDIERE(*), Andjela DAVIDOVIC,
24  Charlie DOUANLA-LONTSI, Marc FUENTES, Mehdi JUHOOR, Michael LEGUEBE(*),
25  Pauline MIGERDITICHAN, Valentin PANNETIER(*), Nejib ZEMZEMI.
26  * : currently active authors
27 
28 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
30 #pragma once
31 
34 
46 {
47 
48  public:
49 
51  enum class Type
52  {
53  Endo,
54  MidMyo,
55  Epi
56  };
57 
59  ORdmD16(
60  const Type& type,
61  Unknown* u,
62  const CepsSet<CepsAttribute>& attrs={},
63  InputParameters* params=nullptr
64  );
65 
67  ~ORdmD16() = default;
68 
70  void
71  getInitialCondition(CepsReal* v, CepsReal* y) const final;
72 
74  void
76  CepsReal t,
77  CepsReal* y,
78  CepsReal* v,
79  CepsReal* dtyL,
80  CepsReal* dtyNL,
81  CepsReal* dtv,
82  DegreeOfFreedom* dof
83  ) const override;
84 
85 
86  protected:
87 
89  void
91 
93  void
94  computeINa(
95  CepsReal* INa, CepsReal* iNaL, CepsReal v, CepsReal* y,
96  CepsReal* dtyLin, CepsReal* dtyNLin, CepsReal fraction
97  ) const;
98 
100  void
101  computeIto(
102  CepsReal* Ito, CepsReal v, CepsReal* y,
103  CepsReal* dtyLin, CepsReal* dtyNLin, CepsReal fraction
104  ) const;
105 
107  void
108  computeICa(
109  CepsReal* ICaL, CepsReal* ICaNa, CepsReal* ICaK, CepsReal v, CepsReal* y,
110  CepsReal* dtyLin, CepsReal* dtyNLin, CepsReal fraction
111  ) const;
112 
114  void
115  computeIKr(CepsReal* IKr, CepsReal v, CepsReal* y, CepsReal* dtyLin, CepsReal* dtyNLin) const;
116 
118  void
119  computeIKs(CepsReal* IKs, CepsReal v, CepsReal* y, CepsReal* dtyLin, CepsReal* dtyNLin) const;
120 
122  void
123  computeIK1(CepsReal* IK1, CepsReal v, CepsReal* y, CepsReal* dtyLin, CepsReal* dtyNLin) const;
124 
126  void
127  computeINaCa(CepsReal* INaCa_i, CepsReal* INaCa_ss, CepsReal v, CepsReal* y) const;
128 
130  CepsReal
132 
134  void
135  computeINaK(CepsReal* INaK, CepsReal v, CepsReal* y) const;
136 
138  void
139  computeBgCurrents(CepsReal* IKb, CepsReal* INab, CepsReal* ICab, CepsReal v, CepsReal* y) const;
140 
142  void
143  computeIPCa(CepsReal* IPCa, CepsReal* y) const;
144 
146  void
147  computeJrel(
148  CepsReal* Jrel, CepsReal ICaL, CepsReal* y,
149  CepsReal* dtyLin, CepsReal* dtyNLin, CepsReal fraction
150  ) const;
151 
153  void
154  computeJup(CepsReal* Jup, CepsReal* y, CepsReal fraction) const;
155 
156 
157  protected:
158 
160 
161  // aliases for state vars
162  static constexpr const CepsInt _nai = 0 ;
163  static constexpr const CepsInt _nass = 1 ;
164  static constexpr const CepsInt _ki = 2 ;
165  static constexpr const CepsInt _kss = 3 ;
166  static constexpr const CepsInt _cai = 4 ;
167  static constexpr const CepsInt _cass = 5 ;
168  static constexpr const CepsInt _cansr = 6 ;
169  static constexpr const CepsInt _cajsr = 7 ;
170  static constexpr const CepsInt _m = 8 ;
171  static constexpr const CepsInt _hf = 9 ;
172  static constexpr const CepsInt _hs = 10;
173  static constexpr const CepsInt _j = 11;
174  static constexpr const CepsInt _hsp = 12;
175  static constexpr const CepsInt _jp = 13;
176  static constexpr const CepsInt _mL = 14;
177  static constexpr const CepsInt _hL = 15;
178  static constexpr const CepsInt _hLp = 16;
179  static constexpr const CepsInt _a = 17;
180  static constexpr const CepsInt _iF = 18;
181  static constexpr const CepsInt _iS = 19;
182  static constexpr const CepsInt _ap = 20;
183  static constexpr const CepsInt _iFp = 21;
184  static constexpr const CepsInt _iSp = 22;
185  static constexpr const CepsInt _d = 23;
186  static constexpr const CepsInt _ff = 24;
187  static constexpr const CepsInt _fs = 25;
188  static constexpr const CepsInt _fcaf = 26;
189  static constexpr const CepsInt _fcas = 27;
190  static constexpr const CepsInt _jca = 28;
191  static constexpr const CepsInt _nca = 29;
192  static constexpr const CepsInt _ffp = 30;
193  static constexpr const CepsInt _fcafp = 31;
194  static constexpr const CepsInt _xrf = 32;
195  static constexpr const CepsInt _xrs = 33;
196  static constexpr const CepsInt _xs1 = 34;
197  static constexpr const CepsInt _xs2 = 35;
198  static constexpr const CepsInt _xk1 = 36;
199  static constexpr const CepsInt _Jrelnp = 37;
200  static constexpr const CepsInt _Jrelp = 38;
201  static constexpr const CepsInt _CaMKt = 39;
202 
203  // Indices for constants
204  static constexpr const CepsInt _IKr_factor = 0 ;
205  static constexpr const CepsInt _IKs_factor = 1 ;
206  static constexpr const CepsInt _IK1_factor = 2 ;
207  static constexpr const CepsInt _ICaL_factor = 3 ;
208  static constexpr const CepsInt _INaL_factor = 4 ;
209  static constexpr const CepsInt _nao = 5 ;
210  static constexpr const CepsInt _cao = 6 ;
211  static constexpr const CepsInt _ko = 7 ;
212  static constexpr const CepsInt _R = 8 ;
213  static constexpr const CepsInt _T = 9 ;
214  static constexpr const CepsInt _F = 10 ;
215  static constexpr const CepsInt _L = 11 ;
216  static constexpr const CepsInt _rad = 12 ;
217  static constexpr const CepsInt _vmyo_fraction = 13 ;
218  static constexpr const CepsInt _vnsr_fraction = 14 ;
219  static constexpr const CepsInt _vjsr_fraction = 15 ;
220  static constexpr const CepsInt _vss_fraction = 16 ;
221  static constexpr const CepsInt _drug = 17 ;
222  static constexpr const CepsInt _ICNa = 18 ;
223  static constexpr const CepsInt _hNa = 19 ;
224  static constexpr const CepsInt _ICNaL = 20 ;
225  static constexpr const CepsInt _hNaL = 21 ;
226  static constexpr const CepsInt _ICto = 22 ;
227  static constexpr const CepsInt _hto = 23 ;
228  static constexpr const CepsInt _ICCal = 24 ;
229  static constexpr const CepsInt _hCal = 25 ;
230  static constexpr const CepsInt _ICKr = 26 ;
231  static constexpr const CepsInt _hKr = 27 ;
232  static constexpr const CepsInt _ICKs = 28 ;
233  static constexpr const CepsInt _hKs = 29 ;
234  static constexpr const CepsInt _ICK1 = 30 ;
235  static constexpr const CepsInt _hK1 = 31 ;
236  static constexpr const CepsInt _PKNa = 32 ;
237 
238  // Indices for deduced constants
239  static constexpr const CepsInt _vcell = 0 ;
240  static constexpr const CepsInt _ageo = 1 ;
241  static constexpr const CepsInt _acap = 2 ;
242  static constexpr const CepsInt _vmyo = 3 ;
243  static constexpr const CepsInt _vnsr = 4 ;
244  static constexpr const CepsInt _vjsr = 5 ;
245  static constexpr const CepsInt _vss = 6 ;
246  static constexpr const CepsInt _FRT = 7 ;
247  static constexpr const CepsInt _gNaFrac = 8 ;
248  static constexpr const CepsInt _gNaLFrac = 9 ;
249  static constexpr const CepsInt _gtoFrac = 10 ;
250  static constexpr const CepsInt _gCalFrac = 11 ;
251  static constexpr const CepsInt _gKrFrac = 12 ;
252  static constexpr const CepsInt _gKsFrac = 13 ;
253  static constexpr const CepsInt _gK1Frac = 14 ;
254 
255 
256 };
std::set< _Type, _Compare, _Alloc > CepsSet
C++ set.
Definition: CepsTypes.hpp:209
float CepsReal
Need single precision floating point.
Definition: CepsTypes.hpp:100
int32_t CepsInt
Need 32 bit integer.
Definition: CepsTypes.hpp:106
Represents a ionic model for a group of cells, i.e. multiple systems of ODEs.
A degree of freedom for any kind of problem The dof can be associated to a geometrical element or not...
Reads and stores simulation configuration.
O'Hara - Rudy CiPA v1.0 (2017) ionic model.
Definition: ORdmD16.hpp:46
static constexpr const CepsInt _vnsr
Index alias.
Definition: ORdmD16.hpp:243
void computeBgCurrents(CepsReal *IKb, CepsReal *INab, CepsReal *ICab, CepsReal v, CepsReal *y) const
Background currents.
Definition: ORdmD16.cpp:833
static constexpr const CepsInt _hLp
Index alias.
Definition: ORdmD16.hpp:178
static constexpr const CepsInt _R
Index alias.
Definition: ORdmD16.hpp:212
void computeIKr(CepsReal *IKr, CepsReal v, CepsReal *y, CepsReal *dtyLin, CepsReal *dtyNLin) const
Rapid Delayed Rectifier K+ Current.
Definition: ORdmD16.cpp:607
static constexpr const CepsInt _ICK1
Index alias.
Definition: ORdmD16.hpp:234
static constexpr const CepsInt _hs
Index alias.
Definition: ORdmD16.hpp:172
static constexpr const CepsInt _hNaL
Index alias.
Definition: ORdmD16.hpp:225
static constexpr const CepsInt _xs2
Index alias.
Definition: ORdmD16.hpp:197
void setupWithParameters(InputParameters *p)
Sets the constants and the space dependant parameters from text inputs.
Definition: ORdmD16.cpp:353
static constexpr const CepsInt _T
Index alias.
Definition: ORdmD16.hpp:213
void computeICa(CepsReal *ICaL, CepsReal *ICaNa, CepsReal *ICaK, CepsReal v, CepsReal *y, CepsReal *dtyLin, CepsReal *dtyNLin, CepsReal fraction) const
L-type Ca2+ channel.
Definition: ORdmD16.cpp:518
static constexpr const CepsInt _acap
Index alias.
Definition: ORdmD16.hpp:241
static constexpr const CepsInt _hK1
Index alias.
Definition: ORdmD16.hpp:235
static constexpr const CepsInt _vcell
Index alias.
Definition: ORdmD16.hpp:239
static constexpr const CepsInt _hf
Index alias.
Definition: ORdmD16.hpp:171
static constexpr const CepsInt _gtoFrac
Index alias.
Definition: ORdmD16.hpp:249
static constexpr const CepsInt _ko
Index alias.
Definition: ORdmD16.hpp:211
static constexpr const CepsInt _ICCal
Index alias.
Definition: ORdmD16.hpp:228
static constexpr const CepsInt _gNaFrac
Index alias.
Definition: ORdmD16.hpp:247
static constexpr const CepsInt _j
Index alias.
Definition: ORdmD16.hpp:173
static constexpr const CepsInt _cass
Index alias.
Definition: ORdmD16.hpp:167
static constexpr const CepsInt _d
Index alias.
Definition: ORdmD16.hpp:185
static constexpr const CepsInt _nass
Index alias.
Definition: ORdmD16.hpp:163
static constexpr const CepsInt _IKs_factor
Index alias.
Definition: ORdmD16.hpp:205
void computeIto(CepsReal *Ito, CepsReal v, CepsReal *y, CepsReal *dtyLin, CepsReal *dtyNLin, CepsReal fraction) const
Transient outward K+ current.
Definition: ORdmD16.cpp:464
static constexpr const CepsInt _kss
Index alias.
Definition: ORdmD16.hpp:165
CepsReal computeINaCaInternal(CepsReal v, CepsReal na, CepsReal ca) const
Internal function to avoid duplication.
Definition: ORdmD16.cpp:708
static constexpr const CepsInt _ICNaL
Index alias.
Definition: ORdmD16.hpp:224
static constexpr const CepsInt _FRT
Index alias.
Definition: ORdmD16.hpp:246
void computeINaK(CepsReal *INaK, CepsReal v, CepsReal *y) const
Sodium/Potassium ATPase Current.
Definition: ORdmD16.cpp:773
static constexpr const CepsInt _a
Index alias.
Definition: ORdmD16.hpp:179
static constexpr const CepsInt _iF
Index alias.
Definition: ORdmD16.hpp:180
static constexpr const CepsInt _gCalFrac
Index alias.
Definition: ORdmD16.hpp:250
static constexpr const CepsInt _xrs
Index alias.
Definition: ORdmD16.hpp:195
static constexpr const CepsInt _hKs
Index alias.
Definition: ORdmD16.hpp:233
static constexpr const CepsInt _vnsr_fraction
Index alias.
Definition: ORdmD16.hpp:218
static constexpr const CepsInt _vjsr_fraction
Index alias.
Definition: ORdmD16.hpp:219
static constexpr const CepsInt _cajsr
Index alias.
Definition: ORdmD16.hpp:169
void computeJrel(CepsReal *Jrel, CepsReal ICaL, CepsReal *y, CepsReal *dtyLin, CepsReal *dtyNLin, CepsReal fraction) const
SR Calcium Release Flux, via Ryanodine Receptor.
Definition: ORdmD16.cpp:862
static constexpr const CepsInt _fcaf
Index alias.
Definition: ORdmD16.hpp:188
static constexpr const CepsInt _vjsr
Index alias.
Definition: ORdmD16.hpp:244
static constexpr const CepsInt _ff
Index alias.
Definition: ORdmD16.hpp:186
void getInitialCondition(CepsReal *v, CepsReal *y) const final
Sets initial values of state variables and transmembrane voltage for a single point....
Definition: ORdmD16.cpp:163
static constexpr const CepsInt _gNaLFrac
Index alias.
Definition: ORdmD16.hpp:248
static constexpr const CepsInt _hsp
Index alias.
Definition: ORdmD16.hpp:174
static constexpr const CepsInt _xs1
Index alias.
Definition: ORdmD16.hpp:196
static constexpr const CepsInt _vss
Index alias.
Definition: ORdmD16.hpp:245
static constexpr const CepsInt _gK1Frac
Index alias.
Definition: ORdmD16.hpp:253
static constexpr const CepsInt _fcas
Index alias.
Definition: ORdmD16.hpp:189
static constexpr const CepsInt _nca
Index alias.
Definition: ORdmD16.hpp:191
static constexpr const CepsInt _iFp
Index alias.
Definition: ORdmD16.hpp:183
static constexpr const CepsInt _ICKs
Index alias.
Definition: ORdmD16.hpp:232
static constexpr const CepsInt _iS
Index alias.
Definition: ORdmD16.hpp:181
static constexpr const CepsInt _nao
Index alias.
Definition: ORdmD16.hpp:209
static constexpr const CepsInt _rad
Index alias.
Definition: ORdmD16.hpp:216
static constexpr const CepsInt _IKr_factor
Index alias.
Definition: ORdmD16.hpp:204
Type m_type
Celltype selector (endo, epi, midmyo)
Definition: ORdmD16.hpp:159
static constexpr const CepsInt _CaMKt
Index alias.
Definition: ORdmD16.hpp:201
static constexpr const CepsInt _ICNa
Index alias.
Definition: ORdmD16.hpp:222
static constexpr const CepsInt _fcafp
Index alias.
Definition: ORdmD16.hpp:193
static constexpr const CepsInt _ffp
Index alias.
Definition: ORdmD16.hpp:192
static constexpr const CepsInt _ICKr
Index alias.
Definition: ORdmD16.hpp:230
static constexpr const CepsInt _vmyo
Index alias.
Definition: ORdmD16.hpp:242
static constexpr const CepsInt _mL
Index alias.
Definition: ORdmD16.hpp:176
static constexpr const CepsInt _Jrelnp
Index alias.
Definition: ORdmD16.hpp:199
static constexpr const CepsInt _ki
Index alias.
Definition: ORdmD16.hpp:164
static constexpr const CepsInt _nai
Index alias.
Definition: ORdmD16.hpp:162
static constexpr const CepsInt _jca
Index alias.
Definition: ORdmD16.hpp:190
void computeINa(CepsReal *INa, CepsReal *iNaL, CepsReal v, CepsReal *y, CepsReal *dtyLin, CepsReal *dtyNLin, CepsReal fraction) const
Fast Na+ current and Late Na+ current.
Definition: ORdmD16.cpp:395
static constexpr const CepsInt _gKrFrac
Index alias.
Definition: ORdmD16.hpp:251
static constexpr const CepsInt _hto
Index alias.
Definition: ORdmD16.hpp:227
static constexpr const CepsInt _hCal
Index alias.
Definition: ORdmD16.hpp:229
static constexpr const CepsInt _m
Index alias.
Definition: ORdmD16.hpp:170
static constexpr const CepsInt _Jrelp
Index alias.
Definition: ORdmD16.hpp:200
static constexpr const CepsInt _ap
Index alias.
Definition: ORdmD16.hpp:182
~ORdmD16()=default
Destructor.
static constexpr const CepsInt _vmyo_fraction
Index alias.
Definition: ORdmD16.hpp:217
static constexpr const CepsInt _ICto
Index alias.
Definition: ORdmD16.hpp:226
static constexpr const CepsInt _INaL_factor
Index alias.
Definition: ORdmD16.hpp:208
static constexpr const CepsInt _xrf
Index alias.
Definition: ORdmD16.hpp:194
static constexpr const CepsInt _hNa
Index alias.
Definition: ORdmD16.hpp:223
void computeIPCa(CepsReal *IPCa, CepsReal *y) const
Sarsolemmal calcium pump current.
Definition: ORdmD16.cpp:855
static constexpr const CepsInt _vss_fraction
Index alias.
Definition: ORdmD16.hpp:220
ORdmD16(const Type &type, Unknown *u, const CepsSet< CepsAttribute > &attrs={}, InputParameters *params=nullptr)
Constructor (sets constants)
Definition: ORdmD16.cpp:40
static constexpr const CepsInt _gKsFrac
Index alias.
Definition: ORdmD16.hpp:252
static constexpr const CepsInt _cao
Index alias.
Definition: ORdmD16.hpp:210
static constexpr const CepsInt _cansr
Index alias.
Definition: ORdmD16.hpp:168
void computeJup(CepsReal *Jup, CepsReal *y, CepsReal fraction) const
Calcium Uptake via SERCA Pump.
Definition: ORdmD16.cpp:894
Type
Model variant selector.
Definition: ORdmD16.hpp:52
@ Epi
Model variant selector.
@ MidMyo
Model variant selector.
@ Endo
Model variant selector.
static constexpr const CepsInt _ageo
Index alias.
Definition: ORdmD16.hpp:240
static constexpr const CepsInt _IK1_factor
Index alias.
Definition: ORdmD16.hpp:206
static constexpr const CepsInt _jp
Index alias.
Definition: ORdmD16.hpp:175
static constexpr const CepsInt _xk1
Index alias.
Definition: ORdmD16.hpp:198
static constexpr const CepsInt _hKr
Index alias.
Definition: ORdmD16.hpp:231
static constexpr const CepsInt _L
Index alias.
Definition: ORdmD16.hpp:215
void computeIKs(CepsReal *IKs, CepsReal v, CepsReal *y, CepsReal *dtyLin, CepsReal *dtyNLin) const
Slow Delayed Rectifier K+ Current.
Definition: ORdmD16.cpp:640
static constexpr const CepsInt _ICaL_factor
Index alias.
Definition: ORdmD16.hpp:207
static constexpr const CepsInt _fs
Index alias.
Definition: ORdmD16.hpp:187
static constexpr const CepsInt _F
Index alias.
Definition: ORdmD16.hpp:214
static constexpr const CepsInt _drug
Index alias.
Definition: ORdmD16.hpp:221
void computeRates(CepsReal t, CepsReal *y, CepsReal *v, CepsReal *dtyL, CepsReal *dtyNL, CepsReal *dtv, DegreeOfFreedom *dof) const override
Get the linear and non linear part of the evolution function f. Also computes the ionic current.
Definition: ORdmD16.cpp:209
void computeINaCa(CepsReal *INaCa_i, CepsReal *INaCa_ss, CepsReal v, CepsReal *y) const
Na+/Ca2+ exchanger.
Definition: ORdmD16.cpp:700
static constexpr const CepsInt _PKNa
Index alias.
Definition: ORdmD16.hpp:236
void computeIK1(CepsReal *IK1, CepsReal v, CepsReal *y, CepsReal *dtyLin, CepsReal *dtyNLin) const
Inward Rectifier K+ Current.
Definition: ORdmD16.cpp:672
static constexpr const CepsInt _hL
Index alias.
Definition: ORdmD16.hpp:177
static constexpr const CepsInt _iSp
Index alias.
Definition: ORdmD16.hpp:184
static constexpr const CepsInt _cai
Index alias.
Definition: ORdmD16.hpp:166
A class used to defined an unknown of a PDE problem The unknown can be defined on a specific region,...
Definition: Unknown.hpp:45