forsolver Module


Uses

    • kinds
    • fordiff
  • module~~forsolver~~UsesGraph module~forsolver forsolver fordiff fordiff module~forsolver->fordiff kinds kinds module~forsolver->kinds

Used by

  • module~~forsolver~~UsedByGraph module~forsolver forsolver program~test_solver1 test_solver1 program~test_solver1->module~forsolver program~test_solver10 test_solver10 program~test_solver10->module~forsolver program~test_solver11 test_solver11 program~test_solver11->module~forsolver program~test_solver12 test_solver12 program~test_solver12->module~forsolver program~test_solver13 test_solver13 program~test_solver13->module~forsolver program~test_solver14 test_solver14 program~test_solver14->module~forsolver program~test_solver15 test_solver15 program~test_solver15->module~forsolver program~test_solver16 test_solver16 program~test_solver16->module~forsolver program~test_solver17 test_solver17 program~test_solver17->module~forsolver program~test_solver2 test_solver2 program~test_solver2->module~forsolver program~test_solver3 test_solver3 program~test_solver3->module~forsolver program~test_solver4 test_solver4 program~test_solver4->module~forsolver program~test_solver5 test_solver5 program~test_solver5->module~forsolver program~test_solver6 test_solver6 program~test_solver6->module~forsolver program~test_solver7 test_solver7 program~test_solver7->module~forsolver program~test_solver8 test_solver8 program~test_solver8->module~forsolver program~test_solver9 test_solver9 program~test_solver9->module~forsolver

Interfaces

public interface solve

  • private pure function solver_lin(A, b, method) result(x)

    Author
    Seyed Ali Ghasemi

    Arguments

    Type IntentOptional Attributes Name
    real(kind=rk), intent(in), dimension(:, :), contiguous :: A
    real(kind=rk), intent(in), dimension(:), contiguous :: b
    character(len=*), intent(in), optional :: method

    Return Value real(kind=rk), dimension(max(1, size(A, 2)))


Derived Types

type, public ::  nlsolver

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: lin_method
character(len=:), public, allocatable :: nl_method
character(len=:), public, allocatable :: fdm_method
real(kind=rk), public :: TolFun
real(kind=rk), public :: fdm_tol
real(kind=rk), public :: cs_tol
integer, public :: maxit
integer, public :: nmp
integer, public :: verbosity

Finalizations Procedures

final :: deallocate_solver

Type-Bound Procedures

procedure, public :: set_options
procedure, public :: newton_rel_T0
procedure, public :: newton_rel_T1
procedure, public :: newton_complex_step_rel_T0
procedure, public :: newton_complex_step_rel_T1
generic, public :: solve => newton_rel_T0, newton_rel_T1, newton_complex_step_rel_T0, newton_complex_step_rel_T1

Functions

private pure function solver_lin(A, b, method) result(x)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), dimension(:, :), contiguous :: A
real(kind=rk), intent(in), dimension(:), contiguous :: b
character(len=*), intent(in), optional :: method

Return Value real(kind=rk), dimension(max(1, size(A, 2)))


Subroutines

private pure subroutine gesv_rel(A, b, x, info)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), dimension(:, :), contiguous :: A
real(kind=rk), intent(in), dimension(:), contiguous :: b
real(kind=rk), intent(out), dimension(max(1, size(A, 2))) :: x
integer, intent(out) :: info

private pure subroutine gels_rel(A, b, x, info)

Author
Seyed Ali Ghasemi

solves an overdetermined or underdetermined linear system using gels.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), dimension(:, :), contiguous :: A
real(kind=rk), intent(in), dimension(:), contiguous :: b
real(kind=rk), intent(out), dimension(max(1, size(A, 2))) :: x
integer, intent(out) :: info

private impure subroutine newton_rel_T0(this, F, dFdx, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun1) :: F
procedure(dFun1), optional :: dFdx
real(kind=rk), intent(in) :: x0
real(kind=rk), intent(out) :: x_sol

private impure subroutine newton_rel_T1(this, F, dFdx, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun2) :: F
procedure(dFun2), optional :: dFdx
real(kind=rk), intent(in), dimension(:) :: x0
real(kind=rk), intent(out), dimension(size(x0)) :: x_sol

private impure subroutine newton_complex_step_rel_T0(this, F, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun3) :: F
complex(kind=rk), intent(in) :: x0
complex(kind=rk), intent(out) :: x_sol

private impure subroutine newton_complex_step_rel_T1(this, F, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun4) :: F
complex(kind=rk), intent(in), dimension(:) :: x0
complex(kind=rk), intent(out), dimension(size(x0)) :: x_sol

private impure subroutine set_options(this, nl_method, lin_method, maxit, TolFun, alpha0, c1, c2, nmp, fdm_method, fdm_tol, cs_tol, stepsize, verbosity)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
character(len=*), intent(in), optional :: nl_method
character(len=*), intent(in), optional :: lin_method
integer, intent(in), optional :: maxit
real(kind=rk), intent(in), optional :: TolFun
real(kind=rk), intent(in), optional :: alpha0
real(kind=rk), intent(in), optional :: c1
real(kind=rk), intent(in), optional :: c2
integer, intent(in), optional :: nmp
character(len=*), intent(in), optional :: fdm_method
real(kind=rk), intent(in), optional :: fdm_tol
real(kind=rk), intent(in), optional :: cs_tol
character(len=*), intent(in), optional :: stepsize
integer, intent(in), optional :: verbosity

private pure elemental subroutine deallocate_solver(this)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
type(nlsolver), intent(inout) :: this

private impure subroutine newton_method_T0(this, F, dFdx, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun5) :: F
procedure(dFun5) :: dFdx
real(kind=rk), intent(in) :: x0
real(kind=rk), intent(out) :: x_sol

private impure subroutine modified_newton_method_T0(this, F, dFdx, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun6) :: F
procedure(dFun6) :: dFdx
real(kind=rk), intent(in) :: x0
real(kind=rk), intent(out) :: x_sol

private impure subroutine quasi_fd_newton_method_T0(this, F, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun7) :: F
real(kind=rk), intent(in) :: x0
real(kind=rk), intent(out) :: x_sol

private impure subroutine modified_quasi_fd_newton_method_T0(this, F, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun8) :: F
real(kind=rk), intent(in) :: x0
real(kind=rk), intent(out) :: x_sol

private impure subroutine newton_method_T1(this, F, dFdx, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun9) :: F
procedure(dFun10) :: dFdx
real(kind=rk), intent(in), dimension(:) :: x0
real(kind=rk), intent(out), dimension(size(x0)) :: x_sol

private impure subroutine modified_newton_method_T1(this, F, dFdx, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun11) :: F
procedure(dFun11) :: dFdx
real(kind=rk), intent(in), dimension(:) :: x0
real(kind=rk), intent(out), dimension(size(x0)) :: x_sol

private impure subroutine quasi_fd_newton_method_T1(this, F, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun12) :: F
real(kind=rk), intent(in), dimension(:) :: x0
real(kind=rk), intent(out), dimension(size(x0)) :: x_sol

private impure subroutine modified_quasi_fd_newton_method_T1(this, F, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun13) :: F
real(kind=rk), intent(in), dimension(:) :: x0
real(kind=rk), intent(out), dimension(size(x0)) :: x_sol

private impure subroutine quasi_cs_newton_method_T0(this, F, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun14) :: F
complex(kind=rk), intent(in) :: x0
complex(kind=rk), intent(out) :: x_sol

private impure subroutine modified_quasi_cs_newton_method_T0(this, F, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun15) :: F
complex(kind=rk), intent(in) :: x0
complex(kind=rk), intent(out) :: x_sol

private impure subroutine quasi_cs_newton_method_T1(this, F, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun16) :: F
complex(kind=rk), intent(in), dimension(:) :: x0
complex(kind=rk), intent(out), dimension(size(x0)) :: x_sol

private impure subroutine modified_quasi_cs_newton_method_T1(this, F, x0, x_sol)

Author
Seyed Ali Ghasemi

Arguments

Type IntentOptional Attributes Name
class(nlsolver), intent(inout) :: this
procedure(Fun17) :: F
complex(kind=rk), intent(in), dimension(:) :: x0
complex(kind=rk), intent(out), dimension(size(x0)) :: x_sol