pub struct MOLWaveEquation1D { /* private fields */ }Expand description
Method of Lines solver for 1D Wave Equation
Solves the equation: ∂²u/∂t² = c² ∂²u/∂x² + f(x,t,u)
Implementations§
Source§impl MOLWaveEquation1D
impl MOLWaveEquation1D
Sourcepub fn new(
domain: Domain,
time_range: [f64; 2],
wave_speed_squared: impl Fn(f64, f64, f64) -> f64 + Send + Sync + 'static,
initial_condition: impl Fn(f64) -> f64 + Send + Sync + 'static,
initial_velocity: impl Fn(f64) -> f64 + Send + Sync + 'static,
boundary_conditions: Vec<BoundaryCondition<f64>>,
options: Option<MOLOptions>,
) -> PDEResult<Self>
pub fn new( domain: Domain, time_range: [f64; 2], wave_speed_squared: impl Fn(f64, f64, f64) -> f64 + Send + Sync + 'static, initial_condition: impl Fn(f64) -> f64 + Send + Sync + 'static, initial_velocity: impl Fn(f64) -> f64 + Send + Sync + 'static, boundary_conditions: Vec<BoundaryCondition<f64>>, options: Option<MOLOptions>, ) -> PDEResult<Self>
Create a new Method of Lines solver for the 1D wave equation
Sourcepub fn with_source(
self,
source_term: impl Fn(f64, f64, f64) -> f64 + Send + Sync + 'static,
) -> Self
pub fn with_source( self, source_term: impl Fn(f64, f64, f64) -> f64 + Send + Sync + 'static, ) -> Self
Add a source term to the wave equation
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<MOLHyperbolicResult>
pub fn solve(&self) -> PDEResult<MOLHyperbolicResult>
Solve the wave equation
Trait Implementations§
Source§impl Clone for MOLWaveEquation1D
impl Clone for MOLWaveEquation1D
Source§fn clone(&self) -> MOLWaveEquation1D
fn clone(&self) -> MOLWaveEquation1D
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 MOLWaveEquation1D
impl !RefUnwindSafe for MOLWaveEquation1D
impl Send for MOLWaveEquation1D
impl Sync for MOLWaveEquation1D
impl Unpin for MOLWaveEquation1D
impl !UnwindSafe for MOLWaveEquation1D
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