pub trait IVPSolver<'a, D: Dimension>: Sized{
type Error: Error + From<IVPError>;
type Field: ComplexField + Copy;
type RealField: RealField;
type UserData: Clone;
type Derivative: Derivative<Self::Field, D, Self::UserData> + 'a;
type Solver: IVPStepper<D, Error = Self::Error, Field = Self::Field, RealField = Self::RealField, UserData = Self::UserData>;
// Required methods
fn new() -> Result<Self, Self::Error>;
fn new_dyn(size: usize) -> Result<Self, Self::Error>;
fn dim(&self) -> D;
fn with_tolerance(self, tol: Self::RealField) -> Result<Self, Self::Error>;
fn with_maximum_dt(self, max: Self::RealField) -> Result<Self, Self::Error>;
fn with_minimum_dt(self, min: Self::RealField) -> Result<Self, Self::Error>;
fn with_initial_time(
self,
initial: Self::RealField,
) -> Result<Self, Self::Error>;
fn with_ending_time(
self,
ending: Self::RealField,
) -> Result<Self, Self::Error>;
fn with_initial_conditions(
self,
start: BVector<Self::Field, D>,
) -> Result<Self, Self::Error>;
fn with_derivative(self, derivative: Self::Derivative) -> Self;
fn solve(
self,
data: Self::UserData,
) -> Result<IVPIterator<D, Self::Solver>, Self::Error>;
// Provided method
fn with_initial_conditions_slice(
self,
start: &[Self::Field],
) -> Result<Self, Self::Error> { ... }
}
Expand description
Trait covering all initial value problem solvers. Build up the solver using the parameter builder functions and then use solve.
This is used as a builder pattern, setting parameters of the solver.
IVPSolver
implementations should implement a step function that
returns an IVPStatus, then a blanket impl will allow it to be used as an
IntoIterator for the user to iterate over the results.
Required Associated Types§
Sourcetype Error: Error + From<IVPError>
type Error: Error + From<IVPError>
Error type. IVPError must be able to convert to the error type.
Sourcetype Field: ComplexField + Copy
type Field: ComplexField + Copy
The field, complex or real, that the solver is operating on.
Sourcetype Derivative: Derivative<Self::Field, D, Self::UserData> + 'a
type Derivative: Derivative<Self::Field, D, Self::UserData> + 'a
The type signature of the derivative function to use
Required Methods§
Sourcefn new() -> Result<Self, Self::Error>
fn new() -> Result<Self, Self::Error>
Create the solver. Will fail for dynamically sized solvers
Sourcefn new_dyn(size: usize) -> Result<Self, Self::Error>
fn new_dyn(size: usize) -> Result<Self, Self::Error>
Create the solver with a run-time dimension. Will fail for statically sized solvers
Sourcefn with_tolerance(self, tol: Self::RealField) -> Result<Self, Self::Error>
fn with_tolerance(self, tol: Self::RealField) -> Result<Self, Self::Error>
Set the error tolerance for any condition needing needing a float epsilon
fn with_maximum_dt(self, max: Self::RealField) -> Result<Self, Self::Error>
fn with_minimum_dt(self, min: Self::RealField) -> Result<Self, Self::Error>
fn with_initial_time( self, initial: Self::RealField, ) -> Result<Self, Self::Error>
fn with_ending_time(self, ending: Self::RealField) -> Result<Self, Self::Error>
Sourcefn with_initial_conditions(
self,
start: BVector<Self::Field, D>,
) -> Result<Self, Self::Error>
fn with_initial_conditions( self, start: BVector<Self::Field, D>, ) -> Result<Self, Self::Error>
The initial conditions of the problem, in a BVector. Should reset any previous values.
Sourcefn with_derivative(self, derivative: Self::Derivative) -> Self
fn with_derivative(self, derivative: Self::Derivative) -> Self
Sets the derivative function to use during the solve
Provided Methods§
Sourcefn with_initial_conditions_slice(
self,
start: &[Self::Field],
) -> Result<Self, Self::Error>
fn with_initial_conditions_slice( self, start: &[Self::Field], ) -> Result<Self, Self::Error>
The initial conditions of the problem, should reset any previous values.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.