abstract_system Derived Type

type, public, abstract :: abstract_system

Base type to define an abstract system. All other system types defined in LightKrylov derive from this fundamental one.

Warning

Users should not extend this abstract class to define their own types.


Type-Bound Procedures

procedure, public, pass(self) :: finalize_timer => finalize_eval_timer

Finalize timer and print complete history

  • private subroutine finalize_eval_timer(self)

    Finalize the system evaluation timer and print summary. Note: Wrapper of the corresponding routine from lightkrylov_timer

    Arguments

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

procedure, public, pass(self) :: get_eval_counter

Return eval counter value

  • private pure function get_eval_counter(self) result(count)

    Getter function for the number of system evaluations.

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_system), intent(in) :: self

    Return Value integer

procedure, public, pass(self) :: print_timer_info

Print current timing data

  • private subroutine print_timer_info(self)

    Print the current timing data for the system evaluation. Note: Wrapper of the corresponding routine from lightkrylov_timer

    Arguments

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

procedure, public, pass(self) :: reset_eval_counter

Reset eval counter

  • private subroutine reset_eval_counter(self, procedure, counter, reset_timer, soft_reset, clean_timer)

    Setter function to reset the system evaluation counter.

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_system), intent(inout) :: self
    character(len=*), intent(in) :: procedure

    name of the caller routine

    integer, intent(in), optional :: counter

    optional flag to reset to an integer other than zero.

    logical, intent(in), optional :: reset_timer

    optional flag to reset also the timer

    logical, intent(in), optional :: soft_reset

    optional flag to choose whether to save previous timing data (default: .true.)

    logical, intent(in), optional :: clean_timer

    optional flag to choose whether to fully reset the timer (default: .false.)

procedure, public, pass(self) :: reset_timer => reset_eval_timer

Reset current timing data

  • private subroutine reset_eval_timer(self, soft, clean)

    Setter routine to reset the system evaluation timer. Note: Wrapper of the corresponding routine from lightkrylov_timer

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_system), intent(inout) :: self
    logical, intent(in), optional :: soft
    logical, intent(in), optional :: clean

Source Code

    type, abstract, public :: abstract_system
        !!  Base type to define an abstract system. All other system types defined
        !!  in `LightKrylov` derive from this fundamental one.
        !!
        !!  @warning
        !!  Users should not extend this abstract class to define their own types.
        !!  @endwarning
        private
        integer :: eval_counter = 0
        type(lightkrylov_timer) :: eval_timer = lightkrylov_timer('system eval timer')
    contains
        procedure, pass(self), public :: get_eval_counter
        !! Return eval counter value
        procedure, pass(self), public :: reset_eval_counter
        !! Reset eval counter
        procedure, pass(self), public :: print_timer_info
        !! Print current timing data
        procedure, pass(self), public :: reset_timer => reset_eval_timer
        !! Reset current timing data
        procedure, pass(self), public :: finalize_timer => finalize_eval_timer
        !! Finalize timer and print complete history
    end type abstract_system