Skip to main content

EllipticProblem

Trait EllipticProblem 

Source
pub trait EllipticProblem<const N: usize> {
    // Required methods
    fn dimension_kind(&self, dim: usize) -> DimensionKind;
    fn transport(
        &self,
        state: &[f64; N],
        derivs: &StateDerivatives<N>,
    ) -> Transport<N>;
    fn rhs(&self, state: &[f64; N]) -> f64;
    fn boundary_conditions(&self) -> BoundaryConditions<N>;

    // Provided method
    fn reaction(&self, _state: &[f64; N]) -> f64 { ... }
}
Expand description

A stationary finite-difference problem -T u + reaction * u = f on a grid.

The operator is written as

-T u + reaction * u = f

where T u is the transport term built from Transport. The negative sign follows the standard elliptic convention: for a diffusion coefficient D, T u = D u'' and the problem reads -D u'' + rho u = f. The transport source is not used; use EllipticProblem::rhs for the forcing f and EllipticProblem::reaction for the local diagonal coefficient.

Required Methods§

Source

fn dimension_kind(&self, dim: usize) -> DimensionKind

Discretization kind for dim.

Source

fn transport( &self, state: &[f64; N], derivs: &StateDerivatives<N>, ) -> Transport<N>

Transport coefficients for the current field u and derivatives.

The returned source is ignored by the elliptic assembler.

Source

fn rhs(&self, state: &[f64; N]) -> f64

Forcing term f(state) on the right-hand side.

Source

fn boundary_conditions(&self) -> BoundaryConditions<N>

Boundary conditions for each dimension.

Provided Methods§

Source

fn reaction(&self, _state: &[f64; N]) -> f64

Local zero-order coefficient multiplying u on the diagonal.

Defaults to zero.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§