nyx_space/propagators/
mod.rs1use anise::{
20 analysis::AnalysisError,
21 errors::{AlmanacError, MathError},
22};
23use snafu::prelude::*;
24use std::fmt;
25
26pub mod error_ctrl;
28pub use self::error_ctrl::*;
29
30mod event;
31
32mod instance;
34pub use instance::*;
35mod propagator;
36pub use propagator::*;
37mod rk_methods;
38pub use rk_methods::*;
39mod options;
40use crate::{dynamics::DynamicsError, io::ConfigError, md::trajectory::TrajError, time::Duration};
41pub use options::*;
42use serde::{Deserialize, Serialize};
43
44#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
46pub struct IntegrationDetails {
47 pub step: Duration,
49 pub error: f64,
51 pub attempts: u8,
53}
54
55impl fmt::Display for IntegrationDetails {
56 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
57 write!(
58 f,
59 "IntegrationDetails {{step: {}, error: {:.3e}, attempts: {}}}",
60 self.step, self.error, self.attempts
61 )
62 }
63}
64
65#[derive(Debug, PartialEq, Snafu)]
66pub enum PropagationError {
67 #[snafu(display("encountered a dynamics error {source}"))]
68 Dynamics { source: DynamicsError },
69 #[snafu(display("when propagating until an event: {source}"))]
70 TrajectoryEventError { source: TrajError },
71 #[snafu(display("requested propagation until event #{nth} but only {found} found"))]
72 NthEventError { nth: usize, found: usize },
73 #[snafu(display("propagation failed because {source}"))]
74 PropConfigError { source: ConfigError },
75 #[snafu(display("propagation encountered a math error {source}"))]
76 PropMathError { source: MathError },
77 #[snafu(display("propagation encountered an analysis error {source}"))]
78 PropAnalysisError {
79 #[snafu(source(from(AnalysisError, Box::new)))]
80 source: Box<AnalysisError>,
81 },
82 PropAlmanacError {
83 #[snafu(source(from(AlmanacError, Box::new)))]
84 source: Box<AlmanacError>,
85 },
86}