(git:ed6f26b)
Loading...
Searching...
No Matches
force_env_utils.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2025 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Util force_env module
10!> \author Teodoro Laino [tlaino] - 02.2011
11! **************************************************************************************************
13
15 USE cell_types, ONLY: cell_type
16 USE constraint, ONLY: rattle_control,&
18 USE constraint_util, ONLY: getold
29 USE kinds, ONLY: default_string_length,&
30 dp
36 USE physcon, ONLY: angstrom
38#include "./base/base_uses.f90"
39
40 IMPLICIT NONE
41
42 PRIVATE
43
44 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'force_env_utils'
45
46 PUBLIC :: force_env_shake, &
51
52CONTAINS
53
54! **************************************************************************************************
55!> \brief perform shake (enforcing of constraints)
56!> \param force_env the force env to shake
57!> \param dt the dt for shake (if you are not interested in the velocities
58!> it can be any positive number)
59!> \param shake_tol the tolerance for shake
60!> \param log_unit if >0 then some information on the shake is printed,
61!> defaults to -1
62!> \param lagrange_mult ...
63!> \param dump_lm ...
64!> \param pos ...
65!> \param vel ...
66!> \param compold ...
67!> \param reset ...
68!> \author fawzi
69! **************************************************************************************************
70 SUBROUTINE force_env_shake(force_env, dt, shake_tol, log_unit, lagrange_mult, dump_lm, &
71 pos, vel, compold, reset)
72
73 TYPE(force_env_type), POINTER :: force_env
74 REAL(kind=dp), INTENT(IN), OPTIONAL :: dt
75 REAL(kind=dp), INTENT(IN) :: shake_tol
76 INTEGER, INTENT(in), OPTIONAL :: log_unit, lagrange_mult
77 LOGICAL, INTENT(IN), OPTIONAL :: dump_lm
78 REAL(kind=dp), DIMENSION(:, :), INTENT(INOUT), &
79 OPTIONAL, TARGET :: pos, vel
80 LOGICAL, INTENT(IN), OPTIONAL :: compold, reset
81
82 CHARACTER(len=*), PARAMETER :: routinen = 'force_env_shake'
83
84 INTEGER :: handle, i, iparticle, iparticle_kind, iparticle_local, j, my_lagrange_mult, &
85 my_log_unit, nparticle_kind, nparticle_local
86 LOGICAL :: has_pos, has_vel, my_dump_lm
87 REAL(kind=dp) :: mydt
88 REAL(kind=dp), DIMENSION(:, :), POINTER :: my_pos, my_vel
89 TYPE(atomic_kind_list_type), POINTER :: atomic_kinds
90 TYPE(cell_type), POINTER :: cell
91 TYPE(cp_subsys_type), POINTER :: subsys
92 TYPE(distribution_1d_type), POINTER :: local_molecules, local_particles
93 TYPE(global_constraint_type), POINTER :: gci
94 TYPE(molecule_kind_list_type), POINTER :: molecule_kinds
95 TYPE(molecule_list_type), POINTER :: molecules
96 TYPE(particle_list_type), POINTER :: particles
97
98 CALL timeset(routinen, handle)
99 cpassert(ASSOCIATED(force_env))
100 cpassert(force_env%ref_count > 0)
101 my_log_unit = -1
102 IF (PRESENT(log_unit)) my_log_unit = log_unit
103 my_lagrange_mult = -1
104 IF (PRESENT(lagrange_mult)) my_lagrange_mult = lagrange_mult
105 my_dump_lm = .false.
106 IF (PRESENT(dump_lm)) my_dump_lm = dump_lm
107 NULLIFY (subsys, cell, molecules, molecule_kinds, local_molecules, particles, &
108 my_pos, my_vel, gci)
109 IF (PRESENT(pos)) my_pos => pos
110 IF (PRESENT(vel)) my_vel => vel
111 mydt = 0.1_dp
112 IF (PRESENT(dt)) mydt = dt
113 CALL force_env_get(force_env, subsys=subsys, cell=cell)
114 CALL cp_subsys_get(subsys, &
115 atomic_kinds=atomic_kinds, &
116 local_molecules=local_molecules, &
117 local_particles=local_particles, &
118 molecules=molecules, &
119 molecule_kinds=molecule_kinds, &
120 particles=particles, &
121 gci=gci)
122 nparticle_kind = atomic_kinds%n_els
123 IF (PRESENT(compold)) THEN
124 IF (compold) THEN
125 CALL getold(gci, local_molecules, molecules%els, molecule_kinds%els, &
126 particles%els, cell)
127 END IF
128 END IF
129 has_pos = .false.
130 IF (.NOT. ASSOCIATED(my_pos)) THEN
131 has_pos = .true.
132 ALLOCATE (my_pos(3, particles%n_els))
133 my_pos = 0.0_dp
134 DO iparticle_kind = 1, nparticle_kind
135 nparticle_local = local_particles%n_el(iparticle_kind)
136 DO iparticle_local = 1, nparticle_local
137 iparticle = local_particles%list(iparticle_kind)%array(iparticle_local)
138 my_pos(:, iparticle) = particles%els(iparticle)%r(:)
139 END DO
140 END DO
141 END IF
142 has_vel = .false.
143 IF (.NOT. ASSOCIATED(my_vel)) THEN
144 has_vel = .true.
145 ALLOCATE (my_vel(3, particles%n_els))
146 my_vel = 0.0_dp
147 DO iparticle_kind = 1, nparticle_kind
148 nparticle_local = local_particles%n_el(iparticle_kind)
149 DO iparticle_local = 1, nparticle_local
150 iparticle = local_particles%list(iparticle_kind)%array(iparticle_local)
151 my_vel(:, iparticle) = particles%els(iparticle)%v(:)
152 END DO
153 END DO
154 END IF
155
156 CALL shake_control(gci=gci, local_molecules=local_molecules, &
157 molecule_set=molecules%els, molecule_kind_set=molecule_kinds%els, &
158 particle_set=particles%els, pos=my_pos, vel=my_vel, dt=mydt, &
159 shake_tol=shake_tol, log_unit=my_log_unit, lagrange_mult=my_lagrange_mult, &
160 dump_lm=my_dump_lm, cell=cell, group=force_env%para_env, &
161 local_particles=local_particles)
162
163 ! Possibly reset the lagrange multipliers
164 IF (PRESENT(reset)) THEN
165 IF (reset) THEN
166 ! Reset Intramolecular constraints
167 DO i = 1, SIZE(molecules%els)
168 IF (ASSOCIATED(molecules%els(i)%lci%lcolv)) THEN
169 DO j = 1, SIZE(molecules%els(i)%lci%lcolv)
170 ! Reset langrange multiplier
171 molecules%els(i)%lci%lcolv(j)%lambda = 0.0_dp
172 END DO
173 END IF
174 IF (ASSOCIATED(molecules%els(i)%lci%lg3x3)) THEN
175 DO j = 1, SIZE(molecules%els(i)%lci%lg3x3)
176 ! Reset langrange multiplier
177 molecules%els(i)%lci%lg3x3(j)%lambda = 0.0_dp
178 END DO
179 END IF
180 IF (ASSOCIATED(molecules%els(i)%lci%lg4x6)) THEN
181 DO j = 1, SIZE(molecules%els(i)%lci%lg4x6)
182 ! Reset langrange multiplier
183 molecules%els(i)%lci%lg4x6(j)%lambda = 0.0_dp
184 END DO
185 END IF
186 END DO
187 ! Reset Intermolecular constraints
188 IF (ASSOCIATED(gci)) THEN
189 IF (ASSOCIATED(gci%lcolv)) THEN
190 DO j = 1, SIZE(gci%lcolv)
191 ! Reset langrange multiplier
192 gci%lcolv(j)%lambda = 0.0_dp
193 END DO
194 END IF
195 IF (ASSOCIATED(gci%lg3x3)) THEN
196 DO j = 1, SIZE(gci%lg3x3)
197 ! Reset langrange multiplier
198 gci%lg3x3(j)%lambda = 0.0_dp
199 END DO
200 END IF
201 IF (ASSOCIATED(gci%lg4x6)) THEN
202 DO j = 1, SIZE(gci%lg4x6)
203 ! Reset langrange multiplier
204 gci%lg4x6(j)%lambda = 0.0_dp
205 END DO
206 END IF
207 END IF
208 END IF
209 END IF
210
211 IF (has_pos) THEN
212 CALL update_particle_set(particles%els, force_env%para_env, pos=my_pos)
213 DEALLOCATE (my_pos)
214 END IF
215 IF (has_vel) THEN
216 CALL update_particle_set(particles%els, force_env%para_env, vel=my_vel)
217 DEALLOCATE (my_vel)
218 END IF
219 CALL timestop(handle)
220 END SUBROUTINE force_env_shake
221
222! **************************************************************************************************
223!> \brief perform rattle (enforcing of constraints on velocities)
224!> This routine can be easily adapted to performe rattle on whatever
225!> other vector different from forces..
226!> \param force_env the force env to shake
227!> \param dt the dt for shake (if you are not interested in the velocities
228!> it can be any positive number)
229!> \param shake_tol the tolerance for shake
230!> \param log_unit if >0 then some information on the shake is printed,
231!> defaults to -1
232!> \param lagrange_mult ...
233!> \param dump_lm ...
234!> \param vel ...
235!> \param reset ...
236!> \author tlaino
237! **************************************************************************************************
238 SUBROUTINE force_env_rattle(force_env, dt, shake_tol, log_unit, lagrange_mult, dump_lm, &
239 vel, reset)
240
241 TYPE(force_env_type), POINTER :: force_env
242 REAL(kind=dp), INTENT(in), OPTIONAL :: dt
243 REAL(kind=dp), INTENT(in) :: shake_tol
244 INTEGER, INTENT(in), OPTIONAL :: log_unit, lagrange_mult
245 LOGICAL, INTENT(IN), OPTIONAL :: dump_lm
246 REAL(kind=dp), DIMENSION(:, :), INTENT(INOUT), &
247 OPTIONAL, TARGET :: vel
248 LOGICAL, INTENT(IN), OPTIONAL :: reset
249
250 CHARACTER(len=*), PARAMETER :: routinen = 'force_env_rattle'
251
252 INTEGER :: handle, i, iparticle, iparticle_kind, iparticle_local, j, my_lagrange_mult, &
253 my_log_unit, nparticle_kind, nparticle_local
254 LOGICAL :: has_vel, my_dump_lm
255 REAL(kind=dp) :: mydt
256 REAL(kind=dp), DIMENSION(:, :), POINTER :: my_vel
257 TYPE(atomic_kind_list_type), POINTER :: atomic_kinds
258 TYPE(cell_type), POINTER :: cell
259 TYPE(cp_subsys_type), POINTER :: subsys
260 TYPE(distribution_1d_type), POINTER :: local_molecules, local_particles
261 TYPE(global_constraint_type), POINTER :: gci
262 TYPE(molecule_kind_list_type), POINTER :: molecule_kinds
263 TYPE(molecule_list_type), POINTER :: molecules
264 TYPE(particle_list_type), POINTER :: particles
265
266 CALL timeset(routinen, handle)
267 cpassert(ASSOCIATED(force_env))
268 cpassert(force_env%ref_count > 0)
269 my_log_unit = -1
270 IF (PRESENT(log_unit)) my_log_unit = log_unit
271 my_lagrange_mult = -1
272 IF (PRESENT(lagrange_mult)) my_lagrange_mult = lagrange_mult
273 my_dump_lm = .false.
274 IF (PRESENT(dump_lm)) my_dump_lm = dump_lm
275 NULLIFY (subsys, cell, molecules, molecule_kinds, local_molecules, particles, &
276 my_vel)
277 IF (PRESENT(vel)) my_vel => vel
278 mydt = 0.1_dp
279 IF (PRESENT(dt)) mydt = dt
280 CALL force_env_get(force_env, subsys=subsys, cell=cell)
281 CALL cp_subsys_get(subsys, &
282 atomic_kinds=atomic_kinds, &
283 local_molecules=local_molecules, &
284 local_particles=local_particles, &
285 molecules=molecules, &
286 molecule_kinds=molecule_kinds, &
287 particles=particles, &
288 gci=gci)
289 nparticle_kind = atomic_kinds%n_els
290 has_vel = .false.
291 IF (.NOT. ASSOCIATED(my_vel)) THEN
292 has_vel = .true.
293 ALLOCATE (my_vel(3, particles%n_els))
294 my_vel = 0.0_dp
295 DO iparticle_kind = 1, nparticle_kind
296 nparticle_local = local_particles%n_el(iparticle_kind)
297 DO iparticle_local = 1, nparticle_local
298 iparticle = local_particles%list(iparticle_kind)%array(iparticle_local)
299 my_vel(:, iparticle) = particles%els(iparticle)%v(:)
300 END DO
301 END DO
302 END IF
303
304 CALL rattle_control(gci=gci, local_molecules=local_molecules, &
305 molecule_set=molecules%els, molecule_kind_set=molecule_kinds%els, &
306 particle_set=particles%els, vel=my_vel, dt=mydt, &
307 rattle_tol=shake_tol, log_unit=my_log_unit, lagrange_mult=my_lagrange_mult, &
308 dump_lm=my_dump_lm, cell=cell, group=force_env%para_env, &
309 local_particles=local_particles)
310
311 ! Possibly reset the lagrange multipliers
312 IF (PRESENT(reset)) THEN
313 IF (reset) THEN
314 ! Reset Intramolecular constraints
315 DO i = 1, SIZE(molecules%els)
316 IF (ASSOCIATED(molecules%els(i)%lci%lcolv)) THEN
317 DO j = 1, SIZE(molecules%els(i)%lci%lcolv)
318 ! Reset langrange multiplier
319 molecules%els(i)%lci%lcolv(j)%lambda = 0.0_dp
320 END DO
321 END IF
322 IF (ASSOCIATED(molecules%els(i)%lci%lg3x3)) THEN
323 DO j = 1, SIZE(molecules%els(i)%lci%lg3x3)
324 ! Reset langrange multiplier
325 molecules%els(i)%lci%lg3x3(j)%lambda = 0.0_dp
326 END DO
327 END IF
328 IF (ASSOCIATED(molecules%els(i)%lci%lg4x6)) THEN
329 DO j = 1, SIZE(molecules%els(i)%lci%lg4x6)
330 ! Reset langrange multiplier
331 molecules%els(i)%lci%lg4x6(j)%lambda = 0.0_dp
332 END DO
333 END IF
334 END DO
335 ! Reset Intermolecular constraints
336 IF (ASSOCIATED(gci)) THEN
337 IF (ASSOCIATED(gci%lcolv)) THEN
338 DO j = 1, SIZE(gci%lcolv)
339 ! Reset langrange multiplier
340 gci%lcolv(j)%lambda = 0.0_dp
341 END DO
342 END IF
343 IF (ASSOCIATED(gci%lg3x3)) THEN
344 DO j = 1, SIZE(gci%lg3x3)
345 ! Reset langrange multiplier
346 gci%lg3x3(j)%lambda = 0.0_dp
347 END DO
348 END IF
349 IF (ASSOCIATED(gci%lg4x6)) THEN
350 DO j = 1, SIZE(gci%lg4x6)
351 ! Reset langrange multiplier
352 gci%lg4x6(j)%lambda = 0.0_dp
353 END DO
354 END IF
355 END IF
356 END IF
357 END IF
358
359 IF (has_vel) THEN
360 CALL update_particle_set(particles%els, force_env%para_env, vel=my_vel)
361 END IF
362 DEALLOCATE (my_vel)
363 CALL timestop(handle)
364 END SUBROUTINE force_env_rattle
365
366! **************************************************************************************************
367!> \brief Rescale forces if requested
368!> \param force_env the force env to shake
369!> \author tlaino
370! **************************************************************************************************
371 SUBROUTINE rescale_forces(force_env)
372 TYPE(force_env_type), POINTER :: force_env
373
374 CHARACTER(len=*), PARAMETER :: routinen = 'rescale_forces'
375
376 INTEGER :: handle, iparticle
377 LOGICAL :: explicit
378 REAL(kind=dp) :: force(3), max_value, mod_force
379 TYPE(cp_subsys_type), POINTER :: subsys
380 TYPE(particle_list_type), POINTER :: particles
381 TYPE(section_vals_type), POINTER :: rescale_force_section
382
383 CALL timeset(routinen, handle)
384 cpassert(ASSOCIATED(force_env))
385 cpassert(force_env%ref_count > 0)
386 rescale_force_section => section_vals_get_subs_vals(force_env%force_env_section, "RESCALE_FORCES")
387 CALL section_vals_get(rescale_force_section, explicit=explicit)
388 IF (explicit) THEN
389 CALL section_vals_val_get(rescale_force_section, "MAX_FORCE", r_val=max_value)
390 CALL force_env_get(force_env, subsys=subsys)
391 CALL cp_subsys_get(subsys, particles=particles)
392 DO iparticle = 1, SIZE(particles%els)
393 force = particles%els(iparticle)%f(:)
394 mod_force = sqrt(dot_product(force, force))
395 IF ((mod_force > max_value) .AND. (mod_force /= 0.0_dp)) THEN
396 force = force/mod_force*max_value
397 particles%els(iparticle)%f(:) = force
398 END IF
399 END DO
400 END IF
401 CALL timestop(handle)
402 END SUBROUTINE rescale_forces
403
404! **************************************************************************************************
405!> \brief Write forces
406!>
407!> \param particles ...
408!> \param iw ...
409!> \param label ...
410!> \param ndigits ...
411!> \param unit_string ...
412!> \param total_force ...
413!> \param grand_total_force ...
414!> \param zero_force_core_shell_atom ...
415!> \author MK (06.09.2010)
416! **************************************************************************************************
417 SUBROUTINE write_forces(particles, iw, label, ndigits, unit_string, total_force, &
418 grand_total_force, zero_force_core_shell_atom)
419
420 TYPE(particle_list_type), POINTER :: particles
421 INTEGER, INTENT(IN) :: iw
422 CHARACTER(LEN=*), INTENT(IN) :: label
423 INTEGER, INTENT(IN) :: ndigits
424 CHARACTER(LEN=default_string_length), INTENT(IN) :: unit_string
425 REAL(kind=dp), DIMENSION(3), INTENT(OUT) :: total_force
426 REAL(kind=dp), DIMENSION(3), INTENT(INOUT), &
427 OPTIONAL :: grand_total_force
428 LOGICAL, INTENT(IN), OPTIONAL :: zero_force_core_shell_atom
429
430 CHARACTER(LEN=18) :: fmtstr4
431 CHARACTER(LEN=29) :: fmtstr3
432 CHARACTER(LEN=38) :: fmtstr2
433 CHARACTER(LEN=49) :: fmtstr1
434 CHARACTER(LEN=7) :: tag
435 CHARACTER(LEN=LEN_TRIM(label)) :: lc_label
436 INTEGER :: i, iparticle, n
437 LOGICAL :: zero_force
438 REAL(kind=dp) :: fconv
439 REAL(kind=dp), DIMENSION(3) :: f
440
441 IF (iw > 0) THEN
442 cpassert(ASSOCIATED(particles))
443 tag = "FORCES|"
444 lc_label = trim(label)
445 CALL lowercase(lc_label)
446 n = min(max(1, ndigits), 20)
447 fmtstr1 = "(/,T2,A,1X,A,/,T2,A,3X,A,T20,A3,2( X,A3), X,A3)"
448 WRITE (unit=fmtstr1(35:36), fmt="(I2)") n + 5
449 WRITE (unit=fmtstr1(43:44), fmt="(I2)") n + 6
450 fmtstr2 = "(T2,A,I7,T16,3(1X,ES . ),2X,ES . )"
451 WRITE (unit=fmtstr2(21:22), fmt="(I2)") n + 7
452 WRITE (unit=fmtstr2(24:25), fmt="(I2)") n
453 WRITE (unit=fmtstr2(33:34), fmt="(I2)") n + 7
454 WRITE (unit=fmtstr2(36:37), fmt="(I2)") n
455 fmtstr3 = "(T2,A,T16,3(1X,ES . ))"
456 WRITE (unit=fmtstr3(18:19), fmt="(I2)") n + 7
457 WRITE (unit=fmtstr3(21:22), fmt="(I2)") n
458 fmtstr4 = "(T2,A,T ,ES . )"
459 WRITE (unit=fmtstr4(8:9), fmt="(I2)") 3*(n + 8) + 18
460 WRITE (unit=fmtstr4(13:14), fmt="(I2)") n + 7
461 WRITE (unit=fmtstr4(16:17), fmt="(I2)") n
462 IF (PRESENT(zero_force_core_shell_atom)) THEN
463 zero_force = zero_force_core_shell_atom
464 ELSE
465 zero_force = .false.
466 END IF
467 fconv = cp_unit_from_cp2k(1.0_dp, trim(unit_string))
468 WRITE (unit=iw, fmt=fmtstr1) &
469 tag, label//" forces ["//trim(adjustl(unit_string))//"]", &
470 tag, "Atom", " x ", " y ", " z ", "|f|"
471 total_force(1:3) = 0.0_dp
472 DO iparticle = 1, particles%n_els
473 IF (particles%els(iparticle)%atom_index /= 0) THEN
474 i = particles%els(iparticle)%atom_index
475 ELSE
476 i = iparticle
477 END IF
478 IF (zero_force .AND. (particles%els(iparticle)%shell_index /= 0)) THEN
479 f(1:3) = 0.0_dp
480 ELSE
481 f(1:3) = particles%els(iparticle)%f(1:3)*fconv
482 END IF
483 WRITE (unit=iw, fmt=fmtstr2) &
484 tag, i, f(1:3), sqrt(sum(f(1:3)**2))
485 total_force(1:3) = total_force(1:3) + f(1:3)
486 END DO
487 WRITE (unit=iw, fmt=fmtstr3) &
488 tag//" Sum", total_force(1:3)
489 WRITE (unit=iw, fmt=fmtstr4) &
490 tag//" Total "//trim(adjustl(lc_label))//" force", &
491 sqrt(sum(total_force(1:3)**2))
492 END IF
493
494 IF (PRESENT(grand_total_force)) THEN
495 grand_total_force(1:3) = grand_total_force(1:3) + total_force(1:3)
496 WRITE (unit=iw, fmt="(A)") ""
497 WRITE (unit=iw, fmt=fmtstr4) &
498 tag//" Grand total force ["//trim(adjustl(unit_string))//"]", &
499 sqrt(sum(grand_total_force(1:3)**2))
500 END IF
501
502 END SUBROUTINE write_forces
503
504! **************************************************************************************************
505!> \brief Write the atomic coordinates, types, and energies
506!> \param iounit ...
507!> \param particles ...
508!> \param atener ...
509!> \param label ...
510!> \date 05.06.2023
511!> \author JGH
512!> \version 1.0
513! **************************************************************************************************
514 SUBROUTINE write_atener(iounit, particles, atener, label)
515
516 INTEGER, INTENT(IN) :: iounit
517 TYPE(particle_list_type), POINTER :: particles
518 REAL(kind=dp), DIMENSION(:), INTENT(IN) :: atener
519 CHARACTER(LEN=*), INTENT(IN) :: label
520
521 INTEGER :: i, natom
522
523 IF (iounit > 0) THEN
524 WRITE (unit=iounit, fmt="(/,T2,A)") trim(label)
525 WRITE (unit=iounit, fmt="(T4,A,T30,A,T42,A,T54,A,T69,A)") &
526 "Atom Element", "X", "Y", "Z", "Energy[a.u.]"
527 natom = particles%n_els
528 DO i = 1, natom
529 WRITE (iounit, "(I6,T12,A2,T24,3F12.6,F21.10)") i, &
530 trim(adjustl(particles%els(i)%atomic_kind%element_symbol)), &
531 particles%els(i)%r(1:3)*angstrom, atener(i)
532 END DO
533 WRITE (iounit, "(A)") ""
534 END IF
535
536 END SUBROUTINE write_atener
537
538END MODULE force_env_utils
represent a simple array based list of the given type
Handles all functions related to the CELL.
Definition cell_types.F:15
Contains routines useful for the application of constraints during MD.
subroutine, public getold(gci, local_molecules, molecule_set, molecule_kind_set, particle_set, cell)
saves all of the old variables
subroutine, public rattle_control(gci, local_molecules, molecule_set, molecule_kind_set, particle_set, vel, dt, rattle_tol, log_unit, lagrange_mult, dump_lm, cell, group, local_particles)
...
Definition constraint.F:229
subroutine, public shake_control(gci, local_molecules, molecule_set, molecule_kind_set, particle_set, pos, vel, dt, shake_tol, log_unit, lagrange_mult, dump_lm, cell, group, local_particles)
...
Definition constraint.F:101
types that represent a subsys, i.e. a part of the system
subroutine, public cp_subsys_get(subsys, ref_count, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell)
returns information about various attributes of the given subsys
unit conversion facility
Definition cp_units.F:30
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
Definition cp_units.F:1179
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
Interface for the force calculations.
recursive subroutine, public force_env_get(force_env, in_use, fist_env, qs_env, meta_env, fp_env, subsys, para_env, potential_energy, additional_potential, kinetic_energy, harmonic_shell, kinetic_shell, cell, sub_force_env, qmmm_env, qmmmx_env, eip_env, pwdft_env, globenv, input, force_env_section, method_name_id, root_section, mixed_env, nnp_env, embed_env, ipi_env)
returns various attributes about the force environment
Util force_env module.
subroutine, public write_forces(particles, iw, label, ndigits, unit_string, total_force, grand_total_force, zero_force_core_shell_atom)
Write forces.
subroutine, public force_env_shake(force_env, dt, shake_tol, log_unit, lagrange_mult, dump_lm, pos, vel, compold, reset)
perform shake (enforcing of constraints)
subroutine, public write_atener(iounit, particles, atener, label)
Write the atomic coordinates, types, and energies.
subroutine, public rescale_forces(force_env)
Rescale forces if requested.
subroutine, public force_env_rattle(force_env, dt, shake_tol, log_unit, lagrange_mult, dump_lm, vel, reset)
perform rattle (enforcing of constraints on velocities) This routine can be easily adapted to perform...
objects that represent the structure of input sections and the data contained in an input section
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_get(section_vals, ref_count, n_repetition, n_subs_vals_rep, section, explicit)
returns various attributes about the section_vals
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
represent a simple array based list of the given type
represent a simple array based list of the given type
Define the data structure for the molecule information.
represent a simple array based list of the given type
Define the data structure for the particle information.
subroutine, public update_particle_set(particle_set, int_group, pos, vel, for, add)
...
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public angstrom
Definition physcon.F:144
Utilities for string manipulations.
elemental subroutine, public lowercase(string)
Convert all upper case characters in a string to lower case.
Type defining parameters related to the simulation cell.
Definition cell_types.F:55
represents a system: atoms, molecules, their pos,vel,...
structure to store local (to a processor) ordered lists of integers.
wrapper to abstract the force evaluation of the various methods