pub struct BackwardEuler1D { /* private fields */ }Expand description
Backward Euler solver for 1D parabolic PDEs
This solver uses the Backward Euler method, which is a first-order fully implicit method that is L-stable and well-suited for stiff problems.
Implementations§
Source§impl BackwardEuler1D
impl BackwardEuler1D
Sourcepub fn new(
domain: Domain,
time_range: [f64; 2],
diffusion_coeff: impl Fn(f64, f64, f64) -> f64 + Send + Sync + 'static,
initial_condition: impl Fn(f64) -> f64 + Send + Sync + 'static,
boundary_conditions: Vec<BoundaryCondition<f64>>,
options: Option<ImplicitOptions>,
) -> PDEResult<Self>
pub fn new( domain: Domain, time_range: [f64; 2], diffusion_coeff: impl Fn(f64, f64, f64) -> f64 + Send + Sync + 'static, initial_condition: impl Fn(f64) -> f64 + Send + Sync + 'static, boundary_conditions: Vec<BoundaryCondition<f64>>, options: Option<ImplicitOptions>, ) -> PDEResult<Self>
Create a new Backward Euler solver for 1D parabolic PDEs
Sourcepub fn with_advection(
self,
advection_coeff: impl Fn(f64, f64, f64) -> f64 + Send + Sync + 'static,
) -> Self
pub fn with_advection( self, advection_coeff: impl Fn(f64, f64, f64) -> f64 + Send + Sync + 'static, ) -> Self
Add an advection term to the PDE
Sourcepub fn with_reaction(
self,
reaction_term: impl Fn(f64, f64, f64) -> f64 + Send + Sync + 'static,
) -> Self
pub fn with_reaction( self, reaction_term: impl Fn(f64, f64, f64) -> f64 + Send + Sync + 'static, ) -> Self
Add a reaction term to the PDE
Sourcepub fn with_fd_scheme(self, scheme: FiniteDifferenceScheme) -> Self
pub fn with_fd_scheme(self, scheme: FiniteDifferenceScheme) -> Self
Set the finite difference scheme for spatial discretization
Sourcepub fn solve(&self) -> PDEResult<ImplicitResult>
pub fn solve(&self) -> PDEResult<ImplicitResult>
Solve the PDE using the Backward Euler method
Auto Trait Implementations§
impl Freeze for BackwardEuler1D
impl !RefUnwindSafe for BackwardEuler1D
impl Send for BackwardEuler1D
impl Sync for BackwardEuler1D
impl Unpin for BackwardEuler1D
impl !UnwindSafe for BackwardEuler1D
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> 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