namespace regrid_solvers

Overview

Solvers of linear systems. More…

namespace regrid_solvers {

// global functions

subroutine, public solve_linear_system(A A, B B, X X, system_size system_size);
subroutine, public solve_tridiagonal_system(Al Al, Ad Ad, Au Au, B B, X X, system_size system_size);

} // namespace regrid_solvers

Detailed Documentation

Solvers of linear systems.

Date of creation: 2008.06.12 L. White

This module contains solvers of linear systems. These routines could (should ?) be replaced later by more efficient ones.

Global Functions

subroutine, public solve_linear_system(A A, B B, X X, system_size system_size)

Solve the linear system AX = B by Gaussian elimination.

This routine uses Gauss’s algorithm to transform the system’s original matrix into an upper triangular matrix. Back substitution yields the answer. The matrix A must be square and its size must be that of the vectors B and X.

Parameters:

a

The matrix being inverted

b

system right-hand side

x

solution vector

system_size

The size of the system

subroutine, public solve_tridiagonal_system(
    Al Al,
    Ad Ad,
    Au Au,
    B B,
    X X,
    system_size system_size
    )

Solve the tridiagonal system AX = B.

This routine uses Thomas’s algorithm to solve the tridiagonal system AX = B. (A is made up of lower, middle and upper diagonals)

Parameters:

ad

Maxtix center diagonal

al

Matrix lower diagonal

au

Matrix upper diagonal

b

system right-hand side

x

solution vector

system_size

The size of the system