pub struct ParametricMOLSystem2D<S: SparseScalar> { /* private fields */ }Expand description
Parametric 2D Method of Lines system.
See the module-level docs for the parameter layout, the linearity argument that makes the scaled-operator path correct, and the boundary-condition handling.
Implementations§
Source§impl<S: SparseScalar> ParametricMOLSystem2D<S>
impl<S: SparseScalar> ParametricMOLSystem2D<S>
Sourcepub fn heat(
grid: Grid2D<S>,
alpha_nominal: S,
bc: &BoundaryConditions2D<S>,
) -> Self
pub fn heat( grid: Grid2D<S>, alpha_nominal: S, bc: &BoundaryConditions2D<S>, ) -> Self
Build a parametric heat equation u_t = α∇²u with the diffusion
coefficient α as the single parameter.
Sourcepub fn heat_with_reaction<R>(
grid: Grid2D<S>,
alpha_nominal: S,
bc: &BoundaryConditions2D<S>,
nominal_reaction_params: Vec<S>,
reaction: R,
) -> Self
pub fn heat_with_reaction<R>( grid: Grid2D<S>, alpha_nominal: S, bc: &BoundaryConditions2D<S>, nominal_reaction_params: Vec<S>, reaction: R, ) -> Self
Build a parametric heat equation with a parametric reaction term.
The full parameter vector is [α, reaction_params...] —
nominal_reaction_params supplies nominal values for the reaction
parameters only; α goes in slot 0 separately.
The reaction closure receives (t, x, y, u, &p_full) where p_full
is the full parameter slice (p_full[0] is α; p_full[1..] are the
reaction parameters supplied here).
Sourcepub fn n_interior(&self) -> usize
pub fn n_interior(&self) -> usize
Number of interior points (the ODE state dimension).
Trait Implementations§
Source§impl<S: SparseScalar> ParametricOdeSystem<S> for ParametricMOLSystem2D<S>
impl<S: SparseScalar> ParametricOdeSystem<S> for ParametricMOLSystem2D<S>
Source§fn jacobian_y(&self, t: S, y: &[S], jac: &mut [S])
fn jacobian_y(&self, t: S, y: &[S], jac: &mut [S])
Analytical state Jacobian: α · L0 plus the diagonal reaction
contribution. Same structure as MOLSystem2D::jacobian, but the
linear part is scaled by α from the parameter vector — and the
reaction sees the full parameter slice.
Source§fn jacobian_p(&self, t: S, y: &[S], jp: &mut [S])
fn jacobian_p(&self, t: S, y: &[S], jp: &mut [S])
Analytical parameter Jacobian. Column 0 (the α slot) is L0·y + bc_rhs_0 analytically, plus any ∂R/∂α contribution from the
reaction closure (FD-detected). Columns 1..N_s are pure reaction
contributions (FD on the closure with the relevant slot perturbed).
The reaction is pointwise so each column has only diagonal entries
(one nonzero per grid point).
Source§fn params(&self) -> &[S]
fn params(&self) -> &[S]
Self::n_params.Source§fn has_analytical_jacobian_y(&self) -> bool
fn has_analytical_jacobian_y(&self) -> bool
true iff Self::jacobian_y has been overridden with an
analytical implementation. Default: false. Read moreSource§fn has_analytical_jacobian_p(&self) -> bool
fn has_analytical_jacobian_p(&self) -> bool
true iff Self::jacobian_p has been overridden with an
analytical implementation. Default: false. See
Self::has_analytical_jacobian_y for the rationale, contract,
and debug-build consistency check.Auto Trait Implementations§
impl<S> Freeze for ParametricMOLSystem2D<S>
impl<S> !RefUnwindSafe for ParametricMOLSystem2D<S>
impl<S> Send for ParametricMOLSystem2D<S>
impl<S> Sync for ParametricMOLSystem2D<S>
impl<S> Unpin for ParametricMOLSystem2D<S>where
S: Unpin,
impl<S> UnsafeUnpin for ParametricMOLSystem2D<S>
impl<S> !UnwindSafe for ParametricMOLSystem2D<S>
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
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>
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>
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