Skip to main content

ExitCondition

Trait ExitCondition 

Source
pub trait ExitCondition {
    // Required method
    fn check(
        &self,
        diag: &GlobalDiagnostics,
        initial: &GlobalDiagnostics,
    ) -> Option<ExitReason>;
}
Expand description

Trait for simulation exit predicates. Evaluated after each timestep.

§Examples

use caustic::{EnergyDriftCondition, ExitCondition, WallClockCondition};

// Exit if relative energy drift exceeds 1%
let energy_exit = EnergyDriftCondition { tolerance: 0.01 };

// Exit after 1 hour of wall-clock time
let wall_exit = WallClockCondition::new(3600.0);

Required Methods§

Implementors§