CEPS  24.01
Cardiac ElectroPhysiology Simulator
BR77.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 
49 class BR77 : public AbstractIonicModel
50 {
51 
52  public:
53 
55  BR77(
56  Unknown* u,
57  AbstractPdeProblem* pb,
58  const CepsSet<CepsAttribute>& attrs={},
59  InputParameters* params=nullptr
60  );
61 
63  ~BR77() = default;
64 
66  void
67  getInitialCondition(CepsReal* v, CepsReal* y) const final;
68 
70  void
72  CepsReal t,
73  CepsReal* y,
74  CepsReal* v,
75  CepsReal* dtyL,
76  CepsReal* dtyNL,
77  CepsReal* dtv,
78  DegreeOfFreedom* dof
79  ) const override;
80 
82  CepsReal
83  convertCurrentFromCepsUnit(const CepsReal& v) const final;
84 
86  CepsReal
87  convertCmFromCepsUnit(const CepsReal& cm) const final;
88 
90  CepsReal
91  convertCmToCepsUnit(const CepsReal& cm) const final;
92 
93 
94  protected:
95 
97  void
99 
101  virtual CepsReal
102  getINa(CepsReal* y, CepsReal gNaCa, CepsReal gNa, CepsReal v) const;
103 
104  protected:
105 
108 
109  // aliases for model contants
110  static constexpr const CepsInt _gS = 0;
111  static constexpr const CepsInt _ENa = 1;
112 
113  // aliases for state vars
114  static constexpr const CepsInt _m = 0;
115  static constexpr const CepsInt _h = 1;
116  static constexpr const CepsInt _j = 2;
117  static constexpr const CepsInt _CaI = 3;
118  static constexpr const CepsInt _d = 4;
119  static constexpr const CepsInt _f = 5;
120  static constexpr const CepsInt _x1 = 6;
121 };
122 
124 // too large currents
125 class BR77Modified : public BR77
126 {
127 
128  public:
129 
131  BR77Modified(
132  Unknown* u,
133  AbstractPdeProblem* pb,
134  const CepsSet<CepsAttribute>& attrs={},
135  InputParameters* params=nullptr
136  );
137 
138  protected:
139 
141  void
143 
145  virtual CepsReal
146  getINa(CepsReal* y, CepsReal gNaCa, CepsReal gNa, CepsReal v) const override;
147 
148  protected:
149 
150  // aliases for model contants
151  static constexpr const CepsInt _vA = 2;
152  static constexpr const CepsInt _vB = 3;
153 
154 
155 
156 };
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.
Base class for creating PDEs to solve.
Beeler Reuter model with bounded iNa current to avoid diverging solution because of.
Definition: BR77.hpp:126
static constexpr const CepsInt _vB
Maximum voltage above which current is bounded.
Definition: BR77.hpp:152
virtual CepsReal getINa(CepsReal *y, CepsReal gNaCa, CepsReal gNa, CepsReal v) const override
Returns the bounded current I_Na BR current.
Definition: BR77.cpp:266
BR77Modified(Unknown *u, AbstractPdeProblem *pb, const CepsSet< CepsAttribute > &attrs={}, InputParameters *params=nullptr)
Constructor (sets constants)
Definition: BR77.cpp:229
void setupWithParameters(InputParameters *p, FunctionDictionary *dico, AbstractPdeProblem *pb)
Sets the constants and the space dependant parameters from text inputs.
Definition: BR77.cpp:258
static constexpr const CepsInt _vA
Minimum voltage below which current is bounded.
Definition: BR77.hpp:151
Beeler Reuter (1977) ionic model.
Definition: BR77.hpp:50
static constexpr const CepsInt _ENa
Index alias.
Definition: BR77.hpp:111
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: BR77.cpp:107
static constexpr const CepsInt _CaI
Index alias.
Definition: BR77.hpp:117
ScalarField< DegreeOfFreedom > * m_gNa
This parameter may vary with space.
Definition: BR77.hpp:106
static constexpr const CepsInt _f
Index alias.
Definition: BR77.hpp:119
void setupWithParameters(InputParameters *p, FunctionDictionary *dico, AbstractPdeProblem *pb)
Sets the constants and the space dependant parameters from text inputs.
Definition: BR77.cpp:207
CepsReal convertCmFromCepsUnit(const CepsReal &cm) const final
Convert capacitance from ceps units (uF/cm2) to ionic model units. Does nothing by default.
Definition: BR77.cpp:201
CepsReal convertCurrentFromCepsUnit(const CepsReal &v) const final
Convert from muA per cm2 to muA per mm2.
Definition: BR77.cpp:189
BR77(Unknown *u, AbstractPdeProblem *pb, const CepsSet< CepsAttribute > &attrs={}, InputParameters *params=nullptr)
Constructor (sets constants)
Definition: BR77.cpp:33
void getInitialCondition(CepsReal *v, CepsReal *y) const final
Sets initial values of state variables and transmembrane voltage for a single point....
Definition: BR77.cpp:94
virtual CepsReal getINa(CepsReal *y, CepsReal gNaCa, CepsReal gNa, CepsReal v) const
Returns the iNa current.
Definition: BR77.cpp:222
static constexpr const CepsInt _m
Index alias.
Definition: BR77.hpp:114
CepsReal convertCmToCepsUnit(const CepsReal &cm) const final
Convert capacitance from ionic model units to ceps units (uF/cm2). Does nothing by default.
Definition: BR77.cpp:195
static constexpr const CepsInt _h
Index alias.
Definition: BR77.hpp:115
ScalarField< DegreeOfFreedom > * m_gNaCa
This parameter may vary with space.
Definition: BR77.hpp:107
~BR77()=default
Destructor.
static constexpr const CepsInt _j
Index alias.
Definition: BR77.hpp:116
static constexpr const CepsInt _d
Index alias.
Definition: BR77.hpp:118
static constexpr const CepsInt _x1
Index alias.
Definition: BR77.hpp:120
static constexpr const CepsInt _gS
Index alias.
Definition: BR77.hpp:110
A degree of freedom for any kind of problem The dof can be associated to a geometrical element or not...
A Field is an object wrapped around a SAFunc functor, defined on at least one domain.
Definition: Field.hpp:80
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