Skip to main content

PdeSystem

Trait PdeSystem 

Source
pub trait PdeSystem<S: Scalar> {
    // Required method
    fn rhs(&self, t: S, x: S, u: S, du_dx: S, d2u_dx2: S) -> S;

    // Provided method
    fn n_components(&self) -> usize { ... }
}
Expand description

Trait for 1D PDE systems that can be solved via MOL.

The PDE has the form:

∂u/∂t = F(t, x, u, ∂u/∂x, ∂²u/∂x², ...)

Required Methods§

Source

fn rhs(&self, t: S, x: S, u: S, du_dx: S, d2u_dx2: S) -> S

Compute the RHS of the PDE at a single spatial point.

§Arguments
  • t - Current time
  • x - Spatial coordinate
  • u - Solution value at this point
  • du_dx - First spatial derivative
  • d2u_dx2 - Second spatial derivative

Provided Methods§

Source

fn n_components(&self) -> usize

Number of solution components (for systems).

Implementors§

Source§

impl<S: Scalar> PdeSystem<S> for HeatEquation1D<S>

Source§

impl<S: Scalar, R: Fn(S) -> S + Clone> PdeSystem<S> for DiffusionReaction1D<S, R>