rebound-rs 4.6.0-alpha.1

Rust wrapper for the REBOUND N-body simulation library.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::simulation::SimulationWrite;
use rebound_bind as rb;

pub trait SimulationOutputWrite: SimulationWrite {
    fn output_timing(&mut self, tmax: f64) -> &mut Self {
        unsafe {
            rb::reb_simulation_output_timing(self.raw_mut(), tmax);
        }
        self
    }

    fn output_check(&mut self, t: f64) -> bool {
        unsafe { rb::reb_simulation_output_check(self.raw_mut(), t) == 1 }
    }
}

impl<T: SimulationWrite + ?Sized> SimulationOutputWrite for T {}