pub struct DiffussionSolverTimeIndependent {
    pub boundary_conditions: [f64; 2],
    pub(crate) stiffness_matrix: Array2<f64>,
    pub(crate) b_vector: Array1<f64>,
    pub gauss_step: usize,
    pub mu: f64,
    pub b: f64,
}
Expand description

General Information

A diffusion solver with time-independence abstracts the equation: “- μu_xx + bu_x = 0” and contains boundary conditions along with mesh, “b” and “μ”

Fields

  • boundary_conditions - Original boundary conditions (Only Dirichlet is supported for now).
  • stiffness_matrix - Left-side matrix of the resulting discrete equation.
  • b_vector - Right-side vector of the resulting discrete equation.
  • gauss_step - Precision of quadrature.
  • mu - First ot two needed constants.
  • b - Second of two needed constants.

Fields§

§boundary_conditions: [f64; 2]§stiffness_matrix: Array2<f64>§b_vector: Array1<f64>§gauss_step: usize§mu: f64§b: f64

Implementations§

Creates new instance

General Information

First, it generates the basis for a solver from the linear basis constructor. Then the stiffnes matrix and vector b are generated based on linear basis integration via Gauss-Legendre and returned. Note that vector and matrix will have one on their diagonals’ boundaries and zero on other boundary elements to make boundary conditions permanent.

Parameters
  • boundary_conditions - Conditions to guarantee system solution.
  • mu - Movement term.
  • b - Velocity term.
  • mesh - Vector of f64 representing a line.
  • gauss_step - How many nodes will be calculated for a given integration.
Returns

A tuple with both the stiffness matrix and the vector b.

Trait Implementations§

Formats the value using the given formatter. Read more
Specific implementation

Solving starts by obtaining stiffness matrix and vector b (Ax=b). Then both are used inside function solve_by_thomas to obtain the result vector.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.