Octopus
multisystem_oct_m Module Reference

This module implements the abstract multisystem class. More...

Detailed Description

This module implements the abstract multisystem class.

In there is the possibility to group several systems into containers, which are implemented in the multisystem_basic_oct_m::multisystem_basic_t class. Containers can have different purposes and applications. In the simplest case, containers are simply a collection of other systems, and do not have their own interactions with anything else. In this case, containers do not introduce any different physics (or approximations), but simply help in the book-keeping of the problem.

Note
Containers do not correspond to a given region in space, but only to a selection of systems. In many cases, these systems might be confined to a certain region in space, but this is not a property of the container. In many other cases, e.g. combining matter and maxwell fields, both systems occupy the same space, or have a substantial overlap.

Another use case might be to group systems into a container, and then only interact with the whole container, instead of the individual systems. This, however, is an approximation, and furthermore (at least, at the moment) has some limitations due to the implementation.

Note
Note, that containers themselves do not move. This has consequences to the definition of the energy contributions. In particular, a container does not have its own kinetic energy, and all kinetic energy contributions of the constituents are accounted for in the internal energy.

Data Types

type  multisystem_t
 the abstract multisystem class More...
 

Functions/Subroutines

recursive subroutine multisystem_init_parallelization (this, grp)
 brief initialize the parallelization of the multisystem More...
 
recursive real(real64) function multisystem_next_time_on_largest_dt (this)
 
recursive subroutine multisystem_execute_algorithm (this)
 
recursive subroutine multisystem_reset_iteration_counters (this, accumulated_iterations)
 
recursive subroutine multisystem_init_algorithm (this, factory)
 
recursive logical function multisystem_algorithm_finished (this)
 
recursive subroutine multisystem_init_iteration_counters (this)
 initialize the iteration counters of the contained systems More...
 
recursive subroutine multisystem_propagation_start (this)
 call the propagation_start routine for all contained systems More...
 
recursive subroutine multisystem_propagation_finish (this)
 call the propagation_finish routine for all contained systems More...
 
recursive subroutine multisystem_add_partners_to_list (this, list, interaction_type)
 add interaction partners contained in the multisystem to a list More...
 
recursive subroutine multisystem_create_interactions (this, interaction_factory, available_partners)
 create the interactions of the multisystem More...
 
subroutine multisystem_init_interaction (this, interaction)
 initialize a specific interaction More...
 
recursive subroutine multisystem_write_interaction_graph (this, iunit, include_ghosts)
 write a graphical representation of the interactions More...
 
recursive subroutine multisystem_initial_conditions (this)
 
logical function multisystem_do_algorithmic_operation (this, operation, updated_quantities)
 
recursive logical function multisystem_is_tolerance_reached (this, tol)
 
subroutine multisystem_update_quantity (this, iq)
 
subroutine multisystem_init_interaction_as_partner (partner, interaction)
 
subroutine multisystem_copy_quantities_to_interaction (partner, interaction)
 
recursive logical function multisystem_process_is_slave (this)
 
recursive subroutine multisystem_update_kinetic_energy (this)
 Calculate the kinetic energy: The kinetic energy of a container (multisystem) is defined by the kinetic energy with respect to the center or mass motion. More...
 
recursive subroutine multisystem_update_internal_energy (this)
 
subroutine multisystem_update_potential_energy (this)
 Calculate the potential energy for a container. More...
 
recursive real(real64) function multisystem_pair_energy (partner_A, partner_B)
 This function calculates the complete interaction energy between partner_A and partner_B, which means that for any container its constituents will be accounted for. This continues recursively up to the level of non-container systems. More...
 
recursive subroutine multisystem_get_flat_list (this, flat_list)
 Generate a list of all systems contained in a multisystem, including those inside child containers. More...
 
recursive subroutine, public multisystem_end (this)
 
recursive subroutine multisystem_start_barrier (this, target_time, barrier_index)
 
recursive subroutine multisystem_end_barrier (this, barrier_index)
 
recursive logical function multisystem_arrived_at_barrier (this, barrier_index)
 
recursive subroutine multisystem_restart_write (this)
 
recursive logical function multisystem_restart_read (this)
 
subroutine multisystem_restart_write_data (this)
 
logical function multisystem_restart_read_data (this)
 

Function/Subroutine Documentation

◆ multisystem_init_parallelization()

recursive subroutine multisystem_oct_m::multisystem_init_parallelization ( class(multisystem_t), intent(inout)  this,
type(mpi_grp_t), intent(in)  grp 
)
private

brief initialize the parallelization of the multisystem

Definition at line 209 of file multisystem.F90.

◆ multisystem_next_time_on_largest_dt()

recursive real(real64) function multisystem_oct_m::multisystem_next_time_on_largest_dt ( class(multisystem_t), intent(inout)  this)
private

Definition at line 234 of file multisystem.F90.

◆ multisystem_execute_algorithm()

recursive subroutine multisystem_oct_m::multisystem_execute_algorithm ( class(multisystem_t), intent(inout)  this)
private

Definition at line 261 of file multisystem.F90.

◆ multisystem_reset_iteration_counters()

recursive subroutine multisystem_oct_m::multisystem_reset_iteration_counters ( class(multisystem_t), intent(inout)  this,
integer, intent(in)  accumulated_iterations 
)
private

Definition at line 290 of file multisystem.F90.

◆ multisystem_init_algorithm()

recursive subroutine multisystem_oct_m::multisystem_init_algorithm ( class(multisystem_t), intent(inout)  this,
class(algorithm_factory_t), intent(in)  factory 
)
private

Definition at line 313 of file multisystem.F90.

◆ multisystem_algorithm_finished()

recursive logical function multisystem_oct_m::multisystem_algorithm_finished ( class(multisystem_t), intent(in)  this)
private

Definition at line 344 of file multisystem.F90.

◆ multisystem_init_iteration_counters()

recursive subroutine multisystem_oct_m::multisystem_init_iteration_counters ( class(multisystem_t), intent(inout)  this)
private

initialize the iteration counters of the contained systems

Definition at line 366 of file multisystem.F90.

◆ multisystem_propagation_start()

recursive subroutine multisystem_oct_m::multisystem_propagation_start ( class(multisystem_t), intent(inout)  this)
private

call the propagation_start routine for all contained systems

Definition at line 390 of file multisystem.F90.

◆ multisystem_propagation_finish()

recursive subroutine multisystem_oct_m::multisystem_propagation_finish ( class(multisystem_t), intent(inout)  this)
private

call the propagation_finish routine for all contained systems

Definition at line 421 of file multisystem.F90.

◆ multisystem_add_partners_to_list()

recursive subroutine multisystem_oct_m::multisystem_add_partners_to_list ( class(multisystem_t), intent(in)  this,
class(partner_list_t), intent(inout)  list,
integer, intent(in), optional  interaction_type 
)
private

add interaction partners contained in the multisystem to a list

This routine adds the multisystem to the list, then it calls the corresponding method for each subsystem.

If the interaction_type is provided, only partners that support that interaction are added, otherwise all partners are added.

Definition at line 457 of file multisystem.F90.

◆ multisystem_create_interactions()

recursive subroutine multisystem_oct_m::multisystem_create_interactions ( class(multisystem_t), intent(inout)  this,
class(interactions_factory_abst_t), intent(in)  interaction_factory,
class(partner_list_t), intent(in), target  available_partners 
)
private

create the interactions of the multisystem

This routine creates the interactions of multisystem itself, then it calls the corresponding method for each subsystem.

If called for the top level multisystem, available_partners contains all systems owned by the multisystem container.

Parameters
[in,out]thissystem for which interactions are created.
[in]interaction_factoryfactory that creates the actual interactions
[in]available_partnersa list of available partners for the given system.

Definition at line 490 of file multisystem.F90.

◆ multisystem_init_interaction()

subroutine multisystem_oct_m::multisystem_init_interaction ( class(multisystem_t), intent(inout), target  this,
class(interaction_t), intent(inout)  interaction 
)
private

initialize a specific interaction

Note
The multisystem_t class should never know about any specific interaction. Only classes that extend it can know about specific interactions. Such classes should override this method to add new supported interactions.

Definition at line 517 of file multisystem.F90.

◆ multisystem_write_interaction_graph()

recursive subroutine multisystem_oct_m::multisystem_write_interaction_graph ( class(multisystem_t), intent(in)  this,
integer, intent(in)  iunit,
logical, intent(in)  include_ghosts 
)
private

write a graphical representation of the interactions

Definition at line 535 of file multisystem.F90.

◆ multisystem_initial_conditions()

recursive subroutine multisystem_oct_m::multisystem_initial_conditions ( class(multisystem_t), intent(inout)  this)
private

Definition at line 582 of file multisystem.F90.

◆ multisystem_do_algorithmic_operation()

logical function multisystem_oct_m::multisystem_do_algorithmic_operation ( class(multisystem_t), intent(inout)  this,
class(algorithmic_operation_t), intent(in)  operation,
integer, dimension(:), intent(out), allocatable  updated_quantities 
)
private

Definition at line 600 of file multisystem.F90.

◆ multisystem_is_tolerance_reached()

recursive logical function multisystem_oct_m::multisystem_is_tolerance_reached ( class(multisystem_t), intent(in)  this,
real(real64), intent(in)  tol 
)
private

Definition at line 614 of file multisystem.F90.

◆ multisystem_update_quantity()

subroutine multisystem_oct_m::multisystem_update_quantity ( class(multisystem_t), intent(inout)  this,
integer, intent(in)  iq 
)
private

Definition at line 634 of file multisystem.F90.

◆ multisystem_init_interaction_as_partner()

subroutine multisystem_oct_m::multisystem_init_interaction_as_partner ( class(multisystem_t), intent(in)  partner,
class(interaction_surrogate_t), intent(inout)  interaction 
)
private

Definition at line 650 of file multisystem.F90.

◆ multisystem_copy_quantities_to_interaction()

subroutine multisystem_oct_m::multisystem_copy_quantities_to_interaction ( class(multisystem_t), intent(inout)  partner,
class(interaction_surrogate_t), intent(inout)  interaction 
)
private

Definition at line 666 of file multisystem.F90.

◆ multisystem_process_is_slave()

recursive logical function multisystem_oct_m::multisystem_process_is_slave ( class(multisystem_t), intent(in)  this)
private

Definition at line 682 of file multisystem.F90.

◆ multisystem_update_kinetic_energy()

recursive subroutine multisystem_oct_m::multisystem_update_kinetic_energy ( class(multisystem_t), intent(inout)  this)
private

Calculate the kinetic energy: The kinetic energy of a container (multisystem) is defined by the kinetic energy with respect to the center or mass motion.

Definition at line 704 of file multisystem.F90.

◆ multisystem_update_internal_energy()

recursive subroutine multisystem_oct_m::multisystem_update_internal_energy ( class(multisystem_t), intent(inout)  this)
private

Definition at line 719 of file multisystem.F90.

◆ multisystem_update_potential_energy()

subroutine multisystem_oct_m::multisystem_update_potential_energy ( class(multisystem_t), intent(inout)  this)
private

Calculate the potential energy for a container.

The potential energy accounts for the energy of the content of the container in the field of all systems, which are not part of the container.

Note
It is important to note, that the potential energy of a container is not the sum of the potential energies of the constituent system.

Another complication arises when the container contains another container, as then we need to account for the interactions of its constituents with partners outside the current container.

Definition at line 778 of file multisystem.F90.

◆ multisystem_pair_energy()

recursive real(real64) function multisystem_oct_m::multisystem_pair_energy ( class(interaction_partner_t), intent(in)  partner_A,
class(interaction_partner_t), intent(in)  partner_B 
)
private

This function calculates the complete interaction energy between partner_A and partner_B, which means that for any container its constituents will be accounted for. This continues recursively up to the level of non-container systems.

If partner_A and partner_B are not interacting, the routine returns zero.

Definition at line 828 of file multisystem.F90.

◆ multisystem_get_flat_list()

recursive subroutine multisystem_oct_m::multisystem_get_flat_list ( class(multisystem_t), intent(in)  this,
type(system_list_t), intent(out)  flat_list 
)
private

Generate a list of all systems contained in a multisystem, including those inside child containers.

Definition at line 913 of file multisystem.F90.

◆ multisystem_end()

recursive subroutine, public multisystem_oct_m::multisystem_end ( class(multisystem_t), intent(inout)  this)

Definition at line 941 of file multisystem.F90.

◆ multisystem_start_barrier()

recursive subroutine multisystem_oct_m::multisystem_start_barrier ( class(multisystem_t), intent(inout)  this,
real(real64), intent(in)  target_time,
integer, intent(in)  barrier_index 
)
private

Definition at line 963 of file multisystem.F90.

◆ multisystem_end_barrier()

recursive subroutine multisystem_oct_m::multisystem_end_barrier ( class(multisystem_t), intent(inout)  this,
integer, intent(in)  barrier_index 
)
private

Definition at line 983 of file multisystem.F90.

◆ multisystem_arrived_at_barrier()

recursive logical function multisystem_oct_m::multisystem_arrived_at_barrier ( class(multisystem_t), intent(inout)  this,
integer, intent(in)  barrier_index 
)
private

Definition at line 1002 of file multisystem.F90.

◆ multisystem_restart_write()

recursive subroutine multisystem_oct_m::multisystem_restart_write ( class(multisystem_t), intent(inout)  this)
private

Definition at line 1023 of file multisystem.F90.

◆ multisystem_restart_read()

recursive logical function multisystem_oct_m::multisystem_restart_read ( class(multisystem_t), intent(inout)  this)
private

Definition at line 1047 of file multisystem.F90.

◆ multisystem_restart_write_data()

subroutine multisystem_oct_m::multisystem_restart_write_data ( class(multisystem_t), intent(inout)  this)
private

Definition at line 1074 of file multisystem.F90.

◆ multisystem_restart_read_data()

logical function multisystem_oct_m::multisystem_restart_read_data ( class(multisystem_t), intent(inout)  this)
private

Definition at line 1086 of file multisystem.F90.