openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
Public Member Functions | Public Attributes | List of all members
opencarp::timer_manager Class Reference

centralize time managment and output triggering More...

#include <timer_utils.h>

Collaboration diagram for opencarp::timer_manager:

Public Member Functions

 timer_manager (double inp_dt, double inp_start, double inp_end)
 
void update_timers ()
 
void reset_timers ()
 Reset time in timer_manager and then reset registered timers. More...
 
int add_eq_timer (double istart, double iend, int ntrig, double iintv, double idur, const char *iname, const char *poolname=nullptr)
 Add a equidistant step timer to the array of timers. More...
 
int add_neq_timer (const std::vector< double > &itrig, double idur, const char *iname, const char *poolname=nullptr)
 
int add_singlestep_timer (double tg, double idur, const char *iname, const char *poolname=nullptr)
 
void initialize_eq_timer (double istart, double iend, int ntrig, double iintv, double idur, int ID, const char *iname, const char *poolname=nullptr)
 
void initialize_neq_timer (const std::vector< double > &itrig, double idur, int ID, const char *iname, const char *poolname=nullptr)
 
void initialize_singlestep_timer (double tg, double idur, int ID, const char *iname, const char *poolname=nullptr)
 
size_t num_timers () const
 
double timer_duration (int ID) const
 
bool elapsed () const
 
bool trigger (int ID) const
 
bool triggered_now (int ID) const
 
bool trigger_end (int ID) const
 
int trigger_elapse (int ID) const
 
int active_ticks (int ID) const
 return number of ticks elapsed after trigger More...
 
void setup (double inp_dt, double inp_start, double inp_end)
 Initialize the timer_manager. More...
 

Public Attributes

double time
 current time More...
 
long d_time
 current time instance index More...
 
double time_step
 global reference time step More...
 
double start
 initial time (nonzero when restarting) More...
 
long d_start
 initial index in multiples of dt More...
 
double end
 final time More...
 
long d_end
 final index in multiples of dt More...
 
std::vector< base_timer * > timers
 vector containing individual timers More...
 

Detailed Description

centralize time managment and output triggering

Definition at line 73 of file timer_utils.h.

Constructor & Destructor Documentation

◆ timer_manager()

opencarp::timer_manager::timer_manager ( double  inp_dt,
double  inp_start,
double  inp_end 
)
inline

Main constructor

See setup() for parameter description.

Definition at line 91 of file timer_utils.h.

Member Function Documentation

◆ active_ticks()

int opencarp::timer_manager::active_ticks ( int  ID) const
inline

return number of ticks elapsed after trigger

Definition at line 195 of file timer_utils.h.

◆ add_eq_timer()

int opencarp::timer_manager::add_eq_timer ( double  istart,
double  iend,
int  ntrig,
double  iintv,
double  idur,
const char *  iname,
const char *  poolname = nullptr 
)

Add a equidistant step timer to the array of timers.

Parameters
istartTiming interval start.
iendTiming interval end.
ntrigNumber of triggered events in the timer.
iintvInterval between trigger events.
idurDuration of a trigger event.
inameTimer name.
poolnameOptional timer pool name.
Returns

Definition at line 78 of file timer_utils.cc.

Here is the caller graph for this function:

◆ add_neq_timer()

int opencarp::timer_manager::add_neq_timer ( const std::vector< double > &  itrig,
double  idur,
const char *  iname,
const char *  poolname = nullptr 
)

Definition at line 92 of file timer_utils.cc.

Here is the caller graph for this function:

◆ add_singlestep_timer()

int opencarp::timer_manager::add_singlestep_timer ( double  tg,
double  idur,
const char *  iname,
const char *  poolname = nullptr 
)
inline

Definition at line 143 of file timer_utils.h.

Here is the caller graph for this function:

◆ elapsed()

bool opencarp::timer_manager::elapsed ( ) const
inline

Definition at line 164 of file timer_utils.h.

Here is the caller graph for this function:

◆ initialize_eq_timer()

void opencarp::timer_manager::initialize_eq_timer ( double  istart,
double  iend,
int  ntrig,
double  iintv,
double  idur,
int  ID,
const char *  iname,
const char *  poolname = nullptr 
)

Definition at line 48 of file timer_utils.cc.

Here is the caller graph for this function:

◆ initialize_neq_timer()

void opencarp::timer_manager::initialize_neq_timer ( const std::vector< double > &  itrig,
double  idur,
int  ID,
const char *  iname,
const char *  poolname = nullptr 
)

Definition at line 63 of file timer_utils.cc.

Here is the caller graph for this function:

◆ initialize_singlestep_timer()

void opencarp::timer_manager::initialize_singlestep_timer ( double  tg,
double  idur,
int  ID,
const char *  iname,
const char *  poolname = nullptr 
)
inline

Definition at line 156 of file timer_utils.h.

Here is the caller graph for this function:

◆ num_timers()

size_t opencarp::timer_manager::num_timers ( ) const
inline

Definition at line 162 of file timer_utils.h.

◆ reset_timers()

void opencarp::timer_manager::reset_timers ( )
inline

Reset time in timer_manager and then reset registered timers.

Definition at line 115 of file timer_utils.h.

Here is the caller graph for this function:

◆ setup()

void opencarp::timer_manager::setup ( double  inp_dt,
double  inp_start,
double  inp_end 
)

Initialize the timer_manager.

The initialization code that is called in the constructor and for reinitialization

Parameters
inp_dtBasic time step.
inp_startSimulation time start.
inp_endSimulation time end.

Definition at line 36 of file timer_utils.cc.

Here is the caller graph for this function:

◆ timer_duration()

double opencarp::timer_manager::timer_duration ( int  ID) const
inline

Definition at line 163 of file timer_utils.h.

◆ trigger()

bool opencarp::timer_manager::trigger ( int  ID) const
inline

Definition at line 166 of file timer_utils.h.

Here is the caller graph for this function:

◆ trigger_elapse()

int opencarp::timer_manager::trigger_elapse ( int  ID) const
inline

Definition at line 186 of file timer_utils.h.

Here is the caller graph for this function:

◆ trigger_end()

bool opencarp::timer_manager::trigger_end ( int  ID) const
inline

Definition at line 178 of file timer_utils.h.

Here is the caller graph for this function:

◆ triggered_now()

bool opencarp::timer_manager::triggered_now ( int  ID) const
inline

Definition at line 171 of file timer_utils.h.

Here is the caller graph for this function:

◆ update_timers()

void opencarp::timer_manager::update_timers ( )
inline

Update all timers and IO triggers

Note
triggered within this function means the leading edge, while the triggered field outside the function means that the trigger is on

Definition at line 103 of file timer_utils.h.

Here is the caller graph for this function:

Member Data Documentation

◆ d_end

long opencarp::timer_manager::d_end

final index in multiples of dt

Definition at line 82 of file timer_utils.h.

◆ d_start

long opencarp::timer_manager::d_start

initial index in multiples of dt

Definition at line 80 of file timer_utils.h.

◆ d_time

long opencarp::timer_manager::d_time

current time instance index

Definition at line 77 of file timer_utils.h.

◆ end

double opencarp::timer_manager::end

final time

Definition at line 81 of file timer_utils.h.

◆ start

double opencarp::timer_manager::start

initial time (nonzero when restarting)

Definition at line 79 of file timer_utils.h.

◆ time

double opencarp::timer_manager::time

current time

Definition at line 76 of file timer_utils.h.

◆ time_step

double opencarp::timer_manager::time_step

global reference time step

Definition at line 78 of file timer_utils.h.

◆ timers

std::vector<base_timer*> opencarp::timer_manager::timers

vector containing individual timers

Definition at line 84 of file timer_utils.h.


The documentation for this class was generated from the following files: