Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
CheckpointControl Class Reference

#include <checkpoint_control.h>

Public Member Functions

 CheckpointControl (Parameters::Restart &param)
bool is_checkpoint_time_step (const unsigned int time_step_number)
unsigned int get_next_checkpoint_id () const
std::string get_filename () const
void serialize (boost::archive::text_oarchive &ar) const
void deserialize (boost::archive::text_iarchive &ar)

Private Member Functions

void increment_checkpoint_id ()

Private Attributes

const unsigned int max_checkpoint_id
unsigned int next_checkpoint_id
const unsigned int checkpointing_frequency
const bool restart
const std::string filename

Detailed Description

Definition at line 12 of file checkpoint_control.h.

Constructor & Destructor Documentation

◆ CheckpointControl()

CheckpointControl::CheckpointControl ( Parameters::Restart & param)
inline

The CheckpointControl is responsible for keeping track of the next checkpoint id to use.

Parameters
paramRestart struct - Controls writing and reading simulation checkpoints.

Definition at line 22 of file checkpoint_control.h.

References checkpointing_frequency, filename, max_checkpoint_id, next_checkpoint_id, and restart.

Member Function Documentation

◆ deserialize()

void CheckpointControl::deserialize ( boost::archive::text_iarchive & ar)
inline

Deserialize an input archive to the checkpoint controller object.

Parameters
arInput archive where the attributes are stored.

Definition at line 78 of file checkpoint_control.h.

References next_checkpoint_id.

◆ get_filename()

std::string CheckpointControl::get_filename ( ) const
inline

Return the prefix for the restart files.

Definition at line 58 of file checkpoint_control.h.

References filename.

◆ get_next_checkpoint_id()

unsigned int CheckpointControl::get_next_checkpoint_id ( ) const
inline

Return the next checkpoint id.

Definition at line 49 of file checkpoint_control.h.

References next_checkpoint_id.

◆ increment_checkpoint_id()

void CheckpointControl::increment_checkpoint_id ( )
inlineprivate

Calculate the next checkpoint id.

Definition at line 88 of file checkpoint_control.h.

References max_checkpoint_id, and next_checkpoint_id.

◆ is_checkpoint_time_step()

bool CheckpointControl::is_checkpoint_time_step ( const unsigned int time_step_number)
inline

Return true if a checkpoint should be made at the current time step.

Parameters
time_step_numberCurrent time step.

Definition at line 35 of file checkpoint_control.h.

References checkpointing_frequency, increment_checkpoint_id(), and restart.

◆ serialize()

void CheckpointControl::serialize ( boost::archive::text_oarchive & ar) const
inline

Serialize the checkpoint controller object to an output archive.

Parameters
arOutput archive where the attributes are stored.

Definition at line 68 of file checkpoint_control.h.

References next_checkpoint_id.

Member Data Documentation

◆ checkpointing_frequency

const unsigned int CheckpointControl::checkpointing_frequency
private

Definition at line 95 of file checkpoint_control.h.

◆ filename

const std::string CheckpointControl::filename
private

Definition at line 97 of file checkpoint_control.h.

◆ max_checkpoint_id

const unsigned int CheckpointControl::max_checkpoint_id
private

Definition at line 93 of file checkpoint_control.h.

◆ next_checkpoint_id

unsigned int CheckpointControl::next_checkpoint_id
private

Definition at line 94 of file checkpoint_control.h.

◆ restart

const bool CheckpointControl::restart
private

Definition at line 96 of file checkpoint_control.h.


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