44 #include <lifev/electrophysiology/solver/IonicModels/IonicAlievPanfilov.hpp> 47 #include <lifev/core/LifeV.hpp> 49 using namespace LifeV;
53 #define SolutionTestNorm 3157.1639117380209427
63 std::cout <<
"Importing parameters list...";
64 Teuchos::ParameterList APParameterList = * ( Teuchos::getParametersFromXmlFile (
"AlievPanfilovParameters.xml" ) );
65 std::cout <<
" Done!" << std::endl;
74 std::cout <<
"Building Constructor for AlievPanfilov Model with parameters ... ";
75 IonicAlievPanfilov model ( APParameterList );
76 std::cout <<
" Done!" << std::endl;
94 std::cout <<
"Initializing solution vector...";
95 std::vector<Real> unknowns (model.Size(), 0);
96 std::cout <<
" Done!" << std::endl;
105 std::cout <<
"Initializing rhs..." ;
106 std::vector<Real> rhs (model.Size(), 0);
107 std::cout <<
" Done! " << std::endl;
126 std::string filename =
"output.txt";
127 std::ofstream output (
"output.txt");
133 Real SolutionNorm = unknowns[0];
138 std::cout <<
"Time loop starts...\n";
139 for (
Real t = 0; t < TF; )
146 if ( t > 0.1 && t < 0.2 )
158 model.setAppliedCurrent (Iapp);
159 std::cout <<
"\r " << t <<
" ms. " << std::flush;
164 model.computeRhs ( unknowns, rhs);
165 model.addAppliedCurrent (rhs);
171 unknowns.at (0) = unknowns.at (0) + dt * rhs.at (0);
172 unknowns.at (1) = unknowns.at (1) + dt * rhs.at (1);
177 output << t <<
", " << unknowns.at (0) <<
", " << unknowns.at (1) <<
"\n";
188 SolutionNorm += unknowns[0];
190 std::cout <<
"\n...Time loop ends.\n";
191 std::cout <<
"Solution written on file: " << filename <<
"\n";
199 std::cout << std::setprecision (20) <<
"\nError: " << err <<
"\nSolution norm: " << SolutionNorm <<
"\n";
202 returnValue = EXIT_FAILURE;
206 returnValue = EXIT_SUCCESS;
208 return ( returnValue );
211 #undef SolutionTestNorm
int32_type Int
Generic integer data.
void updateInverseJacobian(const UInt &iQuadPt)
double Real
Generic real data.