Exposed quantities

Work in progress!

Systems can expose quantities that can be used to calculate interactions with other systems.

Some quantities are dynamical variables of the system. Such quantities are usually updated by the propagation algorithm and cannot be calculated on-demand. Such quantities must be marked as “protected”.

The module multisystem/core/quantity.F90 defines the parameters, which act as index to an exposed quantity within a system.

Any system, through its base class interaction_partner_t owns an array of type quantity_t

  type quantity_t
    private
    character(len=:), allocatable, public :: label      !< @brief Label used to uniquely identify a quantity.
    !                                                   !!
    !                                                   !! @note It is the responsibility of the developers to ensure the labels are unique.

    type(iteration_counter_t), public :: iteration      !< @brief Iteration counter storing the time at which the quantity was last updated.
    !                                                   !!
    !                                                   !! @note The iteration counter is initialized automatically
    !                                                   !! for extensions of system_t, but needs to be initialized explicitly for extensions of
    !                                                   !! interaction_partner_t, which are not systems. This can be done via the constructor of quantity_t.

    logical,       public :: always_available = .false. !< @brief Can we use this quantity at any requested iteration?
    !                                                   !!
    !                                                   !! (e.g., this will be true for a static quantity,
    !                                                   !! but false for a quantity that is only updated at specific iterations)

    logical,       public :: updated_on_demand = .true. !< @brief when is the quantity updated?
    !                                                   !!
    !                                                   !! If true, the quantity is only updated when requested. The quantity should be calculated (updated)
    !                                                   !! in the systems update_quantity() routine.
    !                                                   !!
    !                                                   !! If false, the quantity is updated automatically during the execution of an algorithm.
    !                                                   !! In this case, the quantity should be updated inside the do_algorithmic_operation() routine.

    character(len=100), allocatable, public :: parents(:) !< @brief labels of the quantities required to compute this quantity
  end type quantity_t

This determines whether a quantity is required for a given system, and also associates a specific clock with each quantity.