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.
integer, public, parameter :: &
POSITION = 1, &
VELOCITY = 2, &
CURRENT = 3, &
DENSITY = 4, &
SCALAR_POTENTIAL = 5, &
VECTOR_POTENTIAL = 6, &
E_FIELD = 7, &
B_FIELD = 8, &
MASS = 9, &
CHARGE = 10, &
PERMITTIVITY = 11, &
PERMEABILITY = 12, &
E_CONDUCTIVITY = 13, &
M_CONDUCTIVITY = 14, &
DIPOLE = 15, &
MAX_QUANTITIES = 15
Any system, through its base class interaction_partner_t
owns an array of type quantity_t
type quantity_t
private
type(iteration_counter_t), public :: iteration !< @brief Iteration counter storing the time at which the quantity was last updated.
! !!
! !! @note quantities dont have a constructor. The iteration counter is initialized automatically
! !! for extenstions of system_t, but needs to be initialized explicitly for extensions of
! !! interaction_partner_t, which are not systems.
logical, public :: required = .false. !< @brief Should this quantities be calculated?
! !!
! !! true means that they are needed by either some interaction
! !! or because they are dynamical variables of the system
! !! (i.e., they appear in the differential equations governing
! !! the systems dynamics). This is just a flag saying that the
! !! system needs to compute and store these quantities. It says
! !! nothing about **when** they should be updated.
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.
end type quantity_t
This determines whether a quantity is required for a given system, and also associates a specific clock with each quantity.