Chombo + EB  3.2
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Scheduler Class Reference

#include <Scheduler.H>

Classes

class  PeriodicFunction
 
struct  PeriodicFunctionLessThan
 Ordering operator for pointers to periodic functions. More...
 

Public Member Functions

 Scheduler ()
 Default constructor. Makes an empty schedule. More...
 
virtual ~Scheduler ()
 Destructor. More...
 
void schedule (RefCountedPtr< PeriodicFunction > a_function, int a_interval)
 
void schedule (RefCountedPtr< PeriodicFunction > a_function, Real a_interval)
 
void execute (int a_step, Real a_time) const
 
void setUp (AMR &a_AMR)
 
void conclude (int a_step, Real a_time) const
 

Private Member Functions

 Scheduler (const Scheduler &)
 
Scheduleroperator= (const Scheduler &)
 

Private Attributes

std::map< RefCountedPtr< PeriodicFunction >, int, PeriodicFunctionLessThanm_stepTriggeredFunctions
 
std::map< RefCountedPtr< PeriodicFunction >, std::pair< Real, Real >, PeriodicFunctionLessThanm_timeTriggeredFunctions
 

Detailed Description

This class executes functions at periodic intervals during an AMR simulation.

Constructor & Destructor Documentation

◆ Scheduler() [1/2]

Scheduler::Scheduler ( )

Default constructor. Makes an empty schedule.

Referenced by Scheduler::PeriodicFunctionLessThan::operator()().

◆ ~Scheduler()

virtual Scheduler::~Scheduler ( )
virtual

◆ Scheduler() [2/2]

Scheduler::Scheduler ( const Scheduler )
private

Member Function Documentation

◆ schedule() [1/2]

void Scheduler::schedule ( RefCountedPtr< PeriodicFunction a_function,
int  a_interval 
)

Add a periodic function that is called every a_interval steps.

Parameters
a_functionThe function to be called periodically.
a_intervalThe number of steps that elapse between calls to a_function.

Referenced by Scheduler::PeriodicFunctionLessThan::operator()().

◆ schedule() [2/2]

void Scheduler::schedule ( RefCountedPtr< PeriodicFunction a_function,
Real  a_interval 
)

Add a periodic function that is called every a_interval time units.

Parameters
a_functionThe function to be called periodically.
a_intervalThe number of simulation time units that elapse between calls to a_function.

◆ execute()

void Scheduler::execute ( int  a_step,
Real  a_time 
) const

Execute the schedule on the given step and at the given time.

Parameters
a_stepThe step in the simulation at which the schedule is executed.
a_timeThe simulation time at which the schedule is executed.

Referenced by Scheduler::PeriodicFunctionLessThan::operator()().

◆ setUp()

void Scheduler::setUp ( AMR a_AMR)

This function is called by the associated AMR object to set up interactions between itself and the periodic functions within the scheduler.

◆ conclude()

void Scheduler::conclude ( int  a_step,
Real  a_time 
) const

This function is called by the associated AMR object upon the conclusion of a simulation.

Parameters
a_stepThe step in the simulation at which the schedule is executed.
a_timeThe simulation time at which the schedule is executed.

◆ operator=()

Scheduler& Scheduler::operator= ( const Scheduler )
private

Member Data Documentation

◆ m_stepTriggeredFunctions

std::map<RefCountedPtr<PeriodicFunction>, int, PeriodicFunctionLessThan> Scheduler::m_stepTriggeredFunctions
mutableprivate

◆ m_timeTriggeredFunctions

std::map<RefCountedPtr<PeriodicFunction>, std::pair<Real, Real>, PeriodicFunctionLessThan> Scheduler::m_timeTriggeredFunctions
mutableprivate

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