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" 57 #include <lifev/electrophysiology/solver/ElectroETAMonodomainSolver.hpp> 60 #include <lifev/electrophysiology/stimulus/StimulusPacingProtocol.hpp> 61 #include <lifev/core/LifeV.hpp> 63 #include <Teuchos_RCP.hpp> 64 #include <Teuchos_ParameterList.hpp> 65 #include "Teuchos_XMLParameterListHelpers.hpp" 66 #include <Teuchos_ScalarTraitsDecl.hpp> 71 using namespace LifeV;
79 MPI_Init (&argc, &argv);
80 std::shared_ptr<Epetra_Comm> Comm (
new Epetra_MpiComm (MPI_COMM_WORLD) );
88 const string stimulus_datafile_name = command_line.follow (
"StimulationParameters.xml", 2,
"-s",
"--stimulus");
89 Teuchos::ParameterList stimulusList = * ( Teuchos::getParametersFromXmlFile ( stimulus_datafile_name ) );
91 StimulusPacingProtocol stimulus;
92 stimulus.setParameters ( stimulusList );
93 if ( Comm->MyPID() == 0 )
98 Real DeltaX, DeltaY, DeltaZ, DeltaT;
104 Teuchos::ScalarTraits<Real>::seedrandom (time (NULL) );
105 stimulus.setPacingProtocol (
"FCL");
106 if ( Comm->MyPID() == 0 )
108 std::cerr <<
"Starting test" << std::endl;
112 for (
ID i = 0; i < 100; i++)
115 x = (Teuchos::ScalarTraits<Real>::random() + stimulusList.get (
"pacing_site_X", 1.0 ) ) * DeltaX;
116 y = (Teuchos::ScalarTraits<Real>::random() + stimulusList.get (
"pacing_site_Y", 1.0 ) ) * DeltaY;
117 z = (Teuchos::ScalarTraits<Real>::random() + stimulusList.get (
"pacing_site_Z", 1.0 ) ) * DeltaZ;
118 t = (Teuchos::ScalarTraits<Real>::random() + 1.0 ) * DeltaX;
119 stimulus.appliedCurrent ( t, x, y, z, i );
122 stimulus.setPacingProtocol (
"FCL-ExtraSt");
124 for (
ID i = 0; i < 100; i++)
127 x = (Teuchos::ScalarTraits<Real>::random() + stimulusList.get (
"pacing_site_X", 1.0 ) ) * DeltaX;
128 y = (Teuchos::ScalarTraits<Real>::random() + stimulusList.get (
"pacing_site_Y", 1.0 ) ) * DeltaY;
129 z = (Teuchos::ScalarTraits<Real>::random() + stimulusList.get (
"pacing_site_Z", 1.0 ) ) * DeltaZ;
130 t = (Teuchos::ScalarTraits<Real>::random() + 1.0 ) * DeltaX;
131 stimulus.appliedCurrent ( t, x, y, z, i );
133 stimulus.setPacingProtocol (
"S1S2Pro");
135 for (
ID i = 0; i < 100; i++)
138 x = (Teuchos::ScalarTraits<Real>::random() + stimulusList.get (
"pacing_site_X", 1.0 ) ) * DeltaX;
139 y = (Teuchos::ScalarTraits<Real>::random() + stimulusList.get (
"pacing_site_Y", 1.0 ) ) * DeltaY;
140 z = (Teuchos::ScalarTraits<Real>::random() + stimulusList.get (
"pacing_site_Z", 1.0 ) ) * DeltaZ;
141 t = (Teuchos::ScalarTraits<Real>::random() + 1.0 ) * DeltaX;
142 stimulus.appliedCurrent ( t, x, y, z, i );
145 stimulus.setPacingProtocol (
"DynPro");
147 for (
ID i = 0; i < 100; i++)
150 x = (Teuchos::ScalarTraits<Real>::random() + stimulusList.get (
"pacing_site_X", 1.0 ) ) * DeltaX;
151 y = (Teuchos::ScalarTraits<Real>::random() + stimulusList.get (
"pacing_site_Y", 1.0 ) ) * DeltaY;
152 z = (Teuchos::ScalarTraits<Real>::random() + stimulusList.get (
"pacing_site_Z", 1.0 ) ) * DeltaZ;
153 t = (Teuchos::ScalarTraits<Real>::random() + 1.0 ) * DeltaX;
154 stimulus.appliedCurrent ( t, x, y, z, i );
157 if ( Comm->MyPID() == 0 )
159 std::cerr <<
"Ending test" << std::endl;
163 MPI_Barrier (MPI_COMM_WORLD);
166 return ( EXIT_SUCCESS );
GetPot(const int argc_, char **argv_, const char *FieldSeparator=0x0)
int32_type Int
Generic integer data.
double Real
Generic real data.
int main(int argc, char **argv)