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)
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 class(ensemble_t),
pointer :: sys
78 class(system_t),
pointer :: replica
79 character(len=128) :: replica_name
84 sys%namespace = namespace
85 sys%nreplica = n_replicas
88 allocate(sys%supported_interactions(0))
89 allocate(sys%supported_interactions_as_partner(0))
91 do ireplica = 1, sys%nreplica
92 write(replica_name,
'(I8.8)') ireplica
99 call sys%list%add(replica)
105 safe_allocate(sys%weights(1:sys%nreplica))
106 sys%weights = 1.0_real64/sys%nreplica
112 type(ensemble_t),
intent(inout) :: this
122 type(ensemble_t),
intent(inout) :: this
126 safe_deallocate_a(this%weights)
148 class(
system_t),
pointer :: subsystem
156 call iter%start(this%list)
157 do while (iter%has_next())
158 subsystem => iter%get_next()
166 call partners%empty()
167 call partners%add(subsystem)
168 call subsystem%create_interactions(interaction_factory, partners)
181 integer,
optional,
intent(in) :: interaction_type
188 if (
present(interaction_type))
then
189 if (any(this%supported_interactions_as_partner == interaction_type))
then
195 call iter%start(this%list)
196 do while (iter%has_next())
197 system => iter%get_next()
198 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 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.
recursive class(ensemble_t) function, pointer ensemble_constructor(namespace, n_replicas, system_factory, names, types)
Constructor for the ensemble_t class.
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.