117 integer,
parameter,
public :: &
133 type(iteration_counter_t) :: iteration
135 character(len=:),
allocatable :: label
136 logical :: intra_interaction
139 real(real64) :: energy
142 character(len=:),
allocatable :: system_quantities(:)
145 class(interaction_partner_t),
pointer :: partner => null()
146 character(len=:),
allocatable :: couplings_from_partner(:)
147 logical :: partner_couplings_up_to_date = .false.
150 procedure(interaction_calculate),
deferred :: calculate
151 procedure(interaction_calculate_energy),
deferred :: calculate_energy
164 class(interaction_t),
intent(inout) :: this
172 class(interaction_t),
intent(inout) :: this
196 class(interaction_t),
intent(inout) :: this
197 class(iteration_counter_t),
intent(in) :: requested_iteration
199 type(event_handle_t) :: debug_handle
203 if (this%partner_couplings_up_to_date)
then
209 if (.not.
allocated(this%couplings_from_partner))
then
211 this%partner_couplings_up_to_date = .
true.
218 requested_iteration = requested_iteration, &
219 interaction_iteration = this%iteration)
222 call this%partner%update_on_demand_quantities(this%couplings_from_partner, requested_iteration, &
226 select case (this%partner%check_couplings_status(this%couplings_from_partner, requested_iteration))
229 this%partner_couplings_up_to_date = .
true.
230 call this%partner%copy_quantities_to_interaction(this)
241 this%partner_couplings_up_to_date = .false.
251 requested_iteration = requested_iteration, &
252 interaction_iteration = this%iteration)
269 assert(.not. (this%iteration == requested_iteration))
272 extra=
"target: "//trim(this%label)//
"-"//trim(this%partner%namespace%get()), &
273 interaction_iteration = this%iteration, &
274 requested_iteration = requested_iteration)
276 call this%calculate()
279 call this%iteration%set(requested_iteration)
281 trim(this%label)//
"-"//trim(this%partner%namespace%get()), &
282 this%iteration,
"set"))
286 this%partner_couplings_up_to_date = .false.
289 interaction_iteration = this%iteration, &
290 requested_iteration = requested_iteration)
301 if (
allocated(this%couplings_from_partner))
then
302 deallocate(this%couplings_from_partner)
304 nullify(this%partner)
306 if (
allocated(this%system_quantities))
then
307 deallocate(this%system_quantities)
310 if (
allocated(this%label))
then
311 deallocate(this%label)
340 call this%iteration%restart_write(
'restart_iteration_interaction_'//trim(this%label), namespace)
352 call this%add_ptr(interaction)
364 select type (ptr => this%get_next_ptr())
All interactions need to implement the following deferred method, which takes information form the in...
All interactions need to implement the following deferred method, which takes information form the in...
This module defines the abstract interaction_t class, and some auxiliary classes for interactions.
subroutine interaction_update_partner_couplings(this, requested_iteration)
Try to update all the couplings needed from the partner to update the interaction.
subroutine, public interaction_end(this)
subroutine interaction_update(this, requested_iteration)
Update the interaction to the requested_iteration.
logical function interaction_restart_read(this, namespace)
read restart information
class(interaction_t) function, pointer interaction_iterator_get_next(this)
integer, parameter, public timing_retarded
subroutine interaction_restart_write(this, namespace)
subroutine interaction_list_add_node(this, interaction)
This module defines classes and functions for interaction partners.
integer, parameter, public couplings_on_time
integer, parameter, public couplings_behind_in_time
integer, parameter, public couplings_ahead_in_time
integer, parameter, public couplings_undefined
This module implements fully polymorphic linked lists, and some specializations thereof.
This module implements the multisystem debug functionality.
subroutine, public multisystem_debug_write_marker(system_namespace, event)
type(event_handle_t) function, public multisystem_debug_write_event_in(system_namespace, event, extra, system_iteration, algo_iteration, interaction_iteration, partner_iteration, requested_iteration)
subroutine, public multisystem_debug_write_event_out(handle, extra, update, system_iteration, algo_iteration, interaction_iteration, partner_iteration, requested_iteration)
This module defines the quantity_t class and the IDs for quantities, which can be exposed by a system...
These class extend the list and list iterator to make an interaction list.
These classes extend the list and list iterator to make an interaction list.
abstract interaction class
surrogate interaction class to avoid circular dependencies between modules.
This class implements the iteration counter used by the multisystem algorithms. As any iteration coun...
This class implements an iterator for the polymorphic linked list.
This class implements a linked list of unlimited polymorphic values.
events marking a function call
handle to keep track of in- out- events
events marking an iteration update