42 #pragma GCC diagnostic ignored "-Wunused-variable" 43 #pragma GCC diagnostic ignored "-Wunused-parameter" 45 #include <Epetra_ConfigDefs.h> 48 #include <Epetra_MpiComm.h> 50 #include <Epetra_SerialComm.h> 54 #pragma GCC diagnostic warning "-Wunused-variable" 55 #pragma GCC diagnostic warning "-Wunused-parameter" 60 #include <lifev/core/filter/GetPot.hpp> 62 #include <lifev/electrophysiology/solver/IonicModels/IonicMinimalModel.hpp> 63 #include <lifev/core/LifeV.hpp> 65 #include <lifev/electrophysiology/stimulus/StimulusPacingProtocol.hpp> 66 #include <Teuchos_RCP.hpp> 67 #include <Teuchos_ParameterList.hpp> 68 #include "Teuchos_XMLParameterListHelpers.hpp" 71 using namespace LifeV;
73 #define SolutionTestNorm 14412.225993765172461
78 MPI_Init (&argc, &argv);
79 Epetra_MpiComm Comm (MPI_COMM_WORLD);
80 if ( Comm.MyPID() == 0 )
82 std::cout <<
"% using MPI" << std::endl;
93 std::string xmlParameterFilename = commandLine
.follow ("ParametersTNNP.xml", 2
, "-i", "--file"); ;
95 std::cout <<
"Importing parameters list...";
97 Teuchos::ParameterList ParameterList = * ( Teuchos::getParametersFromXmlFile ( xmlParameterFilename ) );
98 std::cout <<
" Done!" << std::endl;
107 std::cout <<
"Building Constructor for Minimal Model with parameters ... ";
108 IonicMinimalModel ionicModel (ParameterList);
109 std::cout <<
" Done!" << std::endl;
123 std::cout <<
"Initializing solution vector...";
124 std::vector<Real> states (ionicModel.Size(), 0);
125 ionicModel.initialize (states);
126 std::cout <<
" Done!" << std::endl;
136 std::cout <<
"Initializing rhs..." ;
137 std::vector<Real> rhs (ionicModel.Size(), 0);
138 std::cout <<
" Done! " << std::endl;
162 Real SolutionNorm = states[0];
168 std::string filename =
"output.txt";
169 std::ofstream output (
"output.txt");
171 std::cout <<
"Potential: " << states[0] << std::endl;
175 std::cout <<
"Time loop starts...\n";
176 for (
Real t = 0; t < TF; )
183 if ( t >= 10 && t <= 12 )
191 std::cout <<
"\r " << t <<
" ms. " << std::flush;
196 ionicModel.setAppliedCurrent (Iapp);
197 ionicModel.computeRhs ( states, rhs);
205 for (
int j (0); j < ionicModel.Size(); j++)
207 states[j] = states[j] + dt * rhs[j];
214 for (
int j (0); j < ionicModel.Size() - 1; j++)
216 output << states[j] <<
", ";
218 output << states[ ionicModel.Size() - 1] <<
"\n";
229 SolutionNorm = SolutionNorm + states[0];
232 std::cout <<
"\n...Time loop ends.\n";
233 std::cout <<
"Solution written on file: " << filename <<
"\n";
244 std::cout << std::setprecision (20) <<
"\nError: " << err <<
"\nSolution norm: " << SolutionNorm <<
"\n";
247 std::cout <<
"\nTest Failed!\n";
248 returnValue = EXIT_FAILURE;
252 returnValue = EXIT_SUCCESS;
254 return ( returnValue );
257 #undef SolutionTestNorm
GetPot(const int argc_, char **argv_, const char *FieldSeparator=0x0)
int32_type Int
Generic integer data.
void updateInverseJacobian(const UInt &iQuadPt)
int main(int argc, char **argv)
double Real
Generic real data.
const std::string follow(const char *Default, unsigned No, const char *Option,...)