abstract_exptA_linop_rsp Derived Type

type, public, abstract, extends(abstract_linop_rsp) :: abstract_exptA_linop_rsp

Utility type to define the exponential propagator which is the linear map corresponding to the matrix exponential of the (possibly time-dependent) system Jacobian over a time horizon as: Note that explicit knowledge or definition of the Jacobian is NOT required. This utility function is intended for the use in conjuction with a time-stepper algorithm that computes the integral directly.

@note Warning While it is not necessary to use this utility operator, it is strongly recommended for operators that correspond to exponential propagators to extend from this abstract type to allow for more rigorous type checks in the application.


Components

Type Visibility Attributes Name Initial
type(lightkrylov_timer), public :: matvec_timer = lightkrylov_timer('matvec timer')
type(lightkrylov_timer), public :: rmatvec_timer = lightkrylov_timer('rmatvec timer')
real(kind=sp), public :: tau

Time horizon for the temporal integration. This variable must be set when the operator is instantiated.


Type-Bound Procedures

procedure, public, pass(self) :: apply_matvec => apply_matvec_rsp

Wrapper for matvec including the counter increment

procedure, public, pass(self) :: apply_rmatvec => apply_rmatvec_rsp

Wrapper for rmatvec including the counter increment

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

Finalize timers and print complete history_info

  • private subroutine finalize_linop_timer(self)

    Finalize the matvec/rmatvec timers Note: Wrapper of the corresponding routine from lightkrylov_timer

    Arguments

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

procedure, public, pass(self) :: get_counter

Return matvec/rmatvec counter value

  • private pure function get_counter(self, trans) result(count)

    Getter function for the number of matvec calls

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_linop), intent(in) :: self
    logical, intent(in) :: trans

    matvec or rmatvec?

    Return Value integer

procedure(abstract_matvec_rsp), public, deferred, pass(self) :: matvec

Procedure to compute the matrix-vector product .

  • subroutine abstract_matvec_rsp(self, vec_in, vec_out) Prototype

    Interface for the matrix-vector product.

    Arguments

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

    Linear operator .

    class(abstract_vector_rsp), intent(in) :: vec_in

    Vector to be multiplied by .

    class(abstract_vector_rsp), intent(out) :: vec_out

    Result of the matrix-vector product.

procedure, public, pass(self) :: print_timer_info

Print current timing data

  • private subroutine print_timer_info(self, trans)

    Getter routine to print the current timing information for matvec/rmatvec Note: Wrapper of the corresponding routine from lightkrylov_timer

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_linop), intent(inout) :: self
    logical, intent(in), optional :: trans

    matvec or rmatvec?

procedure, public, pass(self) :: reset_counter

Reset matvec/rmatvec counter

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

    Setter routine to reset the matvec counter and reset timers

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_linop), intent(inout) :: self
    logical, intent(in) :: trans

    matvec or rmatvec?

    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 timers

    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_linop_timer

Reset current timing data

  • private subroutine reset_linop_timer(self, trans, soft, clean)

    Setter routine to reset the matvec/rmatvec timers Note: Wrapper of the corresponding routine from lightkrylov_timer

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_linop), intent(inout) :: self
    logical, intent(in), optional :: trans

    matvec or rmatvec?

    logical, intent(in), optional :: soft
    logical, intent(in), optional :: clean

procedure(abstract_matvec_rsp), public, deferred, pass(self) :: rmatvec

Procedure to compute the reversed matrix-vector product .

  • subroutine abstract_matvec_rsp(self, vec_in, vec_out) Prototype

    Interface for the matrix-vector product.

    Arguments

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

    Linear operator .

    class(abstract_vector_rsp), intent(in) :: vec_in

    Vector to be multiplied by .

    class(abstract_vector_rsp), intent(out) :: vec_out

    Result of the matrix-vector product.