LifeV
IonicAlievPanfilov.cpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  @file
29  @brief Ionic model of Aliev-Panfilov
30  @date 01-2013
31  @author Simone Rossi <simone.rossi@epfl.ch>
32 
33  @contributors
34  @mantainer Simone Rossi <simone.rossi@epfl.ch>
35  @last update 01-2013
36  */
37 
38 #include <lifev/electrophysiology/solver/IonicModels/IonicAlievPanfilov.hpp>
39 
40 
41 //#include <Teuchos_RCP.hpp>
42 //#include <Teuchos_ParameterList.hpp>
43 //#include "Teuchos_XMLParameterListHelpers.hpp"
44 
45 namespace LifeV
46 {
47 //! IonicModel - This class implements an ionic model.
48 // ===================================================
49 //! Constructors
50 // ===================================================
51 IonicAlievPanfilov::IonicAlievPanfilov() :
52  super ( 2 ),
53  M_mu1 ( 0.12 ),
54  M_mu2 ( 0.3 ),
55  M_k ( 8.0 ),
56  M_a ( 0.1 ),
57  M_epsilon ( 0.01 )
58 {
59  M_restingConditions.at (0) = 0.0;
60  M_restingConditions.at (1) = 0.16;
61 }
62 
63 IonicAlievPanfilov::IonicAlievPanfilov ( Teuchos::ParameterList& parameterList ) :
64  super ( 2 )
65 {
66  setup ( parameterList );
67 
68  M_restingConditions.at (0) = 0.0;
69  M_restingConditions.at (1) = 0.16;
70 }
71 
72 IonicAlievPanfilov::IonicAlievPanfilov ( const IonicAlievPanfilov& model )
73 {
74 
75  M_mu1 = model.M_mu1;
76  M_mu2 = model.M_mu2;
77  M_k = model.M_k;
78  M_a = model.M_a;
79  M_epsilon = model.M_epsilon;
80 
81  M_numberOfEquations = model.M_numberOfEquations;
82  M_restingConditions = model.M_restingConditions;
83 }
84 
85 // ===================================================
86 //! Operator
87 // ===================================================
88 IonicAlievPanfilov& IonicAlievPanfilov::operator= ( const IonicAlievPanfilov& model )
89 {
90  M_mu1 = model.M_mu1;
91  M_mu2 = model.M_mu2;
92  M_k = model.M_k;
93  M_a = model.M_a;
94  M_epsilon = model.M_epsilon;
95 
96  M_numberOfEquations = model.M_numberOfEquations;
97  M_restingConditions = model.M_restingConditions;
98 
99  return *this;
100 }
101 
102 void IonicAlievPanfilov::setup ( Teuchos::ParameterList& parameterList )
103 {
104  M_mu1 = parameterList.get ("mu1", 0.12);
105  M_mu2 = parameterList.get ("mu2", 0.3);
106  M_k = parameterList.get ("k", 8.0);
107  M_a = parameterList.get ("a", 0.1);
108  M_epsilon = parameterList.get ("epsilon", 0.01);
109 }
110 // ===================================================
111 //! Methods
112 // ===================================================
113 //Only gating variables
114 void IonicAlievPanfilov::computeGatingRhs ( const std::vector<Real>& v,
115  std::vector<Real>& rhs )
116 {
117 
118  Real dr = - ( M_epsilon + M_mu1 * v[1] / ( M_mu2 + v[0] ) ) * ( v[1] + M_k * v[0] * ( v[0] - M_a - 1.0 ) );
119 
120  rhs[0] = dr;
121 
122 }
123 
124 //Potential and gating variables
125 void IonicAlievPanfilov::computeRhs ( const std::vector<Real>& v,
126  std::vector<Real>& rhs )
127 {
128 
129  Real dr = - ( M_epsilon + M_mu1 * v[1] / ( M_mu2 + v[0] ) ) * ( v[1] + M_k * v[0] * ( v[0] - M_a - 1.0 ) );
130  Real dV = - M_k * v[0] * ( v[0] - M_a ) * ( v[0] - 1.0) - v[0] * v[1];
131 
132  rhs[0] = dV;
133  rhs[1] = dr;
134 
135 }
136 
137 
138 Real IonicAlievPanfilov::computeLocalPotentialRhs ( const std::vector<Real>& v )
139 {
140  return ( - M_k * v[0] * ( v[0] - M_a ) * ( v[0] - 1.0) - v[0] * v[1] );
141 }
142 
143 
144 void IonicAlievPanfilov::showMe()
145 {
146  std::cout << "\n\n\t\tIonicAlievPanfilov Informations\n\n";
147  std::cout << "number of unkowns: " << this->Size() << std::endl;
148 
149  std::cout << "\n\t\tList of model parameters:\n\n";
150  std::cout << "mu1: " << this->Mu1() << std::endl;
151  std::cout << "mu2: " << this->Mu2() << std::endl;
152  std::cout << "k: " << this->K() << std::endl;
153  std::cout << "a: " << this->A() << std::endl;
154  std::cout << "epsilon: " << this->Epsilon() << std::endl;
155 
156  std::cout << "\n\t\t End of IonicAlievPanfilov Informations\n\n\n";
157 
158 }
159 
160 
161 }
void updateInverseJacobian(const UInt &iQuadPt)
double Real
Generic real data.
Definition: LifeV.hpp:175