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
impl SIRDiffusion2DIVP
sourcepub fn new(
sir_params: SIRParameters,
diff_params: SIRDiffusionParameters,
state: SIRStateSpatial2D
) -> Self
pub fn new( sir_params: SIRParameters, diff_params: SIRDiffusionParameters, state: SIRStateSpatial2D ) -> Self
Creates a new IVP for the SIR diffusion model
sourcepub fn get_result(&self) -> (f64, SIRStateSpatial2DBorrowed<'_>)
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
impl<S> ODEIVP<S, f64> for SIRDiffusion2DIVP
source§fn rhs(&mut self, _: f64, y: &[f64], rhs: &mut [f64])
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>)
fn initial_state(&mut self) -> (f64, Vec<f64>)
Returns initial state
(t_0, y_0)
such that y(t_0) = y_0
Auto Trait Implementations§
impl Freeze for SIRDiffusion2DIVP
impl RefUnwindSafe for SIRDiffusion2DIVP
impl Send for SIRDiffusion2DIVP
impl Sync for SIRDiffusion2DIVP
impl Unpin for SIRDiffusion2DIVP
impl UnwindSafe for SIRDiffusion2DIVP
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