WARPXM v1.10.0
Loading...
Searching...
No Matches
TimestepDecision Class Reference

Encapsulates information necessary to communicate and explain a decision about what timestep should be taken. More...

#include <timestep_decision.h>

Detailed Description

Encapsulates information necessary to communicate and explain a decision about what timestep should be taken.

This class is necessary because sometimes, a dt decision will be made which takes into account other information than the maximally restrictive TimestepConstraint.

In those cases, we want to properly communicate the reasoning in log output.

Public Member Functions

 TimestepDecision ()
 
 TimestepDecision (bool success, real dt, std::shared_ptr< std::string > explanation)
 
 TimestepDecision (bool success, real dt, std::shared_ptr< std::string > explanation, std::shared_ptr< TimestepConstraint > constraint)
 
void reset ()
 Resets everything to default values.
 
bool isSuccess () const
 
real getDt () const
 The timestep that was decided upon.
 
std::shared_ptr< TimestepConstraintgetConstraint () const
 The most restrictive TimestepConstraint that informed the decision.
 
std::shared_ptr< std::string > getExplanation () const
 An explanation for why this timestep was chosen.
 

Static Public Member Functions

static const TimestepDecisionminDt (const TimestepDecision &a, const TimestepDecision &b)
 Compare two TimestepDecisions and return the one with the smallest dt.
 

Constructor & Destructor Documentation

◆ TimestepDecision() [1/3]

TimestepDecision::TimestepDecision ( )
inline

◆ TimestepDecision() [2/3]

TimestepDecision::TimestepDecision ( bool  success,
real  dt,
std::shared_ptr< std::string >  explanation 
)
inline

◆ TimestepDecision() [3/3]

TimestepDecision::TimestepDecision ( bool  success,
real  dt,
std::shared_ptr< std::string >  explanation,
std::shared_ptr< TimestepConstraint constraint 
)
inline

Member Function Documentation

◆ getConstraint()

std::shared_ptr< TimestepConstraint > TimestepDecision::getConstraint ( ) const
inline

The most restrictive TimestepConstraint that informed the decision.

◆ getDt()

real TimestepDecision::getDt ( ) const
inline

The timestep that was decided upon.

◆ getExplanation()

std::shared_ptr< std::string > TimestepDecision::getExplanation ( ) const
inline

An explanation for why this timestep was chosen.

◆ isSuccess()

bool TimestepDecision::isSuccess ( ) const
inline

◆ minDt()

static const TimestepDecision & TimestepDecision::minDt ( const TimestepDecision a,
const TimestepDecision b 
)
inlinestatic

Compare two TimestepDecisions and return the one with the smallest dt.

◆ reset()

void TimestepDecision::reset ( )
inline

Resets everything to default values.


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