Struct sir_ddft::SIRDiffusion2DIVP

source ·
pub struct SIRDiffusion2DIVP { /* private fields */ }
Expand description

Initial value problem for the SIR model with diffusion in two spatial dimensions

Note: The model is technically a PDE, but is transformed to a high-dimensional ODE via the finite difference method.

Implementations§

source§

impl SIRDiffusion2DIVP

source

pub fn new( sir_params: SIRParameters, diff_params: SIRDiffusionParameters, state: SIRStateSpatial2D ) -> Self

Creates a new IVP for the SIR diffusion model

source

pub fn add_time(&mut self, time: f64)

Increase integration time

source

pub fn get_result(&self) -> (f64, SIRStateSpatial2DBorrowed<'_>)

Get current time and state

Note that the type of the return value is not SIRStateSpatial2D, but a similar construct with references

Trait Implementations§

source§

impl<S> ODEIVP<S, f64> for SIRDiffusion2DIVP

source§

fn rhs(&mut self, _: f64, y: &[f64], rhs: &mut [f64])

Returns right hand side (i.e. the value of f) of IVP y'=f(t,y)
source§

fn initial_state(&mut self) -> (f64, Vec<f64>)

Returns initial state (t_0, y_0) such that y(t_0) = y_0
source§

fn end_step(&mut self, _: f64, _: &[f64], _: &S) -> StopCondition

Called at the end of each integration step (and once for t_0)
source§

fn final_state(&mut self, t: f64, y: Vec<f64>)

Called at the end of integration giving back the state taken in initial_state

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.