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