38 #pragma GCC diagnostic ignored "-Wunused-variable" 39 #pragma GCC diagnostic ignored "-Wunused-parameter" 41 #include <Epetra_ConfigDefs.h> 44 #include <Epetra_MpiComm.h> 46 #include <Epetra_SerialComm.h> 50 #pragma GCC diagnostic warning "-Wunused-variable" 51 #pragma GCC diagnostic warning "-Wunused-parameter" 56 #include <lifev/electrophysiology/solver/IonicModels/IonicNoblePurkinje.hpp> 57 #include <lifev/core/LifeV.hpp> 59 #include <Teuchos_RCP.hpp> 60 #include <Teuchos_ParameterList.hpp> 61 #include "Teuchos_XMLParameterListHelpers.hpp" 63 using namespace LifeV;
65 #define SolutionTestNorm -932355.10562017653137
70 MPI_Init (&argc, &argv);
71 Epetra_MpiComm Comm (MPI_COMM_WORLD);
72 if ( Comm.MyPID() == 0 )
74 std::cout <<
"% using MPI" << std::endl;
83 std::cout <<
"Building Constructor for Noble Model with parameters ... ";
84 IonicNoblePurkinje ionicModel;
85 std::cout <<
" Done!" << std::endl;
98 std::cout <<
"Initializing solution vector...";
99 std::vector<Real> states (ionicModel.restingConditions() );
100 ionicModel.initialize (states);
101 std::cout <<
" Done!" << std::endl;
111 std::cout <<
"Initializing rhs..." ;
112 std::vector<Real> rhs (ionicModel.Size(), 0);
113 std::cout <<
" Done! " << std::endl;
132 int useRushLarsen (1);
138 Real SolutionNorm = states[0];
144 std::string filename =
"output.txt";
145 std::ofstream output (
"output.txt");
147 std::cout <<
"Potential: " << states.at (0) << std::endl;
151 std::cout <<
"Time loop starts...\n";
152 for (
Real t = 0; t < TF; )
159 if ( t > 50.5 && t < 52 )
168 std::cout <<
"\r " << t <<
" ms. " << std::flush;
173 ionicModel.setAppliedCurrent (Iapp);
176 ionicModel.computeGatingVariablesWithRushLarsen (states, dt);
177 Real RHS = ionicModel.computeLocalPotentialRhs ( states);
184 for (
int j (0); j < 1; j++)
186 states.at (j) = states.at (j) + dt * (RHS);
191 ionicModel.computeRhs ( states, rhs);
198 for (
int j (0); j < ionicModel.Size(); j++)
200 states.at (j) = states.at (j) + dt * rhs.at (j);
208 for (
int j (0); j < ionicModel.Size() - 1; j++)
210 output << states.at (j) <<
", ";
212 output << states.at ( ionicModel.Size() - 1 ) <<
"\n";
223 SolutionNorm += states[0];
225 std::cout <<
"\n...Time loop ends.\n";
226 std::cout <<
"Solution written on file: " << filename <<
"\n";
237 std::cout << std::setprecision (20) <<
"\nError: " << err <<
"\nSolution norm: " << SolutionNorm <<
"\n";
240 std::cout <<
"\nTest Failed!\n";
241 returnValue = EXIT_FAILURE;
245 returnValue = EXIT_SUCCESS;
247 return ( returnValue );
250 #undef SolutionTestNorm
int32_type Int
Generic integer data.
void updateInverseJacobian(const UInt &iQuadPt)
int main(int argc, char **argv)
double Real
Generic real data.