svMultiPhysics
CepModFn.h
1 /* Copyright (c) Stanford University, The Regents of the University of California, and others.
2  *
3  * All Rights Reserved.
4  *
5  * See Copyright-SimVascular.txt for additional details.
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining
8  * a copy of this software and associated documentation files (the
9  * "Software"), to deal in the Software without restriction, including
10  * without limitation the rights to use, copy, modify, merge, publish,
11  * distribute, sublicense, and/or sell copies of the Software, and to
12  * permit persons to whom the Software is furnished to do so, subject
13  * to the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be included
16  * in all copies or substantial portions of the Software.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
19  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
21  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
22  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #ifndef CEP_MOD_FN_H
32 #define CEP_MOD_FN_H
33 
34 #include "Array.h"
35 #include "Vector.h"
36 
37 /// @brief This module defines data structures for Fitzhugh-Nagumo cellular
38 /// activation model for cardiac electrophysiology.
39 ///
40 /// The classes defined here duplicate the data structures in the Fortran FNMOD module defined in CEPMOD_FN.f
41 /// and PARAMS_FN.f files.
42 class CepModFn
43 {
44  public:
45  CepModFn();
46  ~CepModFn();
47 
48  // Scaling factors
49  /// Voltage scaling
50  double Vscale = 1.0;
51  /// Time scaling
52  double Tscale = 1.0;
53  /// Voltage offset parameter
54  double Voffset = 0.0;
55 
56  /// Model parameters
57  double alpha = -0.50;
58  double a = 0.0;
59  double b = -0.60;
60  double c = 50.0;
61 
62  void getf(const int n, const Vector<double>& X, Vector<double>& f, const double fext);
63  void getj(const int n, const Vector<double>& X, Array<double>& JAC);
64 
65  void init(const int nX, Vector<double> &X);
66  void init(const int nX, Vector<double> &X, double X0);
67  void init(const int nX, Vector<double> &X, Vector<double>& X0);
68 
69  void integ_cn2(const int nX, Vector<double>& Xn, const double Ts, const double Ti, const double Istim,
70  Vector<int>& IPAR, Vector<double>& RPAR);
71  void integ_fe(const int nX, Vector<double>& X, const double Ts, const double Ti, const double Istim);
72  void integ_rk(const int nX, Vector<double>& X, const double Ts, const double Ti, const double Istim);
73 
74 };
75 
76 #endif
77 
This module defines data structures for Fitzhugh-Nagumo cellular activation model for cardiac electro...
Definition: CepModFn.h:43
double Tscale
Time scaling.
Definition: CepModFn.h:52
double Vscale
Voltage scaling.
Definition: CepModFn.h:50
double alpha
Model parameters.
Definition: CepModFn.h:57
void init(const int nX, Vector< double > &X)
SUBROUTINE FN_INIT0(nX, X)
Definition: CepModFn.cpp:64
void integ_cn2(const int nX, Vector< double > &Xn, const double Ts, const double Ti, const double Istim, Vector< int > &IPAR, Vector< double > &RPAR)
Time integration performed using Crank-Nicholson method.
Definition: CepModFn.cpp:82
double Voffset
Voltage offset parameter.
Definition: CepModFn.h:54
void integ_rk(const int nX, Vector< double > &X, const double Ts, const double Ti, const double Istim)
Time integration performed using 4th order Runge-Kutta method.
Definition: CepModFn.cpp:158
void integ_fe(const int nX, Vector< double > &X, const double Ts, const double Ti, const double Istim)
Time integration performed using Forward Euler method.
Definition: CepModFn.cpp:141