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#[cfg(feature = "python")]
45mod python;
46
47#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
49pub struct IntegrationDetails {
50 pub step: Duration,
52 pub error: f64,
54 pub attempts: u8,
56}
57
58impl fmt::Display for IntegrationDetails {
59 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
60 write!(
61 f,
62 "IntegrationDetails {{step: {}, error: {:.3e}, attempts: {}}}",
63 self.step, self.error, self.attempts
64 )
65 }
66}
67
68#[derive(Debug, PartialEq, Snafu)]
69pub enum PropagationError {
70 #[snafu(display("encountered a dynamics error {source}"))]
71 Dynamics { source: DynamicsError },
72 #[snafu(display("when propagating until an event: {source}"))]
73 TrajectoryEventError { source: TrajError },
74 #[snafu(display("requested propagation until event #{nth} but only {found} found"))]
75 NthEventError { nth: usize, found: usize },
76 #[snafu(display("propagation failed because {source}"))]
77 PropConfigError { source: ConfigError },
78 #[snafu(display("propagation encountered a math error {source}"))]
79 PropMathError { source: MathError },
80 #[snafu(display("propagation encountered an analysis error {source}"))]
81 PropAnalysisError {
82 #[snafu(source(from(AnalysisError, Box::new)))]
83 source: Box<AnalysisError>,
84 },
85 PropAlmanacError {
86 #[snafu(source(from(AlmanacError, Box::new)))]
87 source: Box<AlmanacError>,
88 },
89}