pub struct DiffusionReaction1D<S: Scalar, R>{
pub diffusion: S,
pub reaction: R,
}Expand description
1D Diffusion-Reaction equation: ∂u/∂t = D ∂²u/∂x² + f(u).
Common examples:
- Fisher equation: f(u) = u(1-u)
- Allen-Cahn: f(u) = u - u³
- Logistic: f(u) = ru(1 - u/K)
Fields§
§diffusion: SDiffusion coefficient D
reaction: RReaction term f(u)
Implementations§
Source§impl<S: Scalar, R: Fn(S) -> S + Clone> DiffusionReaction1D<S, R>
impl<S: Scalar, R: Fn(S) -> S + Clone> DiffusionReaction1D<S, R>
pub fn new(diffusion: S, reaction: R) -> Self
Sourcepub fn fisher(
diffusion: S,
growth_rate: S,
) -> DiffusionReaction1D<S, impl Fn(S) -> S + Clone>where
S: Copy,
pub fn fisher(
diffusion: S,
growth_rate: S,
) -> DiffusionReaction1D<S, impl Fn(S) -> S + Clone>where
S: Copy,
Create Fisher equation: D ∂²u/∂x² + ru(1-u).
Sourcepub fn allen_cahn(
diffusion: S,
) -> DiffusionReaction1D<S, impl Fn(S) -> S + Clone>where
S: Copy,
pub fn allen_cahn(
diffusion: S,
) -> DiffusionReaction1D<S, impl Fn(S) -> S + Clone>where
S: Copy,
Create Allen-Cahn equation: D ∂²u/∂x² + u - u³.
Trait Implementations§
Source§impl<S: Clone + Scalar, R> Clone for DiffusionReaction1D<S, R>
impl<S: Clone + Scalar, R> Clone for DiffusionReaction1D<S, R>
Source§fn clone(&self) -> DiffusionReaction1D<S, R>
fn clone(&self) -> DiffusionReaction1D<S, R>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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<S, R> Freeze for DiffusionReaction1D<S, R>
impl<S, R> RefUnwindSafe for DiffusionReaction1D<S, R>where
S: RefUnwindSafe,
R: RefUnwindSafe,
impl<S, R> Send for DiffusionReaction1D<S, R>where
R: Send,
impl<S, R> Sync for DiffusionReaction1D<S, R>where
R: Sync,
impl<S, R> Unpin for DiffusionReaction1D<S, R>
impl<S, R> UnsafeUnpin for DiffusionReaction1D<S, R>where
S: UnsafeUnpin,
R: UnsafeUnpin,
impl<S, R> UnwindSafe for DiffusionReaction1D<S, R>where
S: UnwindSafe,
R: UnwindSafe,
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more