57 real(real64),
allocatable :: weights(:)
66 procedure ensemble_constructor
78 recursive function ensemble_constructor(namespace, n_replicas, first, last, system_factory, names, types, calc_mode_id, grp) &
80 type(namespace_t),
intent(in) :: namespace
81 integer,
intent(in) :: n_replicas
82 class(system_factory_abst_t),
intent(in) :: system_factory
83 integer,
intent(in) :: first
84 integer,
intent(in) :: last
85 character(len=128),
intent(in) :: names(:)
86 integer,
intent(in) :: types(:)
87 integer,
intent(in) :: calc_mode_id
88 type(mpi_grp_t),
intent(in) :: grp
89 class(ensemble_t),
pointer :: sys
92 class(system_t),
pointer :: replica
93 character(len=128) :: replica_name
98 sys%namespace = namespace
99 sys%nreplica = n_replicas
100 sys%first = max(1, first)
101 sys%last = min(n_replicas, last)
105 allocate(sys%supported_interactions(0))
106 allocate(sys%supported_interactions_as_partner(0))
108 do ireplica = sys%first, sys%last
109 write(replica_name,
'(I8.8)') ireplica
115 system_factory, calc_mode_id, grp)
117 call sys%list%add(replica)
123 safe_allocate(sys%weights(1:sys%nreplica))
124 sys%weights = 1.0_real64/sys%nreplica
130 type(ensemble_t),
intent(inout) :: this
140 type(ensemble_t),
intent(inout) :: this
144 safe_deallocate_a(this%weights)
166 class(
system_t),
pointer :: subsystem
175 call iter%start(this%list)
176 do while (iter%has_next())
177 subsystem => iter%get_next()
185 call partners%empty()
186 call partners%add(subsystem)
187 call subsystem%create_interactions(interaction_factory, partners)
201 integer,
optional,
intent(in) :: interaction_type
208 if (
present(interaction_type))
then
209 if (any(this%supported_interactions_as_partner == interaction_type))
then
215 call iter%start(this%list)
216 do while (iter%has_next())
217 system => iter%get_next()
218 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, first, last, system_factory, names, types, calc_mode_id, grp)
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.