#include <ProgressReporter.hpp>
Public Member Functions | |
ProgressReporter (std::string outputDirectory, double startTime, double endTime) | |
~ProgressReporter () | |
void | Update (double currentTime) |
void | PrintFinalising () |
void | PrintInitialising () |
Private Attributes | |
double | mStartTime |
double | mEndTime |
out_stream | mpFile |
unsigned | mLastPercentage |
You can watch the progress of your simulation by doing one of a) watch tail <outputDirectory>/progress_status.txt b) tail -f <outputDirectory>/progress_status.txt
Definition at line 43 of file ProgressReporter.hpp.
ProgressReporter::ProgressReporter | ( | std::string | outputDirectory, | |
double | startTime, | |||
double | endTime | |||
) |
Constuctor saves times and opens output file ('progress_status.txt').
outputDirectory | where to open the output file | |
startTime | the start time | |
endTime | the end time |
Definition at line 35 of file ProgressReporter.cpp.
References PetscTools::AmMaster(), mpFile, and OutputFileHandler::OpenOutputFile().
ProgressReporter::~ProgressReporter | ( | ) |
Destructor.
Definition at line 52 of file ProgressReporter.cpp.
References PetscTools::AmMaster(), mLastPercentage, and mpFile.
void ProgressReporter::Update | ( | double | currentTime | ) |
Calculates the percentage completed using the time given and the start and end time and prints to file if another percent has been done.
currentTime | the given time |
Definition at line 65 of file ProgressReporter.cpp.
References PetscTools::AmMaster(), mEndTime, mLastPercentage, mpFile, and mStartTime.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
void ProgressReporter::PrintFinalising | ( | ) |
Print finalising message to file.
Definition at line 78 of file ProgressReporter.cpp.
References PetscTools::AmMaster(), and mpFile.
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Solve().
void ProgressReporter::PrintInitialising | ( | ) |
Print initialising message to file.
Definition at line 86 of file ProgressReporter.cpp.
References PetscTools::AmMaster(), and mpFile.
double ProgressReporter::mStartTime [private] |
Start time of the simulation
Definition at line 47 of file ProgressReporter.hpp.
Referenced by Update().
double ProgressReporter::mEndTime [private] |
End time of the simulation
Definition at line 48 of file ProgressReporter.hpp.
Referenced by Update().
out_stream ProgressReporter::mpFile [private] |
Progress status file
Definition at line 49 of file ProgressReporter.hpp.
Referenced by PrintFinalising(), PrintInitialising(), ProgressReporter(), Update(), and ~ProgressReporter().
unsigned ProgressReporter::mLastPercentage [private] |
Last percentage that was written
Definition at line 50 of file ProgressReporter.hpp.
Referenced by Update(), and ~ProgressReporter().