25#include <CD_NamespaceHeader.H>
36 using Clock = std::chrono::steady_clock;
41 using TimePoint = std::chrono::steady_clock::time_point;
163#include <CD_NamespaceFooter.H>
Implementation of CD_Timer.H.
Class which is used for run-time monitoring of events.
Definition CD_Timer.H:31
void stopEvent(const std::string a_event) noexcept
Stop an event.
Definition CD_TimerImplem.H:88
std::chrono::duration< Real > Duration
Duration in seconds.
Definition CD_Timer.H:46
~Timer()
Destructor.
Definition CD_TimerImplem.H:47
void startEvent(const std::string a_event) noexcept
Start an event.
Definition CD_TimerImplem.H:59
EventFields
Enum for indexing tuple. A rare case of where unscoped enums are useful.
Definition CD_Timer.H:126
std::chrono::steady_clock Clock
Clock implements.
Definition CD_Timer.H:36
std::string m_processName
Process name. Used for input/output.
Definition CD_Timer.H:135
void writeReportToFile(const std::string a_fileName) const noexcept
Print all timed events to a file.
Definition CD_TimerImplem.H:339
std::chrono::steady_clock::time_point TimePoint
Point in time.
Definition CD_Timer.H:41
void printReportHeader(std::ostream &a_outputStream) const noexcept
Print report header.
Definition CD_TimerImplem.H:113
std::map< std::string, std::tuple< bool, TimePoint, Duration > > m_events
Timer events. First entry is the name of the event.
Definition CD_Timer.H:141
Timer()=default
Default constructor. This creates a timer without any timer events and without a name.
Timer(const Timer &a_other)=default
Copy construction.
void printReportTail(std::ostream &a_outputStream, const std::pair< Real, Real > a_elapsedTime) const noexcept
Print report tail.
Definition CD_TimerImplem.H:145
static Real wallClock()
Static function which returns the time (in seconds) between now and an arbitrary time in the past.
Definition CD_TimerImplem.H:31
std::pair< Real, Real > computeTotalElapsedTime(const bool a_localReportOnly) const noexcept
Compute the total time for all finished events.
Definition CD_TimerImplem.H:307
void clear() noexcept
Clear all events.
Definition CD_TimerImplem.H:53
Timer & operator=(const Timer &a_other)=default
Copy assignement.
void eventReport(std::ostream &a_outputStream, const bool a_localReportOnly=false) const noexcept
Print all timed events to cout.
Definition CD_TimerImplem.H:169
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:25