nlsolver Derived Type

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

Finalization Procedures

final :: deallocate_solver

  • private pure elemental subroutine deallocate_solver(this)

    Author
    Seyed Ali Ghasemi

    Arguments

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

Type-Bound Procedures

procedure, public :: set_options

  • 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

procedure, public :: newton_rel_T0

  • 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

procedure, public :: newton_rel_T1

  • 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

procedure, public :: newton_complex_step_rel_T0

  • 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

procedure, public :: newton_complex_step_rel_T1

  • 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 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

Source Code

   type :: nlsolver
      character(:), allocatable :: lin_method
      character(:), allocatable :: nl_method
      character(:), allocatable :: fdm_method
      real(rk)                  :: TolFun
      real(rk)                  :: fdm_tol
      real(rk)                  :: cs_tol
      integer                   :: maxit
      integer                   :: nmp
      integer                   :: verbosity
      ! character(:), allocatable :: stepsize
      ! real(rk)                  :: alpha0
      ! real(rk)                  :: c1
      ! real(rk)                  :: c2
   contains
      procedure :: set_options
      procedure :: newton_rel_T0
      procedure :: newton_rel_T1
      procedure :: newton_complex_step_rel_T0
      procedure :: newton_complex_step_rel_T1
      generic   :: solve => newton_rel_T0,&
         newton_rel_T1,&
         newton_complex_step_rel_T0,&
         newton_complex_step_rel_T1
      final     :: deallocate_solver
   end type nlsolver