56 real(real64),
allocatable :: weights(:)
65 procedure ensemble_constructor
77 recursive function ensemble_constructor(namespace, n_replicas, first, last, system_factory, names, types, calc_mode_id) &
79 type(namespace_t),
intent(in) :: namespace
80 integer,
intent(in) :: n_replicas
81 class(system_factory_abst_t),
intent(in) :: system_factory
82 integer,
intent(in) :: first
83 integer,
intent(in) :: last
84 character(len=128),
intent(in) :: names(:)
85 integer,
intent(in) :: types(:)
86 integer,
intent(in) :: calc_mode_id
87 class(ensemble_t),
pointer :: sys
90 class(system_t),
pointer :: replica
91 character(len=128) :: replica_name
96 sys%namespace = namespace
97 sys%nreplica = n_replicas
98 sys%first = max(1, first)
99 sys%last = min(n_replicas, last)
103 allocate(sys%supported_interactions(0))
104 allocate(sys%supported_interactions_as_partner(0))
106 do ireplica = sys%first, sys%last
107 write(replica_name,
'(I8.8)') ireplica
114 call sys%list%add(replica)
120 safe_allocate(sys%weights(1:sys%nreplica))
121 sys%weights = 1.0_real64/sys%nreplica
127 type(ensemble_t),
intent(inout) :: this
137 type(ensemble_t),
intent(inout) :: this
141 safe_deallocate_a(this%weights)
163 class(
system_t),
pointer :: subsystem
172 call iter%start(this%list)
173 do while (iter%has_next())
174 subsystem => iter%get_next()
182 call partners%empty()
183 call partners%add(subsystem)
184 call subsystem%create_interactions(interaction_factory, partners)
198 integer,
optional,
intent(in) :: interaction_type
205 if (
present(interaction_type))
then
206 if (any(this%supported_interactions_as_partner == interaction_type))
then
212 call iter%start(this%list)
213 do while (iter%has_next())
214 system => iter%get_next()
215 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 class(ensemble_t) function, pointer ensemble_constructor(namespace, n_replicas, first, last, system_factory, names, types, calc_mode_id)
Constructor for the ensemble_t class.
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.