CEPS  24.01
Cardiac ElectroPhysiology Simulator
CRN98.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 
47 class CRN98 : public AbstractIonicModel
48 {
49 
50  public :
51 
53  CRN98(
54  Unknown* u,
55  const CepsSet<CepsAttribute>& attrs={},
56  InputParameters* params=nullptr
57  );
58 
60  virtual ~CRN98() = default;
61 
63  void
64  getInitialCondition(CepsReal* v, CepsReal* y) const final;
65 
67  void
69  CepsReal t,
70  CepsReal* y,
71  CepsReal* v,
72  CepsReal* dtyL,
73  CepsReal* dtyNL,
74  CepsReal* dtv,
75  DegreeOfFreedom* dof
76  ) const final;
77 
79  CepsReal
80  convertCurrentFromCepsUnit(const CepsReal& i) const override;
81 
83  CepsReal
84  convertCmFromCepsUnit(const CepsReal& cm) const override;
85 
87  CepsReal
88  convertCmToCepsUnit(const CepsReal& cm) const override;
89 
90 
91  protected:
92 
94  void
96 
97 
98  protected :
99 
101 
102  // aliases for constants
103  static constexpr const CepsInt _R = 0;
104  static constexpr const CepsInt _T = 1;
105  static constexpr const CepsInt _F = 2;
106  static constexpr const CepsInt _vcell = 3;
107  static constexpr const CepsInt _vi = 4;
108  static constexpr const CepsInt _vup = 5;
109  static constexpr const CepsInt _vrel = 6;
110  static constexpr const CepsInt _ko = 7;
111  static constexpr const CepsInt _nao = 8;
112  static constexpr const CepsInt _cao = 9;
113  static constexpr const CepsInt _gna = 10;
114  static constexpr const CepsInt _gk1 = 11;
115  static constexpr const CepsInt _gto = 12;
116  static constexpr const CepsInt _gkr = 13;
117  static constexpr const CepsInt _gks = 14;
118  static constexpr const CepsInt _gcal = 15;
119  static constexpr const CepsInt _gbca = 16;
120  static constexpr const CepsInt _gbna = 17;
121  static constexpr const CepsInt _inakmax = 18;
122  static constexpr const CepsInt _inacamax = 19;
123  static constexpr const CepsInt _icapmax = 20;
124  static constexpr const CepsInt _iupmax = 21;
125  static constexpr const CepsInt _kq10 = 22;
126  static constexpr const CepsInt _sigma = 23;
127  static constexpr const CepsInt _kmnai = 24;
128  static constexpr const CepsInt _kmko = 25;
129  static constexpr const CepsInt _kmna = 26;
130  static constexpr const CepsInt _kmca = 27;
131  static constexpr const CepsInt _ksat = 28;
132  static constexpr const CepsInt _krel = 29;
133  static constexpr const CepsInt _kup = 30;
134  static constexpr const CepsInt _caupmax = 31;
135  static constexpr const CepsInt _cmdnmax = 32;
136  static constexpr const CepsInt _trpnmax = 33;
137  static constexpr const CepsInt _csqnmax = 34;
138  static constexpr const CepsInt _kmcmdn = 35;
139  static constexpr const CepsInt _kmtrpn = 36;
140  static constexpr const CepsInt _kmcsqn = 37;
141  static constexpr const CepsInt _taufca = 38;
142  static constexpr const CepsInt _tautr = 39;
143  static constexpr const CepsInt _gbk = 40;
144  static constexpr const CepsInt _gamma = 41;
145  static constexpr const CepsInt _tauu = 42;
146 
147  // State var indices, same order as cellml
148  static constexpr const CepsInt _nai = 0;
149  static constexpr const CepsInt _m = 1;
150  static constexpr const CepsInt _h = 2;
151  static constexpr const CepsInt _j = 3;
152  static constexpr const CepsInt _ki = 4;
153  static constexpr const CepsInt _oa = 5;
154  static constexpr const CepsInt _oi = 6;
155  static constexpr const CepsInt _ua = 7;
156  static constexpr const CepsInt _ui = 8;
157  static constexpr const CepsInt _xr = 9;
158  static constexpr const CepsInt _xs = 10;
159  static constexpr const CepsInt _cai = 11;
160  static constexpr const CepsInt _d = 12;
161  static constexpr const CepsInt _f = 13;
162  static constexpr const CepsInt _fca = 14;
163  static constexpr const CepsInt _carel = 15;
164  static constexpr const CepsInt _u = 16;
165  static constexpr const CepsInt _v = 17;
166  static constexpr const CepsInt _w = 18;
167  static constexpr const CepsInt _caup = 19;
168 
169 };
170 
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.
Courtemanche-Ramirez-Nattel ionic model.
Definition: CRN98.hpp:48
static constexpr const CepsInt _ua
Index alias.
Definition: CRN98.hpp:155
CRN98(Unknown *u, const CepsSet< CepsAttribute > &attrs={}, InputParameters *params=nullptr)
Constructor (sets constants)
Definition: CRN98.cpp:33
static constexpr const CepsInt _h
Index alias.
Definition: CRN98.hpp:150
static constexpr const CepsInt _F
Index alias.
Definition: CRN98.hpp:105
static constexpr const CepsInt _f
Index alias.
Definition: CRN98.hpp:161
static constexpr const CepsInt _vrel
Index alias.
Definition: CRN98.hpp:109
static constexpr const CepsInt _gkr
Index alias.
Definition: CRN98.hpp:116
static constexpr const CepsInt _kmcsqn
Index alias.
Definition: CRN98.hpp:140
void getInitialCondition(CepsReal *v, CepsReal *y) const final
Sets initial values of state variables and transmembrane voltage for a single point....
Definition: CRN98.cpp:128
void computeRates(CepsReal t, CepsReal *y, CepsReal *v, CepsReal *dtyL, CepsReal *dtyNL, CepsReal *dtv, DegreeOfFreedom *dof) const final
Get the linear and non linear part of the evolution function f. Also computes the ionic current.
Definition: CRN98.cpp:154
static constexpr const CepsInt _gbna
Index alias.
Definition: CRN98.hpp:120
static constexpr const CepsInt _ui
Index alias.
Definition: CRN98.hpp:156
static constexpr const CepsInt _kmko
Index alias.
Definition: CRN98.hpp:128
static constexpr const CepsInt _kmtrpn
Index alias.
Definition: CRN98.hpp:139
static constexpr const CepsInt _sigma
Index alias.
Definition: CRN98.hpp:126
static constexpr const CepsInt _icapmax
Index alias.
Definition: CRN98.hpp:123
static constexpr const CepsInt _caupmax
Index alias.
Definition: CRN98.hpp:134
CepsReal m_cellSurface
surface used to scale current to CEPS unit.
Definition: CRN98.hpp:100
static constexpr const CepsInt _vup
Index alias.
Definition: CRN98.hpp:108
static constexpr const CepsInt _iupmax
Index alias.
Definition: CRN98.hpp:124
CepsReal convertCmFromCepsUnit(const CepsReal &cm) const override
Convert capacitance from ceps units (uF/cm2) to ionic model units. Does nothing by default.
Definition: CRN98.cpp:336
static constexpr const CepsInt _kmnai
Index alias.
Definition: CRN98.hpp:127
static constexpr const CepsInt _xs
Index alias.
Definition: CRN98.hpp:158
static constexpr const CepsInt _T
Index alias.
Definition: CRN98.hpp:104
static constexpr const CepsInt _R
Index alias.
Definition: CRN98.hpp:103
static constexpr const CepsInt _xr
Index alias.
Definition: CRN98.hpp:157
static constexpr const CepsInt _gna
Index alias.
Definition: CRN98.hpp:113
static constexpr const CepsInt _v
Index alias.
Definition: CRN98.hpp:165
static constexpr const CepsInt _kq10
Index alias.
Definition: CRN98.hpp:125
static constexpr const CepsInt _nao
Index alias.
Definition: CRN98.hpp:111
static constexpr const CepsInt _ki
Index alias.
Definition: CRN98.hpp:152
static constexpr const CepsInt _u
Index alias.
Definition: CRN98.hpp:164
static constexpr const CepsInt _w
Index alias.
Definition: CRN98.hpp:166
static constexpr const CepsInt _cao
Index alias.
Definition: CRN98.hpp:112
static constexpr const CepsInt _vcell
Index alias.
Definition: CRN98.hpp:106
static constexpr const CepsInt _vi
Index alias.
Definition: CRN98.hpp:107
static constexpr const CepsInt _tauu
Index alias.
Definition: CRN98.hpp:145
static constexpr const CepsInt _oi
Index alias.
Definition: CRN98.hpp:154
static constexpr const CepsInt _gto
Index alias.
Definition: CRN98.hpp:115
static constexpr const CepsInt _j
Index alias.
Definition: CRN98.hpp:151
void setupWithParameters(InputParameters *p, FunctionDictionary *dico)
Sets the constants and the space dependant parameters from text inputs.
Definition: CRN98.cpp:348
static constexpr const CepsInt _nai
Index alias.
Definition: CRN98.hpp:148
virtual ~CRN98()=default
Destructor.
static constexpr const CepsInt _cai
Index alias.
Definition: CRN98.hpp:159
static constexpr const CepsInt _gks
Index alias.
Definition: CRN98.hpp:117
static constexpr const CepsInt _kmna
Index alias.
Definition: CRN98.hpp:129
static constexpr const CepsInt _gk1
Index alias.
Definition: CRN98.hpp:114
static constexpr const CepsInt _tautr
Index alias.
Definition: CRN98.hpp:142
static constexpr const CepsInt _krel
Index alias.
Definition: CRN98.hpp:132
static constexpr const CepsInt _d
Index alias.
Definition: CRN98.hpp:160
CepsReal convertCurrentFromCepsUnit(const CepsReal &i) const override
Convert from uA per cm2 to pA.
Definition: CRN98.cpp:330
static constexpr const CepsInt _kmca
Index alias.
Definition: CRN98.hpp:130
static constexpr const CepsInt _gcal
Index alias.
Definition: CRN98.hpp:118
static constexpr const CepsInt _kmcmdn
Index alias.
Definition: CRN98.hpp:138
static constexpr const CepsInt _carel
Index alias.
Definition: CRN98.hpp:163
static constexpr const CepsInt _taufca
Index alias.
Definition: CRN98.hpp:141
static constexpr const CepsInt _ko
Index alias.
Definition: CRN98.hpp:110
static constexpr const CepsInt _kup
Index alias.
Definition: CRN98.hpp:133
CepsReal convertCmToCepsUnit(const CepsReal &cm) const override
Convert capacitance from ionic model units to ceps units (uF/cm2). Does nothing by default.
Definition: CRN98.cpp:342
static constexpr const CepsInt _cmdnmax
Index alias.
Definition: CRN98.hpp:135
static constexpr const CepsInt _csqnmax
Index alias.
Definition: CRN98.hpp:137
static constexpr const CepsInt _inacamax
Index alias.
Definition: CRN98.hpp:122
static constexpr const CepsInt _gbk
Index alias.
Definition: CRN98.hpp:143
static constexpr const CepsInt _inakmax
Index alias.
Definition: CRN98.hpp:121
static constexpr const CepsInt _m
Index alias.
Definition: CRN98.hpp:149
static constexpr const CepsInt _gamma
Index alias.
Definition: CRN98.hpp:144
static constexpr const CepsInt _oa
Index alias.
Definition: CRN98.hpp:153
static constexpr const CepsInt _caup
Index alias.
Definition: CRN98.hpp:167
static constexpr const CepsInt _fca
Index alias.
Definition: CRN98.hpp:162
static constexpr const CepsInt _ksat
Index alias.
Definition: CRN98.hpp:131
static constexpr const CepsInt _trpnmax
Index alias.
Definition: CRN98.hpp:136
static constexpr const CepsInt _gbca
Index alias.
Definition: CRN98.hpp:119
A degree of freedom for any kind of problem The dof can be associated to a geometrical element or not...
FunctionDictionary that holds functions which can be used to define source terms, boundary conditions...
Reads and stores simulation configuration.
A class used to defined an unknown of a PDE problem The unknown can be defined on a specific region,...
Definition: Unknown.hpp:45