pub struct MOLSystem<S: Scalar, P: PdeSystem<S>, BcL: BoundaryCondition<S>, BcR: BoundaryCondition<S>> { /* private fields */ }Expand description
Method of Lines system that wraps a PDE for use with ODE solvers.
This converts a PDE to an ODE system by:
- Storing solution values at interior grid points
- Computing spatial derivatives using FDM
- Applying boundary conditions
Implementations§
Source§impl<S: Scalar, P: PdeSystem<S>, BcL: BoundaryCondition<S>, BcR: BoundaryCondition<S>> MOLSystem<S, P, BcL, BcR>
impl<S: Scalar, P: PdeSystem<S>, BcL: BoundaryCondition<S>, BcR: BoundaryCondition<S>> MOLSystem<S, P, BcL, BcR>
Sourcepub fn new(pde: P, grid: Grid1D<S>, bc_left: BcL, bc_right: BcR) -> Self
pub fn new(pde: P, grid: Grid1D<S>, bc_left: BcL, bc_right: BcR) -> Self
Create a new MOL system.
Sourcepub fn n_interior(&self) -> usize
pub fn n_interior(&self) -> usize
Number of interior points (ODE dimension).
Sourcepub fn build_full_solution(&self, t: S, u_interior: &[S]) -> Vec<S>
pub fn build_full_solution(&self, t: S, u_interior: &[S]) -> Vec<S>
Build full solution array including boundaries.
Takes interior values and adds boundary values.
Trait Implementations§
Source§impl<S: Clone + Scalar, P: Clone + PdeSystem<S>, BcL: Clone + BoundaryCondition<S>, BcR: Clone + BoundaryCondition<S>> Clone for MOLSystem<S, P, BcL, BcR>
impl<S: Clone + Scalar, P: Clone + PdeSystem<S>, BcL: Clone + BoundaryCondition<S>, BcR: Clone + BoundaryCondition<S>> Clone for MOLSystem<S, P, BcL, BcR>
Source§impl<S: Scalar, P: PdeSystem<S>, BcL: BoundaryCondition<S>, BcR: BoundaryCondition<S>> OdeSystem<S> for MOLSystem<S, P, BcL, BcR>
impl<S: Scalar, P: PdeSystem<S>, BcL: BoundaryCondition<S>, BcR: BoundaryCondition<S>> OdeSystem<S> for MOLSystem<S, P, BcL, BcR>
Source§fn jacobian(&self, t: S, y: &[S], jac: &mut [S])
fn jacobian(&self, t: S, y: &[S], jac: &mut [S])
Optionally compute the Jacobian:
J = ∂f/∂y, row-major
(jac[i*n + j] = ∂f_i/∂y_j, length n²). Read moreSource§fn is_autonomous(&self) -> bool
fn is_autonomous(&self) -> bool
Is the system autonomous? (f does not depend on t explicitly)
Source§fn has_mass_matrix(&self) -> bool
fn has_mass_matrix(&self) -> bool
Does this system have a mass matrix?
Source§fn mass_matrix(&self, mass: &mut [S])
fn mass_matrix(&self, mass: &mut [S])
Get the mass matrix M for the DAE: M * y’ = f(t, y) Read more
Source§fn is_singular_mass(&self) -> bool
fn is_singular_mass(&self) -> bool
Is the mass matrix singular? (i.e., is this a DAE?)
Auto Trait Implementations§
impl<S, P, BcL, BcR> Freeze for MOLSystem<S, P, BcL, BcR>
impl<S, P, BcL, BcR> RefUnwindSafe for MOLSystem<S, P, BcL, BcR>
impl<S, P, BcL, BcR> Send for MOLSystem<S, P, BcL, BcR>
impl<S, P, BcL, BcR> Sync for MOLSystem<S, P, BcL, BcR>
impl<S, P, BcL, BcR> Unpin for MOLSystem<S, P, BcL, BcR>
impl<S, P, BcL, BcR> UnsafeUnpin for MOLSystem<S, P, BcL, BcR>
impl<S, P, BcL, BcR> UnwindSafe for MOLSystem<S, P, BcL, BcR>
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