Skip to main content

EventFunction

Trait EventFunction 

Source
pub trait EventFunction<S: Scalar>: Send + Sync {
    // Required method
    fn evaluate(&self, t: S, y: &[S]) -> S;

    // Provided methods
    fn direction(&self) -> EventDirection { ... }
    fn action(&self) -> EventAction { ... }
}
Expand description

Trait for event functions.

An event function defines a scalar function g(t, y) whose zero-crossings are to be detected during integration.

Required Methods§

Source

fn evaluate(&self, t: S, y: &[S]) -> S

Evaluate the event function g(t, y).

An event occurs when this function crosses zero.

Provided Methods§

Source

fn direction(&self) -> EventDirection

Direction of zero-crossing to detect.

Defaults to Both (detect crossings in either direction).

Source

fn action(&self) -> EventAction

Action to take when event is detected.

Defaults to Continue (record and continue integration).

Implementors§