solve Interface

public interface solve

This interface overloads the solve interface from stdlib_linalg for solving a system where is a Poisson2D matrix. It also enables to solve a linear system with multiple right-hand sides.

Syntax

   x = solve(A, b)

Arguments

  • A : Matrix of type Poisson2D. It is an intent(in) argument.

  • b : Rank-1 or rank-2 array defining the right-hand side(s). It is an intent(in) argument.

  • x : Solution of the linear system. It has the same type and shape as b.

Note

It uses a fast Poisson solver leveraging the discrete sine transform provided by fftpack. Only homogeneous Dirichlet boundary conditions are handled by default. If non-homogeneous Dirichlet boundary conditions need to be used, they can be implemented by modifiying the right-hand side vector. Neuman-type boundary conditions are not supported at all.


Functions

private pure module function solve_multi_rhs(A, b) result(x)

Solve the linear system using a fast Poisson solver.

Arguments

Type IntentOptional Attributes Name
type(Poisson2D), intent(in) :: A

Coefficient matrix.

real(kind=dp), intent(in) :: b(:,:)

Right-hand side vectors.

Return Value real(kind=dp), allocatable, target, (:,:)

Solution vectors.

private pure module function solve_single_rhs(A, b) result(x)

Solve the linear system using a fast Poisson solver.

Arguments

Type IntentOptional Attributes Name
type(Poisson2D), intent(in) :: A

Coefficient matrix.

real(kind=dp), intent(in) :: b(:)

Right-hand side vector.

Return Value real(kind=dp), allocatable, target, (:)

Solution vector.