58 real(real64),
allocatable :: weights(:)
67 procedure ensemble_constructor
79 recursive function ensemble_constructor(namespace, n_replicas, first, last, system_factory, names, types, calc_mode_id, grp) &
81 type(namespace_t),
intent(in) :: namespace
82 integer,
intent(in) :: n_replicas
83 class(system_factory_abst_t),
intent(in) :: system_factory
84 integer,
intent(in) :: first
85 integer,
intent(in) :: last
86 character(len=128),
intent(in) :: names(:)
87 integer,
intent(in) :: types(:)
88 integer,
intent(in) :: calc_mode_id
89 type(mpi_grp_t),
intent(in) :: grp
90 class(ensemble_t),
pointer :: sys
93 class(system_t),
pointer :: replica
94 character(len=128) :: replica_name
99 sys%namespace = namespace
100 sys%nreplica = n_replicas
101 sys%first = max(1, first)
102 sys%last = min(n_replicas, last)
106 allocate(sys%supported_interactions(0))
107 allocate(sys%supported_interactions_as_partner(0))
109 do ireplica = sys%first, sys%last
110 write(replica_name,
'(I8.8)') ireplica
116 system_factory, calc_mode_id, grp)
118 call sys%list%add(replica)
124 safe_allocate(sys%weights(1:sys%nreplica))
125 sys%weights = 1.0_real64/sys%nreplica
131 type(ensemble_t),
intent(inout) :: this
141 type(ensemble_t),
intent(inout) :: this
145 safe_deallocate_a(this%weights)
167 class(
system_t),
pointer :: subsystem
176 call iter%start(this%list)
177 do while (iter%has_next())
178 subsystem => iter%get_next()
186 call partners%empty()
187 call partners%add(subsystem)
188 call subsystem%create_interactions(interaction_factory, partners)
202 integer,
optional,
intent(in) :: interaction_type
209 if (
present(interaction_type))
then
210 if (any(this%supported_interactions_as_partner == interaction_type))
then
216 call iter%start(this%list)
217 do while (iter%has_next())
218 system => iter%get_next()
219 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.