LifeV
HeartBidomainData.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 File containing a class for handling Bidomain data with GetPot
30 
31  @date 11−2007
32  @author Gilles Fourestey <gilles.fourestey@epfl.ch>
33 
34  @contributor Simone Rossi <simone.rossi@epfl.ch>, Ricardo Ruiz-Baier <ricardo.ruiz@epfl.ch>
35  @mantainer Simone Rossi <simone.rossi@epfl.ch>
36  */
37 
38 #include<lifev/heart/solver/HeartBidomainData.hpp>
39 
40 
41 namespace LifeV
42 {
43 
44 
45 // ===================================================
46 // Constructors & Destructor
47 // ===================================================
48 HeartBidomainData::HeartBidomainData ( std::shared_ptr<HeartFunctors> heart ) :
49  MeshData ( heart -> M_dataFile, "electric/space_discretization" ),
50  TimeData ( heart -> M_dataFile, "electric/time_discretization" ),
54 
55 
56 {
57  setup ( heart -> M_dataFile);
58 }
59 
61  MeshData ( ),
62  TimeData ( ),
63  M_fibersFormat ( ),
64  M_hasFibers ( ),
65  M_BDForder ( ),
66  M_verbose ( ),
77  M_fibersFile ( ),
79  M_uOrder ( )
80 
81 
82 
83 {
84 }
85 
89  M_fibersFormat ( dataBidomain.M_fibersFormat ),
90  M_hasFibers ( dataBidomain.M_hasFibers ),
91  M_BDForder ( dataBidomain.M_BDForder ),
92  M_verbose ( dataBidomain.M_verbose ),
106 
107 
108 
109 {
110 }
111 
112 
113 // ===================================================
114 // Methods
115 // ===================================================
118 {
119  if ( this != &dataBidomain )
120  {
121 
122  M_fibersFormat = dataBidomain.M_fibersFormat;
123  M_hasFibers = dataBidomain.M_hasFibers;
124  M_BDForder = dataBidomain.M_BDForder;
134  M_fibersDirectory = dataBidomain.M_fibersDirectory;
135  M_fibersFile = dataBidomain.M_fibersFile;
136  M_postProcessingDirectory = dataBidomain.M_postProcessingDirectory;
137  M_uOrder = dataBidomain.M_uOrder;
141  }
142 
143  return *this;
144 }
145 
146 
147 void
148 HeartBidomainData::setup ( const GetPot& dataFile )
149 {
150  M_volumeSurfaceRatio = dataFile ("electric/physics/Chi", 1e3); // [1e-3 1/cm] ColliPavarinoTaccardi2005
151  M_membraneCapacitance = dataFile ("electric/physics/Cm", 1e-3); // [1e-3 mF/cm2] ColliPavarinoTaccardi2005
152  if ( dataFile ("electric/physics/ion_model", 1) == 1)
153  {
154  M_internalDiffusivity = dataFile ("electric/physics/D_i" , 3.3e-2); // 3.3e-2 [1/Ohm/cm] D_i_LR * D_RM/D_LR see dataMonodomain
155  M_externalDiffusivity = dataFile ("electric/physics/D_e" , 4.29e-2); // 4.29e-2 [1/Ohm/cm] D_e_LR * D_RM/D_LR see dataMonodomain
156  M_longitudinalInternalConductivity = dataFile ("electric/physics/sigmal_i", 8.19e-2); // 8.19e-2 [1/Ohm/cm] sigmal_i_LR * D_RM/D_LR
157  M_transversalInternalConductivity = dataFile ("electric/physics/sigmat_i", 8.6e-3); // 8.6e-3 [1/Ohm/cm] sigmat_i_LR * D_RM/D_LR
158  M_longitudinalExternalConductivity = dataFile ("electric/physics/sigmal_e", 5.46e-2); // 5.46e-2 [1/Ohm/cm] sigmal_e_LR * D_RM/D_LR
159  M_transversalExternalConductivity = dataFile ("electric/physics/sigmat_e", 3.69e-2); // 3.69e-2 [1/Ohm/cm] sigmat_e_LR * D_RM/D_LR
160  }
161  else if ( dataFile ("electric/physics/ion_model", 1) == 2)
162  {
163  M_internalDiffusivity = dataFile ("electric/physics/D_i" , 1.21e-3); // sigmal_i/3 + sigmat_i*2/3
164  M_externalDiffusivity = dataFile ("electric/physics/D_e" , 1.57e-3); // sigmal_e/3 + sigmat_e*2/3
165  M_longitudinalInternalConductivity = dataFile ("electric/physics/sigmal_i", 3e-3); // 3e-3 [1/Ohm/cm] ColliPavarinoTaccardi2005
166  M_transversalInternalConductivity = dataFile ("electric/physics/sigmat_i", 3.1525e-4); // 3.1525e-4 [1/Ohm/cm] ColliPavarinoTaccardi2005
167  M_longitudinalExternalConductivity = dataFile ("electric/physics/sigmal_e", 2e-3); // 2e-3 [1/Ohm/cm] ColliPavarinoTaccardi2005
168  M_transversalExternalConductivity = dataFile ("electric/physics/sigmat_e", 1.3514e-3); // 1.3514e-3 [1/Ohm/cm] ColliPavarinoTaccardi2005
169  }
170  else if ( dataFile ("electric/physics/ion_model", 1) == 3)
171  {
172  M_internalDiffusivity = dataFile ("electric/physics/D_i" , 3.3e-2); // 3.3e-2 [1/Ohm/cm] D_i_LR * D_RM/D_LR see dataMonodomain
173  M_externalDiffusivity = dataFile ("electric/physics/D_e" , 4.29e-2); // 4.29e-2 [1/Ohm/cm] D_e_LR * D_RM/D_LR see dataMonodomain
174  M_longitudinalInternalConductivity = dataFile ("electric/physics/sigmal_i", 8.19e-2); // 8.19e-2 [1/Ohm/cm] sigmal_i_LR * D_RM/D_LR
175  M_transversalInternalConductivity = dataFile ("electric/physics/sigmat_i", 8.6e-3); // 8.6e-3 [1/Ohm/cm] sigmat_i_LR * D_RM/D_LR
176  M_longitudinalExternalConductivity = dataFile ("electric/physics/sigmal_e", 5.46e-2); // 5.46e-2 [1/Ohm/cm] sigmal_e_LR * D_RM/D_LR
177  M_transversalExternalConductivity = dataFile ("electric/physics/sigmat_e", 3.69e-2); // 3.69e-2 [1/Ohm/cm] sigmat_e_LR * D_RM/D_LR
178  }
179  M_heartDiffusionFactor = dataFile ("electric/physics/heart_diff_fct", 0);
180  M_verbose = dataFile ( "electric/miscellaneous/verbose", 1 );
181  M_postProcessingDirectory = dataFile ("electric/miscellaneous/post_dir", "./");
182  M_uOrder = dataFile ( "electric/space_discretization/u_order", "P1");
183  M_fibersFormat = dataFile ("electric/space_discretization/fibers_format", 0);
184  M_hasFibers = dataFile ( "electric/space_discretization/has_fibers", 0);
185  M_BDForder = dataFile ("electric/time_discretization/BDF_order", 1);
186  if ( M_hasFibers )
187  {
188  std::string fibersDirectory = dataFile ( "electric/space_discretization/fibers_dir", this->meshDir().c_str() );
189  std::string fibersFile = this -> meshFile();
190  fibersFile.replace ( fibersFile.find (".mesh"), 5, "fibers");
191  M_fibersFile = fibersDirectory + dataFile ( "electric/space_discretization/fibers_file", fibersFile.c_str() );
192  std::cout << "Fibers File: " << M_fibersFile << std::endl;
193  }
194  else
195  {
196  M_fibersFile = "";
197  std::cout << "Fibers not included!" << std::endl;
198  }
199 }
200 
201 
202 void
203 HeartBidomainData::showMe ( std::ostream& output )
204 {
205  output << "\n*** Values for data [fluid/physics]\n\n";
206  output << "endtime = " << endTime() << std::endl;
207  output << "\n*** Values for data [fluid/miscellaneous]\n\n";
208  output << "verbose = " << M_verbose << std::endl;
209 }
210 
211 
212 
213 
214 
215 }
double operator()(const char *VarName, const double &Default) const
Definition: GetPot.hpp:2033
HeartBidomainData & operator=(const HeartBidomainData &dataBidomain)
HeartBidomainData()
Constructors.
MeshData - class for handling spatial discretization.
Definition: MeshData.hpp:72
MeshData()
Empty Constructor.
Definition: MeshData.cpp:51
HeartBidomainData(const HeartBidomainData &dataBidomain)
int operator()(const char *VarName, int Default) const
Definition: GetPot.hpp:2021
void setup(const GetPot &dataFile)
external setup: set all the data for the simulation
HeartBidomainData(std::shared_ptr< HeartFunctors > heart)
void showMe(std::ostream &output=std::cout)
Output: show the data used for the simulation.