Struct diffsol::ode_solver::sdirk::Sdirk

source ·
pub struct Sdirk<M, Eqn, LS>
where M: DenseMatrix<T = Eqn::T, V = Eqn::V>, LS: LinearSolver<SdirkCallable<Eqn>>, Eqn: OdeEquations, for<'a> &'a Eqn::V: VectorRef<Eqn::V>, for<'a> &'a Eqn::M: MatrixRef<Eqn::M>,
{ /* private fields */ }
Expand description

A singly diagonally implicit Runge-Kutta method. Can optionally have an explicit first stage for ESDIRK methods. The particular method is defined by the Tableau used to create the solver. If the beta matrix of the Tableau is present this is used for interpolation, otherwise hermite interpolation is used.

Restrictions:

  • The upper triangular part of the a matrix must be zero (i.e. not fully implicit).
  • The diagonal of the a matrix must be the same non-zero value for all rows (i.e. an SDIRK method), except for the first row which can be zero for ESDIRK methods.
  • The last row of the a matrix must be the same as the b vector, and the last element of the c vector must be 1 (i.e. a stiffly accurate method)

Implementations§

source§

impl<M, Eqn, LS> Sdirk<M, Eqn, LS>
where LS: LinearSolver<SdirkCallable<Eqn>>, M: DenseMatrix<T = Eqn::T, V = Eqn::V>, Eqn: OdeEquations, for<'a> &'a Eqn::V: VectorRef<Eqn::V>, for<'a> &'a Eqn::M: MatrixRef<Eqn::M>,

source

pub fn new(tableau: Tableau<M>, linear_solver: LS) -> Self

source

pub fn get_statistics(&self) -> &BdfStatistics<Eqn::T>

Trait Implementations§

source§

impl<M, Eqn, LS> OdeSolverMethod<Eqn> for Sdirk<M, Eqn, LS>
where LS: LinearSolver<SdirkCallable<Eqn>>, M: DenseMatrix<T = Eqn::T, V = Eqn::V>, Eqn: OdeEquations, for<'a> &'a Eqn::V: VectorRef<Eqn::V>, for<'a> &'a Eqn::M: MatrixRef<Eqn::M>,

source§

fn problem(&self) -> Option<&OdeSolverProblem<Eqn>>

Get the current problem if it has been set
source§

fn order(&self) -> usize

Get the current order of accuracy of the solver (e.g. explict euler method is first-order)
source§

fn take_state(&mut self) -> Option<OdeSolverState<Eqn::V>>

Take the current state of the solver, if it exists, returning it to the user. This is useful if you want to use this state in another solver or problem. Note that this will unset the current problem and solver state, so you will need to call set_problem again before calling step or solve.
source§

fn set_problem( &mut self, state: OdeSolverState<Eqn::V>, problem: &OdeSolverProblem<Eqn> )

Set the problem to solve, this performs any initialisation required by the solver. Call this before calling step or solve. The solver takes ownership of the initial state given by state, this is assumed to be consistent with any algebraic constraints, and the time step h is assumed to be set appropriately for the problem
source§

fn step(&mut self) -> Result<OdeSolverStopReason<Eqn::T>>

Step the solution forward by one step, altering the internal state of the solver. The return value is a Result containing the reason for stopping the solver, possible reasons are: Read more
source§

fn set_stop_time(&mut self, tstop: <Eqn as OdeEquations>::T) -> Result<()>

Set a stop time for the solver. The solver will stop when the internal time reaches this time. Once it stops, the stop time is unset. If tstop is at or before the current internal time, an error is returned.
source§

fn interpolate_sens( &self, t: <Eqn as OdeEquations>::T ) -> Result<Vec<<Eqn as OdeEquations>::V>>

Interpolate the sensitivity vectors at a given time. This time should be between the current time and the last solver time step
source§

fn interpolate(&self, t: Eqn::T) -> Result<Eqn::V>

Interpolate the solution at a given time. This time should be between the current time and the last solver time step
source§

fn state(&self) -> Option<&OdeSolverState<Eqn::V>>

Get the current state of the solver, if it exists
source§

fn state_mut(&mut self) -> Option<&mut OdeSolverState<Eqn::V>>

Get a mutable reference to the current state of the solver, if it exists Note that calling this will cause the next call to step to perform some reinitialisation to take into account the mutated state, this could be expensive for multi-step methods.

Auto Trait Implementations§

§

impl<M, Eqn, LS> !Freeze for Sdirk<M, Eqn, LS>

§

impl<M, Eqn, LS> !RefUnwindSafe for Sdirk<M, Eqn, LS>

§

impl<M, Eqn, LS> !Send for Sdirk<M, Eqn, LS>

§

impl<M, Eqn, LS> !Sync for Sdirk<M, Eqn, LS>

§

impl<M, Eqn, LS> Unpin for Sdirk<M, Eqn, LS>
where &'a <Eqn as OdeEquations>::M: for<'a, 'a> Sized, &'a <Eqn as OdeEquations>::V: for<'a, 'a, 'b> Sized, M: Unpin, <Eqn as OdeEquations>::T: Unpin, <Eqn as OdeEquations>::V: Unpin, LS: Unpin, <<Eqn as OdeEquations>::M as Matrix>::Sparsity: Unpin, <Eqn as OdeEquations>::M: Unpin,

§

impl<M, Eqn, LS> !UnwindSafe for Sdirk<M, Eqn, LS>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.