47 real(real64),
allocatable :: weights(:)
48 integer :: distribution_type
57 procedure ensemble_constructor
69 recursive function ensemble_constructor(namespace, n_replicas, system_factory, names, types, calc_mode_id)
result(sys)
70 type(namespace_t),
intent(in) :: namespace
71 integer,
intent(in) :: n_replicas
72 class(system_factory_abst_t),
intent(in) :: system_factory
73 character(len=128),
intent(in) :: names(:)
74 integer,
intent(in) :: types(:)
75 integer,
intent(in) :: calc_mode_id
76 class(ensemble_t),
pointer :: sys
79 class(system_t),
pointer :: replica
80 character(len=128) :: replica_name
85 sys%namespace = namespace
86 sys%nreplica = n_replicas
89 allocate(sys%supported_interactions(0))
90 allocate(sys%supported_interactions_as_partner(0))
92 do ireplica = 1, sys%nreplica
93 write(replica_name,
'(I8.8)') ireplica
100 call sys%list%add(replica)
106 safe_allocate(sys%weights(1:sys%nreplica))
107 sys%weights = 1.0_real64/sys%nreplica
113 type(ensemble_t),
intent(inout) :: this
123 type(ensemble_t),
intent(inout) :: this
127 safe_deallocate_a(this%weights)
149 class(
system_t),
pointer :: subsystem
157 call iter%start(this%list)
158 do while (iter%has_next())
159 subsystem => iter%get_next()
167 call partners%empty()
168 call partners%add(subsystem)
169 call subsystem%create_interactions(interaction_factory, partners)
182 integer,
optional,
intent(in) :: interaction_type
189 if (
present(interaction_type))
then
190 if (any(this%supported_interactions_as_partner == interaction_type))
then
196 call iter%start(this%list)
197 do while (iter%has_next())
198 system => iter%get_next()
199 call system%add_partners_to_list(list)
This module implements the basic elements defining algorithms.
This module implements the ensemble class.
recursive subroutine ensemble_create_interactions(this, interaction_factory, available_partners)
create the interactions of the ensemble
recursive class(ensemble_t) function, pointer ensemble_constructor(namespace, n_replicas, system_factory, names, types, calc_mode_id)
Constructor for the ensemble_t class.
recursive subroutine ensemble_finalizer(this)
recursive subroutine ensemble_end(this)
recursive subroutine ensemble_add_partners_to_list(this, list, interaction_type)
add the container to the flat list.
This module defines classes and functions for interaction partners.
This module defines the abstract class for the interaction factory.
This module implements the basic mulsisystem class, a container system for other systems.
This module implements the abstract multisystem class.
recursive subroutine, public multisystem_end(this)
This module defines the abstract class for the system factory.
This module implements the abstract system type.
recursive subroutine, public system_create_interactions(this, interaction_factory, available_partners)
create the interactions of the system
abstract class for interaction factories
Container class for lists of system_oct_m::system_t.
the abstract multisystem class
Abstract class for systems.