47 #pragma GCC diagnostic ignored "-Wunused-variable" 48 #pragma GCC diagnostic ignored "-Wunused-parameter" 50 #include <Epetra_ConfigDefs.h> 53 #include <Epetra_MpiComm.h> 55 #include <Epetra_SerialComm.h> 59 #pragma GCC diagnostic warning "-Wunused-variable" 60 #pragma GCC diagnostic warning "-Wunused-parameter" 66 #include <lifev/electrophysiology/solver/IonicModels/IonicTenTusscher06.hpp> 67 #include <lifev/core/LifeV.hpp> 69 #include <Teuchos_RCP.hpp> 70 #include <Teuchos_ParameterList.hpp> 71 #include "Teuchos_XMLParameterListHelpers.hpp" 73 using namespace LifeV;
75 #define SolutionTestNorm -2476.4745158656560307
80 MPI_Init (&argc, &argv);
81 Epetra_MpiComm Comm (MPI_COMM_WORLD);
82 if ( Comm.MyPID() == 0 )
84 std::cout <<
"% using MPI" << std::endl;
93 std::cout <<
"Building Constructor for TenTusscher 2006 Model with default parameters ... ";
94 IonicTenTusscher06 ionicModel;
95 std::cout <<
" Done!" << std::endl;
109 std::cout <<
"Initializing solution vector...";
110 std::vector<Real> states (ionicModel.restingConditions() );
111 std::cout <<
" Done!" << std::endl;
121 std::cout <<
"Initializing rhs..." ;
122 std::vector<Real> rhs (ionicModel.Size(), 0);
123 std::cout <<
" Done! " << std::endl;
148 Real SolutionNorm = states[0];
155 std::string filename =
"output.txt";
156 std::ofstream output (
"output.txt");
159 for (
int j (0); j < ionicModel.Size() - 1; j++)
161 output << states[j] <<
"\t";
163 output << states[ ionicModel.Size() - 1 ] <<
"\n";
168 std::cout <<
"Time loop starts...\n";
171 int savestep ( 1.0 / dt );
175 std::vector<Real> v (states);
176 for (
Real t = 0; t < TF; )
183 if ( t > 50 && t < 52 )
191 std::cout <<
"\r " << t <<
" ms. " << std::flush;
198 ionicModel.setAppliedCurrent (Iapp);
199 rhs[0] = ionicModel.computeLocalPotentialRhs (states);
200 ionicModel.addAppliedCurrent (rhs);
202 ionicModel.computeGatingVariablesWithRushLarsen ( states, dt);
203 states[0] = states[0] + dt * rhs[0];
219 if ( iter % savestep == 0 )
222 for (
int index (0); index < ionicModel.Size() - 1; index++)
224 output << states[index] <<
"\t";
226 output << states[ ionicModel.Size() - 1 ] <<
"\n";
232 SolutionNorm += states[0];
236 std::cout <<
"\n...Time loop ends.\n";
237 std::cout <<
"Solution written on file: " << filename <<
"\n";
249 std::cout << std::setprecision (20) <<
"\nError: " << err <<
"\nSolution norm: " << SolutionNorm <<
"\n";
252 std::cout <<
"\nTest Failed!\n";
253 returnValue = EXIT_FAILURE;
257 returnValue = EXIT_SUCCESS;
259 return ( returnValue );
262 #undef SolutionTestNorm
int32_type Int
Generic integer data.
void updateInverseJacobian(const UInt &iQuadPt)
int main(int argc, char **argv)
double Real
Generic real data.