30#include "../../base/base_uses.f90"
38 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'al_system_mapping'
57 molecule_set, molecule_kind_set, al, para_env, gci)
68 INTEGER :: i, imap, j, natoms_local, &
70 INTEGER,
DIMENSION(:),
POINTER :: deg_of_freedom, massive_atom_list
74 NULLIFY (massive_atom_list, deg_of_freedom)
75 SELECT CASE (simpar%ensemble)
77 cpabort(
'Unknown ensemble!')
80 cpabort(
'Never reach this point!')
83 CALL setup_al_thermostat(al, thermostat_info, deg_of_freedom, &
84 massive_atom_list, molecule_kind_set, local_molecules, molecule_set, &
85 para_env, natoms_local, simpar, sum_of_thermostats, gci)
89 map_info => al%map_info
90 map_info%s_kin = 0.0_dp
92 DO j = 1, natoms_local
93 map_info%p_kin(i, j)%point = map_info%p_kin(i, j)%point + 1
103 fac = map_info%s_kin(1) - deg_of_freedom(1) - simpar%nfree_rot_transl
104 IF (
fac == 0.0_dp)
THEN
105 cpabort(
'Zero degrees of freedom. Nothing to thermalize!')
107 al%nvt(1)%nkt = simpar%temp_ext*
fac
108 al%nvt(1)%degrees_of_freedom = floor(
fac)
110 DO i = 1, al%loc_num_al
111 imap = map_info%map_index(i)
112 fac = (map_info%s_kin(imap) - deg_of_freedom(i))
113 al%nvt(i)%nkt = simpar%temp_ext*
fac
114 al%nvt(i)%degrees_of_freedom = floor(
fac)
118 DEALLOCATE (deg_of_freedom)
119 DEALLOCATE (massive_atom_list)
141 SUBROUTINE setup_al_thermostat(al, thermostat_info, deg_of_freedom, &
142 massive_atom_list, molecule_kind_set, local_molecules, molecule_set, &
143 para_env, natoms_local, simpar, sum_of_thermostats, gci, shell)
147 INTEGER,
DIMENSION(:),
POINTER :: deg_of_freedom, massive_atom_list
152 INTEGER,
INTENT(OUT) :: natoms_local
154 INTEGER,
INTENT(OUT) :: sum_of_thermostats
156 LOGICAL,
INTENT(IN),
OPTIONAL :: shell
158 INTEGER :: nkind, number, region
163 IF (
PRESENT(shell)) do_shell = shell
164 map_info => al%map_info
166 nkind =
SIZE(molecule_kind_set)
167 sum_of_thermostats = thermostat_info%sum_of_thermostats
168 map_info%dis_type = thermostat_info%dis_type
169 number = thermostat_info%number_of_thermostats
173 molecule_kind_set, local_molecules, molecule_set, para_env, natoms_local, &
174 simpar, number, region, gci, do_shell, thermostat_info%map_loc_thermo_gen, &
178 al%loc_num_al = number
179 al%glob_num_al = sum_of_thermostats
182 END SUBROUTINE setup_al_thermostat
static GRID_HOST_DEVICE double fac(const int i)
Factorial function, e.g. fac(5) = 5! = 120.
subroutine, public al_to_particle_mapping(thermostat_info, simpar, local_molecules, molecule_set, molecule_kind_set, al, para_env, gci)
Creates the thermostatting maps.
Type for the canonical sampling through velocity rescaling.
subroutine, public al_thermo_create(al)
Initialize NVT type for AD_LANGEVIN thermostat.
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
Lumps all possible extended system variables into one type for easy access and passing.
Defines the basic variable types.
integer, parameter, public dp
Interface to the message passing library MPI.
Define the molecule kind structure types and the corresponding functionality.
Define the data structure for the molecule information.
Type for storing MD parameters.
subroutine, public thermostat_mapping_region(map_info, deg_of_freedom, massive_atom_list, molecule_kind_set, local_molecules, molecule_set, para_env, natoms_local, simpar, number, region, gci, shell, map_loc_thermo_gen, sum_of_thermostats)
Main general setup thermostat regions (thermostat independent)
Thermostat structure: module containing thermostat available for MD.
structure to store local (to a processor) ordered lists of integers.
stores all the informations relevant to an mpi environment
Simulation parameter type for molecular dynamics.