42 #include <lifev/electrophysiology/solver/IonicModels/IonicMitchellSchaeffer.hpp> 45 #include <lifev/core/LifeV.hpp> 47 using namespace LifeV;
51 #define SolutionTestNorm 22190.593126695825049
61 std::cout <<
"Building Constructor for Mitchell Schaeffer Model ... ";
63 std::cout <<
" Done!" << std::endl;
81 std::cout <<
"Initializing solution vector...";
82 std::vector<Real> unknowns (model.Size(), 0);
83 model.initialize (unknowns);
84 std::cout <<
" Done!" << std::endl;
93 std::cout <<
"Initializing rhs..." ;
94 std::vector<Real> rhs (model.Size(), 0);
95 std::cout <<
" Done! " << std::endl;
114 std::string filename =
"output.txt";
115 std::ofstream output (
"output.txt");
121 Real SolutionNorm = unknowns[0];
126 std::cout <<
"Time loop starts...\n";
127 for (
Real t = 0; t < TF; )
134 if ( t > 5 && t < 5.1 )
146 model.setAppliedCurrent (Iapp);
147 std::cout <<
"\r " << t <<
" ms. " << std::flush;
152 model.computeRhs ( unknowns, rhs);
153 model.addAppliedCurrent (rhs);
159 unknowns.at (0) = unknowns.at (0) + dt * rhs.at (0);
160 unknowns.at (1) = unknowns.at (1) + dt * rhs.at (1);
165 output << t <<
", " << unknowns.at (0) <<
", " << unknowns.at (1) <<
"\n";
176 SolutionNorm += unknowns[0];
178 std::cout <<
"\n...Time loop ends.\n";
179 std::cout <<
"Solution written on file: " << filename <<
"\n";
187 std::cout << std::setprecision (20) <<
"\nError: " << err <<
"\nSolution norm: " << SolutionNorm <<
"\n";
190 returnValue = EXIT_FAILURE;
194 returnValue = EXIT_SUCCESS;
196 return ( returnValue );
199 #undef SolutionTestNorm
int32_type Int
Generic integer data.
void showMe()
Display information about the model.
void updateInverseJacobian(const UInt &iQuadPt)
double Real
Generic real data.
IonicModel - This class implements an ionic model.