pub struct ReactionDiffusion {
pub width: usize,
pub height: usize,
pub u: Vec<f64>,
pub v: Vec<f64>,
pub d_u: f64,
pub d_v: f64,
pub feed: f64,
pub kill: f64,
}Expand description
Reaction-diffusion simulation using the Gray-Scott model.
The Gray-Scott model produces Turing patterns by simulating two chemical species U and V with different diffusion rates and reaction kinetics.
Fields§
§width: usizeGrid width
height: usizeGrid height
u: Vec<f64>Concentration of species U
v: Vec<f64>Concentration of species V
d_u: f64Diffusion rate of U
d_v: f64Diffusion rate of V
feed: f64Feed rate
kill: f64Kill rate
Implementations§
Source§impl ReactionDiffusion
impl ReactionDiffusion
Sourcepub fn new(
width: usize,
height: usize,
d_u: f64,
d_v: f64,
feed: f64,
kill: f64,
) -> Self
pub fn new( width: usize, height: usize, d_u: f64, d_v: f64, feed: f64, kill: f64, ) -> Self
Create a new Gray-Scott reaction-diffusion grid.
§Parameters
width,height: grid dimensionsd_u: diffusion rate of U (typically 0.2)d_v: diffusion rate of V (typically 0.1)feed: feed rate (controls pattern type)kill: kill rate (controls pattern type)
Sourcepub fn seed_center(&mut self)
pub fn seed_center(&mut self)
Seed with a square perturbation at the center.
Trait Implementations§
Source§impl Clone for ReactionDiffusion
impl Clone for ReactionDiffusion
Source§fn clone(&self) -> ReactionDiffusion
fn clone(&self) -> ReactionDiffusion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ReactionDiffusion
impl RefUnwindSafe for ReactionDiffusion
impl Send for ReactionDiffusion
impl Sync for ReactionDiffusion
impl Unpin for ReactionDiffusion
impl UnsafeUnpin for ReactionDiffusion
impl UnwindSafe for ReactionDiffusion
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.