newton_sp_metadata Derived Type

type, public, extends(abstract_metadata) :: newton_sp_metadata

Metadata for Newton-Krylov fixed-point iteration.


Components

Type Visibility Attributes Name Initial
logical, public :: converged = .false.

Convergence flag

integer, public :: eval_counter_record = 0

System response evaluation counter: N.B.: For each of these evals the current residual and tolerance are recorded.

integer, public :: info = 0

Copy of the information flag for completeness

logical, public :: input_is_fixed_point = .false.

Flag indicating lucky convergence (Newton is not run and no solution is computed)

integer, public :: n_iter = 0

Iteration counter

real(kind=sp), public, dimension(:), allocatable :: res

Residual history

real(kind=sp), public, dimension(:), allocatable :: tol

Tolerance history


Type-Bound Procedures

procedure, public, pass(self) :: print => print_newton_sp

  • private subroutine print_newton_sp(self, reset_counters, verbose)

    Arguments

    Type IntentOptional Attributes Name
    class(newton_sp_metadata), intent(inout) :: self
    logical, intent(in), optional :: reset_counters

    Reset all counters to zero after printing?

    logical, intent(in), optional :: verbose

    Print the residual full residual history?

procedure, public, pass(self) :: record => record_data_sp

  • private subroutine record_data_sp(self, res, tol)

    Arguments

    Type IntentOptional Attributes Name
    class(newton_sp_metadata), intent(inout) :: self
    real(kind=sp), intent(in) :: res

    Residual of the current evaluation

    real(kind=sp), intent(in) :: tol

    Tolerance of the current evaluation

procedure, public, pass(self) :: reset => reset_newton_sp

  • private subroutine reset_newton_sp(self)

    Arguments

    Type IntentOptional Attributes Name
    class(newton_sp_metadata), intent(inout) :: self

Source Code

    type, extends(abstract_metadata), public :: newton_sp_metadata
        !! Metadata for Newton-Krylov fixed-point iteration.
        integer :: n_iter = 0
        !! Iteration counter
        integer :: eval_counter_record = 0
        !! System response evaluation counter:
        !! N.B.: For each of these evals the current residual and tolerance are recorded.
        real(sp), dimension(:), allocatable :: res
        !! Residual history
        real(sp), dimension(:), allocatable :: tol
        !! Tolerance history
        logical :: converged = .false.
        !! Convergence flag
        logical :: input_is_fixed_point = .false.
        !! Flag indicating lucky convergence (Newton is not run and no solution is computed)
        integer :: info = 0
        !! Copy of the information flag for completeness
    contains
        procedure, pass(self), public :: print => print_newton_sp
        procedure, pass(self), public :: reset => reset_newton_sp
        procedure, pass(self), public :: record => record_data_sp
    end type newton_sp_metadata