CEPS  24.01
Cardiac ElectroPhysiology Simulator
MS03.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 MS03 : public AbstractIonicModel
48 {
49 
50  public :
51 
53  MS03(
54  Unknown* u,
55  const CepsSet<CepsAttribute>& attrs={},
56  InputParameters* params=nullptr
57  );
58 
60  virtual ~MS03() = 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 override;
77 
79  CepsReal
80  convertVoltageToCepsUnit(const CepsReal& u) const override;
81 
83  CepsReal
84  convertVoltageFromCepsUnit(const CepsReal& u) const override;
85 
87  CepsReal
88  convertDtvToCepsUnit(const CepsReal& i) const override;
89 
91  CepsReal
92  convertCurrentFromCepsUnit(const CepsReal& i) const override;
93 
95  CepsReal
96  convertCmFromCepsUnit(const CepsReal& cm) const override;
97 
99  CepsReal
100  convertCmToCepsUnit(const CepsReal& cm) const override;
101 
102 
103  protected:
104 
105 
107  void
109 
110  protected:
111 
115 
118 
119  // alias for gates variables
120  static constexpr const CepsInt _h = 0;
121 
122  // aliases for parameters
123  static constexpr const CepsInt _tauIn = 0;
124  static constexpr const CepsInt _tauOut = 1;
125  static constexpr const CepsInt _tauOpen = 2;
126  static constexpr const CepsInt _tauClose = 3;
127  static constexpr const CepsInt _vGate = 4;
128 
129 };
130 
146 class MS03Modified : public MS03
147 {
148 
149  public :
150 
152  MS03Modified(
153  Unknown* u,
154  const CepsSet<CepsAttribute>& attrs={},
155  InputParameters* params=nullptr
156  );
157 
159  virtual ~MS03Modified() = default;
160 
162  void
163  computeRates(
164  CepsReal t,
165  CepsReal* y,
166  CepsReal* v,
167  CepsReal* dtyL,
168  CepsReal* dtyNL,
169  CepsReal* dtv,
170  DegreeOfFreedom* dof
171  ) const final;
172 
173 
174  protected:
175 
177  void
179 
180  protected:
181 
183  static constexpr const CepsInt _etaGate = 5;
184  static constexpr const CepsInt _vA = 6;
185  static constexpr const CepsInt _vB = 7;
186 
187 };
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...
FunctionDictionary that holds functions which can be used to define source terms, boundary conditions...
Reads and stores simulation configuration.
Mitchell-Schaeffer ionic model, with modification to keep ionic current bounded.
Definition: MS03.hpp:147
void setupWithParameters(InputParameters *p, FunctionDictionary *dico)
Sets the constants and the space dependant parameters from text inputs.
Definition: MS03.cpp:263
MS03Modified(Unknown *u, const CepsSet< CepsAttribute > &attrs={}, InputParameters *params=nullptr)
Constructor (sets constants)
Definition: MS03.cpp:174
CepsReal m_etaGate
Slope in smooth transition hinfty.
Definition: MS03.hpp:182
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: MS03.cpp:207
static constexpr const CepsInt _vB
indexing alias
Definition: MS03.hpp:185
static constexpr const CepsInt _vA
indexing alias
Definition: MS03.hpp:184
virtual ~MS03Modified()=default
Destructor.
static constexpr const CepsInt _etaGate
indexing alias
Definition: MS03.hpp:183
Mitchell-Schaeffer ionic model.
Definition: MS03.hpp:48
static constexpr const CepsInt _h
indexing alias
Definition: MS03.hpp:120
static constexpr const CepsInt _tauOut
indexing alias
Definition: MS03.hpp:124
static constexpr const CepsInt _tauIn
indexing alias
Definition: MS03.hpp:123
CepsReal convertVoltageToCepsUnit(const CepsReal &u) const override
Convert from no unit to mV.
Definition: MS03.cpp:115
CepsReal convertCmToCepsUnit(const CepsReal &cm) const override
Convert capacitance from ionic model units to ceps units (uF/cm2).
Definition: MS03.cpp:145
static constexpr const CepsInt _tauOpen
indexing alias
Definition: MS03.hpp:125
CepsReal m_vMin
lower bound of voltage normalization interval
Definition: MS03.hpp:112
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: MS03.cpp:81
CepsReal m_hInit
Initial condition for h.
Definition: MS03.hpp:117
CepsReal m_cellSurface
surface of a cell used for unit scaling. Default is surface of a cylinder (r=10um,...
Definition: MS03.hpp:114
static constexpr const CepsInt _vGate
indexing alias
Definition: MS03.hpp:127
virtual ~MS03()=default
Destructor.
CepsReal convertCurrentFromCepsUnit(const CepsReal &i) const override
Convert from uA per cm2 to s-1.
Definition: MS03.cpp:127
CepsReal m_vInit
Initial condition for v.
Definition: MS03.hpp:116
void getInitialCondition(CepsReal *v, CepsReal *y) const final
Sets initial values of state variables and transmembrane voltage for a single point....
Definition: MS03.cpp:72
static constexpr const CepsInt _tauClose
indexing alias
Definition: MS03.hpp:126
void setupWithParameters(InputParameters *p, FunctionDictionary *dico)
Sets the constants and the space dependant parameters from text inputs.
Definition: MS03.cpp:151
CepsReal convertDtvToCepsUnit(const CepsReal &i) const override
Convert from s-1 to uA per cm2.
Definition: MS03.cpp:133
CepsReal convertCmFromCepsUnit(const CepsReal &cm) const override
Convert capacitance from ceps units (uF/cm2) to ionic model units.
Definition: MS03.cpp:139
CepsReal convertVoltageFromCepsUnit(const CepsReal &u) const override
Convert from mV to no unit.
Definition: MS03.cpp:121
MS03(Unknown *u, const CepsSet< CepsAttribute > &attrs={}, InputParameters *params=nullptr)
Constructor (sets constants)
Definition: MS03.cpp:32
CepsReal m_vMax
upper bound of voltage normalization interval
Definition: MS03.hpp:113
A class used to defined an unknown of a PDE problem The unknown can be defined on a specific region,...
Definition: Unknown.hpp:45