nyx_space/propagators/
mod.rs1use anise::errors::MathError;
20use snafu::prelude::*;
21use std::fmt;
22
23pub mod error_ctrl;
25pub use self::error_ctrl::*;
26
27mod instance;
29pub use instance::*;
30mod propagator;
31pub use propagator::*;
32mod rk_methods;
33pub use rk_methods::*;
34mod options;
35use crate::{dynamics::DynamicsError, errors::EventError, io::ConfigError, time::Duration};
36pub use options::*;
37use serde::{Deserialize, Serialize};
38
39#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
41pub struct IntegrationDetails {
42 pub step: Duration,
44 pub error: f64,
46 pub attempts: u8,
48}
49
50impl fmt::Display for IntegrationDetails {
51 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
52 write!(
53 f,
54 "IntegrationDetails {{step: {}, error: {:.3e}, attempts: {}}}",
55 self.step, self.error, self.attempts
56 )
57 }
58}
59
60#[derive(Debug, PartialEq, Snafu)]
61pub enum PropagationError {
62 #[snafu(display("encountered a dynamics error {source}"))]
63 Dynamics { source: DynamicsError },
64 #[snafu(display("when propagating until an event: {source}"))]
65 TrajectoryEventError { source: EventError },
66 #[snafu(display("requested propagation until event #{nth} but only {found} found"))]
67 NthEventError { nth: usize, found: usize },
68 #[snafu(display("propagation failed because {source}"))]
69 PropConfigError { source: ConfigError },
70 #[snafu(display("propagation encountered a math error {source}"))]
71 PropMathError { source: MathError },
72}