LifeV
HeartMonodomainData.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 Monodomain data with GetPot
30 
31  @date 11−2007
32  @author Lucia Mirabella <lucia.mirabella@gmail.com>, Mauro Perego <perego.mauro@gmail.com>
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/HeartMonodomainData.hpp>
39 
40 
41 namespace LifeV
42 {
43 
44 // ===================================================
45 // Constructors & Destructor
46 // ===================================================
47 HeartMonodomainData::HeartMonodomainData ( std::shared_ptr<HeartFunctors> heart ) :
48  MeshData ( heart-> M_dataFile, "electric/space_discretization" ),
49  TimeData ( heart-> M_dataFile, "electric/time_discretization" ),
53 
54 
55 {
56  setup ( heart-> M_dataFile);
57 }
58 
60  MeshData ( ),
61  TimeData ( ),
62  M_hasFibers ( ),
63  M_verbose ( ),
65  M_diffusivity ( ),
72  M_fibersFile ( ),
74  M_uOrder ( )
75 
76 {
77 }
78 
82  M_hasFibers ( dataMonodomain.M_hasFibers ),
83  M_verbose ( dataMonodomain.M_verbose ),
85  M_diffusivity ( dataMonodomain.M_diffusivity ),
90  M_conductivityRatio ( dataMonodomain.M_conductivityRatio ),
95 
96 {
97 }
98 
99 
100 // ===================================================
101 // Methods
102 // ===================================================
105 {
106  if ( this != &dataMonodomain )
107  {
108  M_hasFibers = dataMonodomain.M_hasFibers;
110  M_diffusivity = dataMonodomain.M_diffusivity;
116  M_fibersDirectory = dataMonodomain.M_fibersDirectory;
117  M_fibersFile = dataMonodomain.M_fibersFile;
118  M_postProcessingDirectory = dataMonodomain.M_postProcessingDirectory;
119  M_uOrder = dataMonodomain.M_uOrder;
123  }
124  return *this;
125 }
126 
127 
128 void
129 HeartMonodomainData::setup ( const GetPot& dataFile )
130 {
131  M_volumeSurfaceRatio = dataFile ("electric/physics/Chi", 1e3); // [1e-3 1/cm] ColliPavarinoTaccardi2005
132  M_membraneCapacitance = dataFile ("electric/physics/Cm", 1e-3); // [1e-3 mF/cm2] ColliPavarinoTaccardi2005
133 
134  if ( dataFile ("electric/physics/ion_model", 1) == 1)
135  {
136  M_diffusivity = dataFile ("electric/physics/D" , 0.0156); // 0.0156 [1/Ohm/cm] L^2/T*D, L=0.099 cm, T=0.63 ms D=1, //RogersMcCulloch1994
137  M_longitudinalConductivity = dataFile ("electric/physics/sigmal", 0.0328); // 0.0328 [1/Ohm/cm] sigmal_LR * D_RM/D_LR
138  M_transversalConductivity = dataFile ("electric/physics/sigmat", 0.00699); // 0.00699 [1/Ohm/cm] sigmat_LR * D_RM/D_LR
139  }
140  else if ( dataFile ("electric/physics/ion_model", 1) == 2)
141  {
142  M_diffusivity = dataFile ("electric/physics/D" , 5.7e-4); // 5.7e-4 [1/Ohm/cm] sigmal/3 + sigmat*2/3
143  M_longitudinalConductivity = dataFile ("electric/physics/sigmal", 1.2e-3); // 1.2e-3 [1/Ohm/cm] sigmal_i*sigmal_e/(sigmal_i+sigmal_e) ColliPavarinoTaccardi2005
144  M_transversalConductivity = dataFile ("electric/physics/sigmat", 2.56e-4); // 2.56e-4 [1/Ohm/cm] sigmat_i*sigmat_e/(sigmat_i+sigmat_e) ColliPavarinoTaccardi2005
145  }
146  M_conductivityRatio = dataFile ("electric/physics/lambda", 0.66667); // 0.66667 [adim] sigmal_e/sigmal_i
147  M_heartDiffusionFactor = dataFile ("electric/physics/heartDiffusionFunctor", 0);
148  M_postProcessingDirectory = dataFile ("electric/miscellaneous/post_dir", "./");
149  M_uOrder = dataFile ( "electric/space_discretization/u_order", "P1");
150  M_hasFibers = dataFile ( "electric/space_discretization/hasFibers", 0);
151 
152  if ( M_hasFibers )
153  {
154  std::string fibersDirectory = dataFile ( "electric/space_discretization/fibers_dir", this->meshDir().c_str() );
155  std::string fibersFile = this -> meshFile();
156  fibersFile.replace ( fibersFile.find (".mesh"), 5, "fibers" );
157  M_fibersFile = fibersDirectory + dataFile ( "electric/space_discretization/fibers_file", fibersFile.c_str() );
158  std::cout << "Fibers File: " << M_fibersFile << std::endl;
159  }
160  else
161  {
162  M_fibersFile = "";
163  std::cout << "Fibers not included!" << std::endl;
164  }
165 }
166 
167 
168 void
169 HeartMonodomainData::showMe ( std::ostream& output )
170 {
171  output << "\n*** Values for data [fluid/time_discretization]\n\n";
172  output << "endtime = " << endTime() << std::endl;
173  output << "\n*** Values for data [fluid/miscellaneous]\n\n";
174  output << "verbose = " << M_verbose << std::endl;
175 }
176 
177 }
double operator()(const char *VarName, const double &Default) const
Definition: GetPot.hpp:2033
HeartMonodomainData(std::shared_ptr< HeartFunctors > heart)
MeshData - class for handling spatial discretization.
Definition: MeshData.hpp:72
HeartMonodomainData & operator=(const HeartMonodomainData &dataMonodomain)
void showMe(std::ostream &output=std::cout)
output: show the data used for the simulation
HeartMonodomainData(const HeartMonodomainData &dataMonodomain)
MeshData()
Empty Constructor.
Definition: MeshData.cpp:51
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