pub struct StokesSolver1D {
    pub(crate) stiffness_matrix: Array2<f64>,
    pub(crate) b_vector: Array1<f64>,
    pub gauss_step: usize,
    pub hydrostatic_pressure: f64,
    pub rho: f64,
}
Expand description

General Information

A Stokes solver 1d abstracts the equation: “(1/ρ)p_x = f” with constant velocity and hydrostatic pressure “ρ”

Fields

  • boundary_condition_pressure - Original boundary conditions (Only Dirichlet is supported for now).
  • stiffness_matrix - Left-side matrix of resulting discrete equation.
  • b_vector - Right-side vector of the resulting discrete equation.
  • gauss_step - Precision of quadrature.
  • speed - Constant speed.
  • rho - Constant density.

Fields§

§stiffness_matrix: Array2<f64>§b_vector: Array1<f64>§gauss_step: usize§hydrostatic_pressure: f64§rho: f64

Implementations§

Creates a new instance of solver from params

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
  • rho - density
  • hydrostatic_pressure
  • mesh - Vector of f64 representing a line
  • gauss_step - How many nodes will be calculated for a given integration
  • function - Force acting on the fluid
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.