pub struct EventHandler<F: IntegrateFloat> {
pub specs: Vec<EventSpec<F>>,
pub record: EventRecord<F>,
/* private fields */
}Expand description
Event detection and handling during ODE integration
Fields§
§specs: Vec<EventSpec<F>>List of event specifications to detect
record: EventRecord<F>Record of detected events
Implementations§
Source§impl<F: IntegrateFloat> EventHandler<F>
impl<F: IntegrateFloat> EventHandler<F>
Sourcepub fn new(specs: Vec<EventSpec<F>>) -> Self
pub fn new(specs: Vec<EventSpec<F>>) -> Self
Create a new event handler with the given event specifications
Sourcepub fn initialize<Func>(
&mut self,
t: F,
y: &Array1<F>,
event_funcs: &[Func],
) -> IntegrateResult<()>where
Func: Fn(F, ArrayView1<'_, F>) -> F,
pub fn initialize<Func>(
&mut self,
t: F,
y: &Array1<F>,
event_funcs: &[Func],
) -> IntegrateResult<()>where
Func: Fn(F, ArrayView1<'_, F>) -> F,
Initialize the event handler with the initial state
Sourcepub fn check_events<Func>(
&mut self,
t: F,
y: &Array1<F>,
dense_output: Option<&DenseSolution<F>>,
event_funcs: &[Func],
) -> IntegrateResult<EventAction>where
Func: Fn(F, ArrayView1<'_, F>) -> F,
pub fn check_events<Func>(
&mut self,
t: F,
y: &Array1<F>,
dense_output: Option<&DenseSolution<F>>,
event_funcs: &[Func],
) -> IntegrateResult<EventAction>where
Func: Fn(F, ArrayView1<'_, F>) -> F,
Check for events between the last state and the current state
Sourcepub fn get_record(&self) -> &EventRecord<F>
pub fn get_record(&self) -> &EventRecord<F>
Get the record of all detected events
Sourcepub fn should_stop(&self) -> bool
pub fn should_stop(&self) -> bool
Check if an event occurred that requires stopping the integration
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for EventHandler<F>where
F: Freeze,
impl<F> RefUnwindSafe for EventHandler<F>where
F: RefUnwindSafe,
impl<F> Send for EventHandler<F>where
F: Send,
impl<F> Sync for EventHandler<F>where
F: Sync,
impl<F> Unpin for EventHandler<F>where
F: Unpin,
impl<F> UnwindSafe for EventHandler<F>where
F: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more