32 #include "../../base/base_uses.f90"
40 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'csvr_system_mapping'
54 TYPE(simpar_type),
POINTER :: simpar
55 TYPE(csvr_system_type),
POINTER :: csvr
58 TYPE(map_info_type),
POINTER :: map_info
60 SELECT CASE (simpar%ensemble)
62 cpabort(
'Never reach this point!')
64 map_info => csvr%map_info
69 csvr%glob_num_csvr = 1
81 DO i = 1, csvr%loc_num_csvr
82 csvr%nvt(i)%nkt = simpar%temp_baro_ext*ndeg
83 csvr%nvt(i)%degrees_of_freedom = ndeg
85 csvr%nvt(i)%nkt = simpar%temp_baro_ext
86 csvr%nvt(i)%degrees_of_freedom = 1
106 molecule_set, molecule_kind_set, csvr, para_env, gci)
108 TYPE(thermostat_info_type),
POINTER :: thermostat_info
109 TYPE(simpar_type),
POINTER :: simpar
110 TYPE(distribution_1d_type),
POINTER :: local_molecules
111 TYPE(molecule_type),
POINTER :: molecule_set(:)
112 TYPE(molecule_kind_type),
POINTER :: molecule_kind_set(:)
113 TYPE(csvr_system_type),
POINTER :: csvr
114 TYPE(mp_para_env_type),
POINTER :: para_env
115 TYPE(global_constraint_type),
POINTER :: gci
117 INTEGER :: i, imap, j, natoms_local, &
119 INTEGER,
DIMENSION(:),
POINTER :: deg_of_freedom, massive_atom_list
121 TYPE(map_info_type),
POINTER :: map_info
123 NULLIFY (massive_atom_list, deg_of_freedom)
124 SELECT CASE (simpar%ensemble)
126 cpabort(
'Unknown ensemble!')
129 cpabort(
'Never reach this point!')
132 CALL setup_csvr_thermostat(csvr, thermostat_info, deg_of_freedom, &
133 massive_atom_list, molecule_kind_set, local_molecules, molecule_set, &
134 para_env, natoms_local, simpar, sum_of_thermostats, gci)
138 map_info => csvr%map_info
139 map_info%s_kin = 0.0_dp
141 DO j = 1, natoms_local
142 map_info%p_kin(i, j)%point = map_info%p_kin(i, j)%point + 1
152 fac = map_info%s_kin(1) - deg_of_freedom(1) - simpar%nfree_rot_transl
153 IF (
fac == 0.0_dp)
THEN
154 cpabort(
'Zero degrees of freedom. Nothing to thermalize!')
156 csvr%nvt(1)%nkt = simpar%temp_ext*
fac
157 csvr%nvt(1)%degrees_of_freedom = floor(
fac)
159 DO i = 1, csvr%loc_num_csvr
160 imap = map_info%map_index(i)
161 fac = (map_info%s_kin(imap) - deg_of_freedom(i))
162 csvr%nvt(i)%nkt = simpar%temp_ext*
fac
163 csvr%nvt(i)%degrees_of_freedom = floor(
fac)
167 DEALLOCATE (deg_of_freedom)
168 DEALLOCATE (massive_atom_list)
190 SUBROUTINE setup_csvr_thermostat(csvr, thermostat_info, deg_of_freedom, &
191 massive_atom_list, molecule_kind_set, local_molecules, molecule_set, &
192 para_env, natoms_local, simpar, sum_of_thermostats, gci, shell)
194 TYPE(csvr_system_type),
POINTER :: csvr
195 TYPE(thermostat_info_type),
POINTER :: thermostat_info
196 INTEGER,
DIMENSION(:),
POINTER :: deg_of_freedom, massive_atom_list
197 TYPE(molecule_kind_type),
POINTER :: molecule_kind_set(:)
198 TYPE(distribution_1d_type),
POINTER :: local_molecules
199 TYPE(molecule_type),
POINTER :: molecule_set(:)
200 TYPE(mp_para_env_type),
POINTER :: para_env
201 INTEGER,
INTENT(OUT) :: natoms_local
202 TYPE(simpar_type),
POINTER :: simpar
203 INTEGER,
INTENT(OUT) :: sum_of_thermostats
204 TYPE(global_constraint_type),
POINTER :: gci
205 LOGICAL,
INTENT(IN),
OPTIONAL :: shell
207 INTEGER :: nkind, number, region
209 TYPE(map_info_type),
POINTER :: map_info
212 IF (
PRESENT(shell)) do_shell = shell
213 map_info => csvr%map_info
215 nkind =
SIZE(molecule_kind_set)
216 sum_of_thermostats = thermostat_info%sum_of_thermostats
217 map_info%dis_type = thermostat_info%dis_type
218 number = thermostat_info%number_of_thermostats
222 molecule_kind_set, local_molecules, molecule_set, para_env, natoms_local, &
223 simpar, number, region, gci, do_shell, thermostat_info%map_loc_thermo_gen, &
227 csvr%loc_num_csvr = number
228 csvr%glob_num_csvr = sum_of_thermostats
231 END SUBROUTINE setup_csvr_thermostat
246 molecule_set, molecule_kind_set, csvr, para_env, gci)
248 TYPE(thermostat_info_type),
POINTER :: thermostat_info
249 TYPE(simpar_type),
POINTER :: simpar
250 TYPE(distribution_1d_type),
POINTER :: local_molecules
251 TYPE(molecule_type),
POINTER :: molecule_set(:)
252 TYPE(molecule_kind_type),
POINTER :: molecule_kind_set(:)
253 TYPE(csvr_system_type),
POINTER :: csvr
254 TYPE(mp_para_env_type),
POINTER :: para_env
255 TYPE(global_constraint_type),
POINTER :: gci
257 INTEGER :: i, imap, j, nshell_local, &
259 INTEGER,
DIMENSION(:),
POINTER :: deg_of_freedom, massive_shell_list
260 TYPE(map_info_type),
POINTER :: map_info
262 NULLIFY (massive_shell_list, deg_of_freedom)
264 SELECT CASE (simpar%ensemble)
266 cpabort(
'Unknown ensemble!')
269 cpabort(
'Never reach this point!')
273 CALL setup_csvr_thermostat(csvr, thermostat_info, deg_of_freedom, massive_shell_list, &
274 molecule_kind_set, local_molecules, molecule_set, para_env, nshell_local, &
275 simpar, sum_of_thermostats, gci, shell=.true.)
277 map_info => csvr%map_info
280 map_info%s_kin = 0.0_dp
281 DO j = 1, nshell_local
283 map_info%p_kin(i, j)%point = map_info%p_kin(i, j)%point + 1
293 DO i = 1, csvr%loc_num_csvr
294 imap = map_info%map_index(i)
295 csvr%nvt(i)%nkt = simpar%temp_sh_ext*map_info%s_kin(imap)
296 csvr%nvt(i)%degrees_of_freedom = floor(map_info%s_kin(imap))
299 DEALLOCATE (deg_of_freedom)
300 DEALLOCATE (massive_shell_list)
static GRID_HOST_DEVICE double fac(const int i)
Factorial function, e.g. fac(5) = 5! = 120.
subroutine, public csvr_to_particle_mapping(thermostat_info, simpar, local_molecules, molecule_set, molecule_kind_set, csvr, para_env, gci)
Creates the thermostatting maps.
subroutine, public csvr_to_barostat_mapping(simpar, csvr)
Creates the thermostatting for the barostat.
subroutine, public csvr_to_shell_mapping(thermostat_info, simpar, local_molecules, molecule_set, molecule_kind_set, csvr, para_env, gci)
...
Type for the canonical sampling through velocity rescaling.
subroutine, public csvr_thermo_create(csvr)
Initialize NVT type for CSVR 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.
logical, parameter, public debug_isotropic_limit
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)
subroutine, public init_baro_map_info(map_info, ndeg, num_thermo)
Initialize the map_info for barostat thermostat.
Thermostat structure: module containing thermostat available for MD.