pub struct MassMatrix<F: IntegrateFloat> {
pub matrix_type: MassMatrixType,
pub constant_matrix: Option<Array2<F>>,
pub time_function: Option<TimeFunction<F>>,
pub state_function: Option<StateFunction<F>>,
pub is_banded: bool,
pub lower_bandwidth: Option<usize>,
pub upper_bandwidth: Option<usize>,
}Expand description
Mass matrix for ODE system of the form M(t,y)·y’ = f(t,y)
Fields§
§matrix_type: MassMatrixTypeType of the mass matrix
constant_matrix: Option<Array2<F>>Constant mass matrix (if applicable)
time_function: Option<TimeFunction<F>>Function for time-dependent mass matrix
state_function: Option<StateFunction<F>>Function for state-dependent mass matrix
is_banded: boolWhether the mass matrix is sparse/banded
lower_bandwidth: Option<usize>Lower bandwidth for banded matrices
upper_bandwidth: Option<usize>Upper bandwidth for banded matrices
Implementations§
Source§impl<F: IntegrateFloat> MassMatrix<F>
impl<F: IntegrateFloat> MassMatrix<F>
Sourcepub fn time_dependent<Func>(func: Func) -> Self
pub fn time_dependent<Func>(func: Func) -> Self
Create a new time-dependent mass matrix M(t)
Sourcepub fn state_dependent<Func>(func: Func) -> Self
pub fn state_dependent<Func>(func: Func) -> Self
Create a new state-dependent mass matrix M(t,y)
Sourcepub fn with_bandwidth(&mut self, lower: usize, upper: usize) -> &mut Self
pub fn with_bandwidth(&mut self, lower: usize, upper: usize) -> &mut Self
Set the matrix as banded with specified bandwidths
Sourcepub fn evaluate(&self, t: F, y: ArrayView1<'_, F>) -> Option<Array2<F>>
pub fn evaluate(&self, t: F, y: ArrayView1<'_, F>) -> Option<Array2<F>>
Get the mass matrix at a given time and state
Trait Implementations§
Source§impl<F: IntegrateFloat> Clone for MassMatrix<F>
impl<F: IntegrateFloat> Clone for MassMatrix<F>
Auto Trait Implementations§
impl<F> Freeze for MassMatrix<F>
impl<F> !RefUnwindSafe for MassMatrix<F>
impl<F> Send for MassMatrix<F>where
F: Send,
impl<F> Sync for MassMatrix<F>where
F: Sync,
impl<F> Unpin for MassMatrix<F>
impl<F> !UnwindSafe for MassMatrix<F>
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