38 #ifndef BENCHMARKUTILITY_HPP_ 39 #define BENCHMARKUTILITY_HPP_ 42 #include <Epetra_ConfigDefs.h> 45 #include <Epetra_MpiComm.h> 47 #include <Epetra_SerialComm.h> 55 #include <lifev/electrophysiology/solver/IonicModels/IonicMinimalModel.hpp> 56 #include <lifev/electrophysiology/solver/IonicModels/IonicLuoRudyI.hpp> 57 #include <lifev/electrophysiology/solver/IonicModels/IonicTenTusscher06.hpp> 58 #include <lifev/electrophysiology/solver/IonicModels/IonicHodgkinHuxley.hpp> 59 #include <lifev/electrophysiology/solver/IonicModels/IonicNoblePurkinje.hpp> 60 #include <lifev/electrophysiology/solver/IonicModels/IonicFox.hpp> 61 #include <lifev/electrophysiology/solver/IonicModels/IonicAlievPanfilov.hpp> 67 #include <lifev/core/LifeV.hpp> 76 namespace BenchmarkUtility
84 typedef ElectroIonicModel ionicModel_Type;
85 typedef std::shared_ptr<ionicModel_Type> ionicModelPtr_Type;
86 typedef std::function < Real (
const Real& t,
90 const ID& i ) > function_Type;
97 Real chooseIonicModel (ionicModelPtr_Type& model, std::string ionic_model, Epetra_Comm& Comm )
99 Real activationThreshold (0.95);
100 bool ionicModelSet =
false;
101 if ( Comm.MyPID() == 0 )
103 std::cout <<
"Constructing the ionic model ... !";
106 if ( ionic_model ==
"AlievPanfilov" )
108 model.reset (
new IonicAlievPanfilov() );
109 ionicModelSet =
true;
111 if ( ionic_model ==
"LuoRudyI" )
113 model.reset (
new IonicLuoRudyI() );
114 ionicModelSet =
true;
116 if ( ionic_model ==
"TenTusscher06")
118 model.reset (
new IonicTenTusscher06() );
119 ionicModelSet =
true;
121 if ( ionic_model ==
"HodgkinHuxley")
123 model.reset (
new IonicHodgkinHuxley() );
124 activationThreshold = 10.0;
125 ionicModelSet =
true;
127 if ( ionic_model ==
"NoblePurkinje")
129 model.reset (
new IonicNoblePurkinje() );
130 ionicModelSet =
true;
132 if ( ionic_model ==
"MinimalModel")
134 model.reset (
new IonicMinimalModel() );
135 ionicModelSet =
true;
137 if ( ionic_model ==
"Fox")
139 model.reset (
new IonicFox() );
140 if ( Comm.MyPID() == 0 )
146 if ( Comm.MyPID() == 0 )
148 std::cout <<
" Done!" << std::endl;
151 assert (ionicModelSet &&
"Ionic model not specified.");
155 return activationThreshold;
163 Real PacingProtocolMM (
const Real& t,
const Real& x,
const Real& y,
const Real& z,
const ID& )
166 Real pacingSite_X = 0.0;
167 Real pacingSite_Y = 0.0;
168 Real pacingSite_Z = 0.0;
169 Real stimulusRadius = 0.15;
170 Real stimulusValue = 10;
174 if ( std::abs ( x - pacingSite_X ) <= stimulusRadius
176 std::abs ( z - pacingSite_Z ) <= stimulusRadius
178 std::abs ( y - pacingSite_Y ) <= stimulusRadius
182 returnValue = stimulusValue;
196 Real PacingProtocolHH (
const Real& t,
const Real& x,
const Real& y,
const Real& z,
const ID& )
199 Real pacingSite_X = 0.0;
200 Real pacingSite_Y = 0.0;
201 Real pacingSite_Z = 0.0;
202 Real stimulusRadius = 0.15;
203 Real stimulusValue = 500.;
207 if ( std::abs ( x - pacingSite_X ) <= stimulusRadius
209 std::abs ( z - pacingSite_Z ) <= stimulusRadius
211 std::abs ( y - pacingSite_Y ) <= stimulusRadius
215 returnValue = stimulusValue;
229 Real PacingProtocol (
const Real& t,
const Real& x,
const Real& y,
const Real& z,
const ID& )
232 Real pacingSite_X = 0.0;
233 Real pacingSite_Y = 0.0;
234 Real pacingSite_Z = 0.0;
235 Real stimulusRadius = 0.15;
236 Real stimulusValue = 40.0;
240 if ( std::abs ( x - pacingSite_X ) <= stimulusRadius
242 std::abs ( z - pacingSite_Z ) <= stimulusRadius
244 std::abs ( y - pacingSite_Y ) <= stimulusRadius
245 && t >= 0.1 && t <= 2)
247 returnValue = stimulusValue;
261 void setStimulus (function_Type& f, std::string ionic_model)
263 if (ionic_model ==
"MinimalModel" || ionic_model ==
"AlievPanfilov")
265 f = &BenchmarkUtility::PacingProtocolMM;
267 else if (ionic_model ==
"HodgkinHuxley" )
269 f = &BenchmarkUtility::PacingProtocolHH;
273 f = &BenchmarkUtility::PacingProtocol;