integrator_adams_moulton Derived Type

type, public, extends(integrator_multistep_object) :: integrator_adams_moulton

type~~integrator_adams_moulton~~InheritsGraph type~integrator_adams_moulton integrator_adams_moulton type~integrand_object integrand_object type~integrand_object->type~integrator_adams_moulton buffer, previous type~integrator_multistep_object integrator_multistep_object type~integrand_object->type~integrator_multistep_object buffer, previous type~integrator_multistep_object->type~integrator_adams_moulton type~integrator_object integrator_object type~integrator_object->type~integrator_multistep_object
Help


FOODIE integrator: provide an explicit class of Adams-Moulton multi-step schemes, from 1st to 16th order accurate.

Inherited By

type~~integrator_adams_moulton~~InheritedByGraph type~integrator_adams_moulton integrator_adams_moulton type~integrator_adams_bashforth_moulton integrator_adams_bashforth_moulton type~integrator_adams_moulton->type~integrator_adams_bashforth_moulton corrector
Help

Components

TypeVisibility AttributesNameInitial
real(kind=R_P), public, allocatable:: Dt(:)

Previous time steps.

logical, public :: autoupdate

Perform cyclic autoupdate of previous time steps buffers.

real(kind=R_P), private, allocatable:: b(:)

\(b\) coefficients.

class(integrand_object), public, allocatable:: buffer

Buffer used for fast integration.

character(len=:), public, allocatable:: description_

Informative description of the integrator.

integer(kind=I_P), public :: error =0

Error status code.

character(len=:), public, allocatable:: error_message

Error message, hopefully meaningful.

integer(kind=I_P), public :: iterations

Implicit iterations.

class(integrand_object), public, allocatable:: previous(:)

Previous steps.

integer(kind=I_P), public :: registers

Number of registers used for steps.

integer(kind=I_P), public :: steps

Number of time steps.

real(kind=R_P), public, allocatable:: t(:)

Previous times.


Type-Bound Procedures

procedure, public, pass(self) :: allocate_integrand_members

Allocate integrand members.

procedure, public, pass(lhs) :: assign_abstract

Assign ony members of abstract integrator_object type.

procedure, public, pass(lhs) :: assign_multistep

Assign members of integrator_multistep_object and parents.

generic, public :: assignment(=) => integr_assign_integr

Overload =.

procedure, public, pass(self) :: check_error

Check for error occurrencies.

  • private subroutine check_error(self, is_severe)

    Check for error occurencies.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_object), intent(in) :: self

    Integrator.

    logical, intent(in), optional :: is_severe

    Flag to activate severe faliure, namely errors trigger a stop.

procedure, public, pass(self) :: class_name

Return the class name of schemes.

  • private pure function class_name(self)

    Return the class name of schemes.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_adams_moulton), intent(in) :: self

    Integrator.

    Return Value character(len=99)

    Class name.

procedure, public, pass(self) :: description

Return informative integrator description.

  • private pure function description(self, prefix) result(desc)

    Return informative integrator description.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_object), intent(in) :: self

    Integrator.

    character(len=*), intent(in), optional :: prefix

    Prefixing string.

    Return Value character(len=:), allocatable

    Description.

procedure, public, pass(self) :: destroy

Destroy the integrator.

  • private elemental subroutine destroy(self)

    Destroy the integrator.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_adams_moulton), intent(inout) :: self

    Integrator.

procedure, public, pass(self) :: destroy_abstract

Destroy only members of abstract integrator_object type.

procedure, public, pass(self) :: destroy_multistep

Destroy the integrator.

procedure, public, pass(self) :: has_fast_mode

Return .true. if the integrator class has fast mode integrate.

  • private elemental function has_fast_mode(self)

    Return .true. if the integrator class has fast mode integrate.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_adams_moulton), intent(in) :: self

    Integrator.

    Return Value logical

    Inquire result.

procedure, public, pass(self) :: initialize

Initialize (create) the integrator.

  • private subroutine initialize(self, scheme, iterations, autoupdate, U, stop_on_fail)

    Create the actual Adams-Moulton integrator: initialize the b coefficients.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_adams_moulton), intent(inout) :: self

    Integrator.

    character(len=*), intent(in) :: scheme

    Selected scheme.

    integer(kind=I_P), intent(in), optional :: iterations

    Implicit iterations.

    logical, intent(in), optional :: autoupdate

    Enable cyclic autoupdate of previous time steps.

    class(integrand_object), intent(in), optional :: U

    Integrand molding prototype.

    logical, intent(in), optional :: stop_on_fail

    Stop execution if initialization fail.

procedure, public, pass(lhs) :: integr_assign_integr

Operator =.

procedure, public, pass(self) :: integrate

Integrate integrand field.

  • private subroutine integrate(self, U, Dt, t)

    Integrate field with Adams-Moulton class scheme.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_adams_moulton), intent(inout) :: self

    Integrator.

    class(integrand_object), intent(inout) :: U

    Field to be integrated.

    real(kind=R_P), intent(in) :: Dt

    Time step.

    real(kind=R_P), intent(in) :: t

    Time.

procedure, public, pass(self) :: integrate_fast

Integrate integrand field, fast mode.

  • private subroutine integrate_fast(self, U, Dt, t)

    Integrate field with Adams-Moulton class scheme, fast mode.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_adams_moulton), intent(inout) :: self

    Integrator.

    class(integrand_object), intent(inout) :: U

    Field to be integrated.

    real(kind=R_P), intent(in) :: Dt

    Time step.

    real(kind=R_P), intent(in) :: t

    Time.

procedure, public, pass(self) :: is_multistage

Return .true. for multistage integrator.

  • private elemental function is_multistage(self)

    Return .true. for multistage integrator.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_multistep_object), intent(in) :: self

    Integrator.

    Return Value logical

    Inquire result.

procedure, public, pass(self) :: is_multistep

Return .true. for multistep integrator.

  • private elemental function is_multistep(self)

    Return .true. for multistage integrator.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_multistep_object), intent(in) :: self

    Integrator.

    Return Value logical

    Inquire result.

procedure, public, pass(self) :: is_supported

Return .true. if the integrator class support the given scheme.

  • private elemental function is_supported(self, scheme)

    Return .true. if the integrator class support the given scheme.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_adams_moulton), intent(in) :: self

    Integrator.

    character(len=*), intent(in) :: scheme

    Selected scheme.

    Return Value logical

    Inquire result.

procedure, public, pass(self) :: stages_number

Return number of stages used.

  • private elemental function stages_number(self)

    Return number of stages used.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_multistep_object), intent(in) :: self

    Integrator.

    Return Value integer(kind=I_P)

    Number of stages used.

procedure, public, pass(self) :: steps_number

Return number of steps used.

  • private elemental function steps_number(self)

    Return number of steps used.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_multistep_object), intent(in) :: self

    Integrator.

    Return Value integer(kind=I_P)

    Number of steps used.

procedure, public, pass(self) :: supported_schemes

Return the list of supported schemes.

  • private pure function supported_schemes(self) result(schemes)

    Return the list of supported schemes.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_adams_moulton), intent(in) :: self

    Integrator.

    Return Value character(len=99), allocatable, (:)

    Queried scheme.

procedure, public, pass(self) :: trigger_error

Trigger an error.

  • private subroutine trigger_error(self, error, error_message, is_severe)

    Check for error occurencies.

    Arguments

    Type IntentOptional AttributesName
    class(integrator_object), intent(inout) :: self

    Integrator.

    integer(kind=I_P), intent(in) :: error

    Error status code.

    character(len=*), intent(in), optional :: error_message

    Error message, hopefully meaningful.

    logical, intent(in), optional :: is_severe

    Flag to activate severe faliure, namely errors trigger a stop.

procedure, public, nopass :: update_previous

Cyclic update previous time steps.

  • private subroutine update_previous(U, previous, Dt, t, previous_Dt, previous_t)

    Cyclic update previous time steps.

    Arguments

    Type IntentOptional AttributesName
    class(integrand_object), intent(in) :: U

    Field to be integrated.

    class(integrand_object), intent(inout) :: previous(1:)

    Previous time steps solutions of integrand.

    real(kind=R_P), intent(in), optional :: Dt

    Time step.

    real(kind=R_P), intent(in), optional :: t

    Time.

    real(kind=R_P), intent(inout), optional :: previous_Dt(1:)

    Time step.

    real(kind=R_P), intent(inout), optional :: previous_t(1:)

    Time.

Source Code

type, extends(integrator_multistep_object) :: integrator_adams_moulton
  !< FOODIE integrator: provide an explicit class of Adams-Moulton multi-step schemes, from 1st to 16th order accurate.
  !<
  !< @note The integrator must be created or initialized (initialize the *b* coefficients) before used.
   !<
   !< @note The time steps `Dt(1:steps)` passed to the integrate methods must be identical: this integrator supports only
   !< fixed time steps.
  private
  real(R_P), allocatable :: b(:) !< \(b\) coefficients.
  contains
    ! deferred methods
    procedure, pass(self) :: class_name           !< Return the class name of schemes.
    procedure, pass(lhs)  :: integr_assign_integr !< Operator `=`.
    procedure, pass(self) :: has_fast_mode        !< Return .true. if the integrator class has *fast mode* integrate.
    procedure, pass(self) :: integrate            !< Integrate integrand field.
    procedure, pass(self) :: integrate_fast       !< Integrate integrand field, fast mode.
    procedure, pass(self) :: is_supported         !< Return .true. if the integrator class support the given scheme.
    procedure, pass(self) :: supported_schemes    !< Return the list of supported schemes.
    ! public methods
    procedure, pass(self) :: destroy    !< Destroy the integrator.
    procedure, pass(self) :: initialize !< Initialize (create) the integrator.
endtype integrator_adams_moulton