(git:6344619)
Loading...
Searching...
No Matches
constraint.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \par History
10!> Teodoro Laino [tlaino] 2007 - Extension to Intermolecular constraints
11! **************************************************************************************************
15 USE cell_types, ONLY: cell_type
33 USE constraint_clv, ONLY: &
38 USE constraint_util, ONLY: check_tol,&
51 USE kinds, ONLY: default_string_length,&
52 dp
54 USE message_passing, ONLY: mp_comm_type,&
62 USE simpar_types, ONLY: simpar_type
63#include "./base/base_uses.f90"
64
65 IMPLICIT NONE
66
67 PRIVATE
68 PUBLIC :: shake_control, &
73
74 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'constraint'
75 INTEGER, PARAMETER, PRIVATE :: Max_Shake_Iter = 1000
76
77CONTAINS
78
79! **************************************************************************************************
80!> \brief ...
81!> \param gci ...
82!> \param local_molecules ...
83!> \param molecule_set ...
84!> \param molecule_kind_set ...
85!> \param particle_set ...
86!> \param pos ...
87!> \param vel ...
88!> \param dt ...
89!> \param shake_tol ...
90!> \param log_unit ...
91!> \param lagrange_mult ...
92!> \param dump_lm ...
93!> \param cell ...
94!> \param group ...
95!> \param local_particles ...
96!> \par History
97!> Teodoro Laino [tlaino] 2007 - Extension to Intermolecular constraints
98! **************************************************************************************************
99 SUBROUTINE shake_control(gci, local_molecules, molecule_set, molecule_kind_set, &
100 particle_set, pos, vel, dt, shake_tol, log_unit, lagrange_mult, dump_lm, &
101 cell, group, local_particles)
102
103 TYPE(global_constraint_type), POINTER :: gci
104 TYPE(distribution_1d_type), POINTER :: local_molecules
105 TYPE(molecule_type), POINTER :: molecule_set(:)
106 TYPE(molecule_kind_type), POINTER :: molecule_kind_set(:)
107 TYPE(particle_type), POINTER :: particle_set(:)
108 REAL(kind=dp), INTENT(INOUT) :: pos(:, :), vel(:, :)
109 REAL(kind=dp), INTENT(in) :: dt, shake_tol
110 INTEGER, INTENT(in) :: log_unit, lagrange_mult
111 LOGICAL, INTENT(IN) :: dump_lm
112 TYPE(cell_type), POINTER :: cell
113
114 CLASS(mp_comm_type), INTENT(in) :: group
115 TYPE(distribution_1d_type), POINTER :: local_particles
116
117 CHARACTER(LEN=*), PARAMETER :: routinen = 'shake_control'
118
119 INTEGER :: handle, i, ikind, imol, ishake_ext, &
120 ishake_int, k, n3x3con, n4x6con, &
121 nconstraint, nkind, nmol_per_kind, &
122 nvsitecon
123 LOGICAL :: do_ext_constraint
124 REAL(kind=dp) :: int_max_sigma, mass, max_sigma
125 REAL(kind=dp), DIMENSION(SIZE(pos, 2)) :: imass
126 TYPE(atomic_kind_type), POINTER :: atomic_kind
127 TYPE(colvar_counters) :: ncolv
128 TYPE(molecule_kind_type), POINTER :: molecule_kind
129 TYPE(molecule_type), POINTER :: molecule
130
131 CALL timeset(routinen, handle)
132 nkind = SIZE(molecule_kind_set)
133 DO k = 1, SIZE(pos, 2)
134 atomic_kind => particle_set(k)%atomic_kind
135 CALL get_atomic_kind(atomic_kind=atomic_kind, mass=mass)
136 imass(k) = 1.0_dp/max(mass, epsilon(0.0_dp))
137 END DO
138 do_ext_constraint = (gci%ntot /= 0)
139 ishake_ext = 0
140 max_sigma = -1.0e+10_dp
141 shake_inter_loop: DO WHILE ((abs(max_sigma) >= shake_tol) .AND. (ishake_ext <= max_shake_iter))
142 max_sigma = 0.0_dp
143 ishake_ext = ishake_ext + 1
144 ! Intramolecular Constraints
145 mol: DO ikind = 1, nkind
146 nmol_per_kind = local_molecules%n_el(ikind)
147 DO imol = 1, nmol_per_kind
148 i = local_molecules%list(ikind)%array(imol)
149 molecule => molecule_set(i)
150 molecule_kind => molecule%molecule_kind
151 CALL get_molecule_kind(molecule_kind, ncolv=ncolv, &
152 ng3x3=n3x3con, ng4x6=n4x6con, &
153 nconstraint=nconstraint, nvsite=nvsitecon)
154 IF (nconstraint == 0) cycle
155 ishake_int = merge(0, 1, ishake_ext == 1 .OR. .NOT. gci%joint_colvar_checks)
156 int_max_sigma = -1.0e+10_dp
157 shake_intra_loop: DO WHILE ((abs(int_max_sigma) >= shake_tol) .AND. (ishake_int <= max_shake_iter))
158 int_max_sigma = 0.0_dp
159 ishake_int = ishake_int + 1
160 ! 3x3
161 IF (n3x3con /= 0) THEN
162 CALL shake_3x3_int(molecule, particle_set, pos, vel, dt, ishake_int, &
163 int_max_sigma)
164 END IF
165 ! 4x6
166 IF (n4x6con /= 0) THEN
167 CALL shake_4x6_int(molecule, particle_set, pos, vel, dt, ishake_int, &
168 int_max_sigma)
169 END IF
170 ! Collective Variables
171 IF (ncolv%ntot /= 0) THEN
172 CALL shake_colv_int(molecule, particle_set, pos, vel, dt, ishake_int, &
173 cell, imass, int_max_sigma)
174 END IF
175 END DO shake_intra_loop
176 max_sigma = max(max_sigma, int_max_sigma)
177 CALL shake_int_info(log_unit, i, ishake_int, max_sigma)
178 ! Virtual Site
179 IF (nvsitecon /= 0) THEN
180 CALL shake_vsite_int(molecule, pos)
181 END IF
182 END DO
183 END DO mol
184 ! Intermolecular constraints
185 IF (do_ext_constraint) THEN
186 CALL update_temporary_set(group, pos=pos, vel=vel)
187 ! 3x3
188 IF (gci%ng3x3 /= 0) THEN
189 CALL shake_3x3_ext(gci, particle_set, pos, vel, dt, ishake_ext, &
190 max_sigma)
191 END IF
192 ! 4x6
193 IF (gci%ng4x6 /= 0) THEN
194 CALL shake_4x6_ext(gci, particle_set, pos, vel, dt, ishake_ext, &
195 max_sigma)
196 END IF
197 ! Collective Variables
198 IF (gci%ncolv%ntot /= 0) THEN
199 CALL shake_colv_ext(gci, particle_set, pos, vel, dt, ishake_ext, &
200 cell, imass, max_sigma)
201 END IF
202 ! Virtual Site
203 IF (gci%nvsite /= 0) THEN
204 CALL shake_vsite_ext(gci, pos)
205 END IF
206 IF (gci%joint_colvar_checks) THEN
207 CALL check_local_colvars(local_molecules, molecule_set, particle_set, cell, group, &
208 max_sigma, pos=pos)
209 END IF
210 CALL restore_temporary_set(particle_set, local_particles, pos=pos, vel=vel)
211 END IF
212 CALL shake_ext_info(log_unit, ishake_ext, max_sigma)
213 END DO shake_inter_loop
214 CALL dump_lagrange_mult(dump_lm, lagrange_mult, local_molecules, molecule_set, gci, &
215 molecule_kind_set, group, "S")
216
217 CALL timestop(handle)
218 END SUBROUTINE shake_control
219
220! **************************************************************************************************
221!> \brief ...
222!> \param gci ...
223!> \param local_molecules ...
224!> \param molecule_set ...
225!> \param molecule_kind_set ...
226!> \param particle_set ...
227!> \param vel ...
228!> \param dt ...
229!> \param rattle_tol ...
230!> \param log_unit ...
231!> \param lagrange_mult ...
232!> \param dump_lm ...
233!> \param cell ...
234!> \param group ...
235!> \param local_particles ...
236!> \par History
237!> Teodoro Laino [tlaino] 2007 - Extension to Intermolecular constraints
238! **************************************************************************************************
239 SUBROUTINE rattle_control(gci, local_molecules, molecule_set, molecule_kind_set, &
240 particle_set, vel, dt, rattle_tol, log_unit, lagrange_mult, dump_lm, cell, group, &
241 local_particles)
242
243 TYPE(global_constraint_type), POINTER :: gci
244 TYPE(distribution_1d_type), POINTER :: local_molecules
245 TYPE(molecule_type), POINTER :: molecule_set(:)
246 TYPE(molecule_kind_type), POINTER :: molecule_kind_set(:)
247 TYPE(particle_type), POINTER :: particle_set(:)
248 REAL(kind=dp), INTENT(INOUT) :: vel(:, :)
249 REAL(kind=dp), INTENT(in) :: dt, rattle_tol
250 INTEGER, INTENT(in) :: log_unit, lagrange_mult
251 LOGICAL, INTENT(IN) :: dump_lm
252 TYPE(cell_type), POINTER :: cell
253
254 CLASS(mp_comm_type), INTENT(in) :: group
255 TYPE(distribution_1d_type), POINTER :: local_particles
256
257 CHARACTER(LEN=*), PARAMETER :: routinen = 'rattle_control'
258
259 INTEGER :: handle, i, ikind, imol, irattle_ext, &
260 irattle_int, k, n3x3con, n4x6con, &
261 nconstraint, nkind, nmol_per_kind
262 LOGICAL :: do_ext_constraint
263 REAL(kind=dp) :: int_max_sigma, mass, max_sigma
264 REAL(kind=dp), DIMENSION(SIZE(vel, 2)) :: imass
265 TYPE(atomic_kind_type), POINTER :: atomic_kind
266 TYPE(colvar_counters) :: ncolv
267 TYPE(molecule_kind_type), POINTER :: molecule_kind
268 TYPE(molecule_type), POINTER :: molecule
269
270 CALL timeset(routinen, handle)
271 nkind = SIZE(molecule_kind_set)
272 DO k = 1, SIZE(vel, 2)
273 atomic_kind => particle_set(k)%atomic_kind
274 CALL get_atomic_kind(atomic_kind=atomic_kind, mass=mass)
275 imass(k) = 1.0_dp/max(mass, epsilon(0.0_dp))
276 END DO
277 do_ext_constraint = (gci%ntot /= 0)
278 irattle_ext = 0
279 max_sigma = -1.0e+10_dp
280 rattle_inter_loop: DO WHILE (abs(max_sigma) >= rattle_tol)
281 max_sigma = 0.0_dp
282 irattle_ext = irattle_ext + 1
283 ! Intramolecular Constraints
284 mol: DO ikind = 1, nkind
285 nmol_per_kind = local_molecules%n_el(ikind)
286 DO imol = 1, nmol_per_kind
287 i = local_molecules%list(ikind)%array(imol)
288 molecule => molecule_set(i)
289 molecule_kind => molecule%molecule_kind
290 CALL get_molecule_kind(molecule_kind, ncolv=ncolv, ng3x3=n3x3con, &
291 ng4x6=n4x6con, nconstraint=nconstraint)
292 IF (nconstraint == 0) cycle
293 irattle_int = merge(0, 1, irattle_ext == 1 .OR. .NOT. gci%joint_colvar_checks)
294 int_max_sigma = -1.0e+10_dp
295 rattle_intra_loop: DO WHILE (abs(int_max_sigma) >= rattle_tol)
296 int_max_sigma = 0.0_dp
297 irattle_int = irattle_int + 1
298 ! 3x3
299 IF (n3x3con /= 0) THEN
300 CALL rattle_3x3_int(molecule, particle_set, vel, dt)
301 END IF
302 ! 4x6
303 IF (n4x6con /= 0) THEN
304 CALL rattle_4x6_int(molecule, particle_set, vel, dt)
305 END IF
306 ! Collective Variables
307 IF (ncolv%ntot /= 0) THEN
308 CALL rattle_colv_int(molecule, particle_set, vel, dt, &
309 irattle_int, cell, imass, int_max_sigma)
310 END IF
311 END DO rattle_intra_loop
312 max_sigma = max(max_sigma, int_max_sigma)
313 CALL rattle_int_info(log_unit, i, irattle_int, max_sigma)
314 END DO
315 END DO mol
316 ! Intermolecular Constraints
317 IF (do_ext_constraint) THEN
318 CALL update_temporary_set(group, vel=vel)
319 ! 3x3
320 IF (gci%ng3x3 /= 0) THEN
321 CALL rattle_3x3_ext(gci, particle_set, vel, dt)
322 END IF
323 ! 4x6
324 IF (gci%ng4x6 /= 0) THEN
325 CALL rattle_4x6_ext(gci, particle_set, vel, dt)
326 END IF
327 ! Collective Variables
328 IF (gci%ncolv%ntot /= 0) THEN
329 CALL rattle_colv_ext(gci, particle_set, vel, dt, &
330 irattle_ext, cell, imass, max_sigma)
331 END IF
332 IF (gci%joint_colvar_checks) THEN
333 CALL check_local_colvars(local_molecules, molecule_set, particle_set, cell, group, &
334 max_sigma, vel=vel)
335 END IF
336 CALL restore_temporary_set(particle_set, local_particles, vel=vel)
337 END IF
338 CALL rattle_ext_info(log_unit, irattle_ext, max_sigma)
339 END DO rattle_inter_loop
340 CALL dump_lagrange_mult(dump_lm, lagrange_mult, local_molecules, molecule_set, gci, &
341 molecule_kind_set, group, "R")
342 CALL timestop(handle)
343
344 END SUBROUTINE rattle_control
345
346! **************************************************************************************************
347!> \brief ...
348!> \param gci ...
349!> \param local_molecules ...
350!> \param molecule_set ...
351!> \param molecule_kind_set ...
352!> \param particle_set ...
353!> \param pos ...
354!> \param vel ...
355!> \param dt ...
356!> \param simpar ...
357!> \param roll_tol ...
358!> \param iroll ...
359!> \param vector_r ...
360!> \param vector_v ...
361!> \param group ...
362!> \param u ...
363!> \param cell ...
364!> \param local_particles ...
365!> \par History
366!> Teodoro Laino [tlaino] 2007 - Extension to Intermolecular constraints
367! **************************************************************************************************
368 SUBROUTINE shake_roll_control(gci, local_molecules, molecule_set, &
369 molecule_kind_set, particle_set, pos, vel, dt, simpar, roll_tol, iroll, &
370 vector_r, vector_v, group, u, cell, local_particles)
371
372 TYPE(global_constraint_type), POINTER :: gci
373 TYPE(distribution_1d_type), POINTER :: local_molecules
374 TYPE(molecule_type), POINTER :: molecule_set(:)
375 TYPE(molecule_kind_type), POINTER :: molecule_kind_set(:)
376 TYPE(particle_type), POINTER :: particle_set(:)
377 REAL(kind=dp), INTENT(INOUT) :: pos(:, :), vel(:, :)
378 REAL(kind=dp), INTENT(IN) :: dt
379 TYPE(simpar_type), INTENT(IN) :: simpar
380 REAL(kind=dp), INTENT(OUT) :: roll_tol
381 INTEGER, INTENT(INOUT) :: iroll
382 REAL(kind=dp), DIMENSION(:), INTENT(IN) :: vector_r, vector_v
383
384 CLASS(mp_comm_type), INTENT(IN) :: group
385 REAL(kind=dp), DIMENSION(:, :), INTENT(IN), &
386 OPTIONAL :: u
387 TYPE(cell_type), POINTER :: cell
388 TYPE(distribution_1d_type), POINTER :: local_particles
389
390 CHARACTER(LEN=*), PARAMETER :: routinen = 'shake_roll_control'
391
392 INTEGER :: handle, i, ikind, imol, ishake_ext, ishake_int, k, lagrange_mult, log_unit, &
393 n3x3con, n4x6con, nconstraint, nkind, nmol_per_kind, nvsitecon
394 LOGICAL :: do_ext_constraint, dump_lm
395 REAL(kind=dp) :: int_max_sigma, mass, max_sigma, shake_tol
396 REAL(kind=dp), DIMENSION(3, 3) :: r_shake, v_shake
397 REAL(kind=dp), DIMENSION(SIZE(pos, 2)) :: imass
398 TYPE(atomic_kind_type), POINTER :: atomic_kind
399 TYPE(colvar_counters) :: ncolv
400 TYPE(molecule_kind_type), POINTER :: molecule_kind
401 TYPE(molecule_type), POINTER :: molecule
402
403 CALL timeset(routinen, handle)
404 nkind = SIZE(molecule_kind_set)
405 shake_tol = simpar%shake_tol
406 log_unit = simpar%info_constraint
407 lagrange_mult = simpar%lagrange_multipliers
408 dump_lm = simpar%dump_lm
409 ! setting up for roll
410 IF (simpar%ensemble == npt_i_ensemble .OR. simpar%ensemble == npt_ia_ensemble) THEN
411 CALL get_roll_matrix('SHAKE', r_shake, v_shake, vector_r, vector_v)
412 ELSE IF (simpar%ensemble == npt_f_ensemble) THEN
413 CALL get_roll_matrix('SHAKE', r_shake, v_shake, vector_r, vector_v, u)
414 END IF
415 DO k = 1, SIZE(pos, 2)
416 atomic_kind => particle_set(k)%atomic_kind
417 CALL get_atomic_kind(atomic_kind=atomic_kind, mass=mass)
418 imass(k) = 1.0_dp/max(mass, epsilon(0.0_dp))
419 END DO
420 do_ext_constraint = (gci%ntot /= 0)
421 ishake_ext = 0
422 max_sigma = -1.0e+10_dp
423 shake_inter_loop: DO WHILE (abs(max_sigma) >= shake_tol)
424 max_sigma = 0.0_dp
425 ishake_ext = ishake_ext + 1
426 ! Intramolecular Constraints
427 mol: DO ikind = 1, nkind
428 nmol_per_kind = local_molecules%n_el(ikind)
429 DO imol = 1, nmol_per_kind
430 i = local_molecules%list(ikind)%array(imol)
431 molecule => molecule_set(i)
432 molecule_kind => molecule%molecule_kind
433 CALL get_molecule_kind(molecule_kind, ncolv=ncolv, &
434 ng3x3=n3x3con, ng4x6=n4x6con, &
435 nconstraint=nconstraint, nvsite=nvsitecon)
436 IF (nconstraint == 0) cycle
437 ishake_int = merge(0, 1, ishake_ext == 1 .OR. .NOT. gci%joint_colvar_checks)
438 int_max_sigma = -1.0e+10_dp
439 shake_roll_intra_loop: DO WHILE (abs(int_max_sigma) >= shake_tol)
440 int_max_sigma = 0.0_dp
441 ishake_int = ishake_int + 1
442 ! 3x3
443 IF (n3x3con /= 0) THEN
444 CALL shake_roll_3x3_int(molecule, particle_set, pos, vel, r_shake, &
445 v_shake, dt, ishake_int, int_max_sigma)
446 END IF
447 ! 4x6
448 IF (n4x6con /= 0) THEN
449 CALL shake_roll_4x6_int(molecule, particle_set, pos, vel, r_shake, &
450 dt, ishake_int, int_max_sigma)
451 END IF
452 ! Collective Variables
453 IF (ncolv%ntot /= 0) THEN
454 CALL shake_roll_colv_int(molecule, particle_set, pos, vel, r_shake, &
455 v_shake, dt, ishake_int, cell, imass, int_max_sigma)
456 END IF
457 END DO shake_roll_intra_loop
458 max_sigma = max(max_sigma, int_max_sigma)
459 CALL shake_int_info(log_unit, i, ishake_int, max_sigma)
460 ! Virtual Site
461 IF (nvsitecon /= 0) THEN
462 cpabort("Virtual Site Constraint/Restraint not implemented for SHAKE_ROLL!")
463 END IF
464 END DO
465 END DO mol
466 ! Intermolecular constraints
467 IF (do_ext_constraint) THEN
468 CALL update_temporary_set(group, pos=pos, vel=vel)
469 ! 3x3
470 IF (gci%ng3x3 /= 0) THEN
471 CALL shake_roll_3x3_ext(gci, particle_set, pos, vel, r_shake, &
472 v_shake, dt, ishake_ext, max_sigma)
473 END IF
474 ! 4x6
475 IF (gci%ng4x6 /= 0) THEN
476 CALL shake_roll_4x6_ext(gci, particle_set, pos, vel, r_shake, &
477 dt, ishake_ext, max_sigma)
478 END IF
479 ! Collective Variables
480 IF (gci%ncolv%ntot /= 0) THEN
481 CALL shake_roll_colv_ext(gci, particle_set, pos, vel, r_shake, &
482 v_shake, dt, ishake_ext, cell, imass, max_sigma)
483 END IF
484 ! Virtual Site
485 IF (gci%nvsite /= 0) THEN
486 cpabort("Virtual Site Constraint/Restraint not implemented for SHAKE_ROLL!")
487 END IF
488 IF (gci%joint_colvar_checks) THEN
489 CALL check_local_colvars(local_molecules, molecule_set, particle_set, cell, group, &
490 max_sigma, pos=pos)
491 END IF
492 CALL restore_temporary_set(particle_set, local_particles, pos=pos, vel=vel)
493 END IF
494 CALL shake_ext_info(log_unit, ishake_ext, max_sigma)
495 END DO shake_inter_loop
496 CALL dump_lagrange_mult(dump_lm, lagrange_mult, local_molecules, molecule_set, gci, &
497 molecule_kind_set, group, "S")
498 CALL check_tol(roll_tol, iroll, 'SHAKE', r_shake)
499 CALL timestop(handle)
500
501 END SUBROUTINE shake_roll_control
502
503! **************************************************************************************************
504!> \brief ...
505!> \param gci ...
506!> \param local_molecules ...
507!> \param molecule_set ...
508!> \param molecule_kind_set ...
509!> \param particle_set ...
510!> \param vel ...
511!> \param dt ...
512!> \param simpar ...
513!> \param vector ...
514!> \param veps ...
515!> \param roll_tol ...
516!> \param iroll ...
517!> \param para_env ...
518!> \param u ...
519!> \param cell ...
520!> \param local_particles ...
521!> \par History
522!> Teodoro Laino [tlaino] 2007 - Extension to Intermolecular constraints
523! **************************************************************************************************
524 SUBROUTINE rattle_roll_control(gci, local_molecules, molecule_set, &
525 molecule_kind_set, particle_set, vel, dt, simpar, vector, &
526 veps, roll_tol, iroll, para_env, u, cell, local_particles)
527
528 TYPE(global_constraint_type), POINTER :: gci
529 TYPE(distribution_1d_type), POINTER :: local_molecules
530 TYPE(molecule_type), POINTER :: molecule_set(:)
531 TYPE(molecule_kind_type), POINTER :: molecule_kind_set(:)
532 TYPE(particle_type), POINTER :: particle_set(:)
533 REAL(kind=dp), INTENT(INOUT) :: vel(:, :)
534 REAL(kind=dp), INTENT(IN) :: dt
535 TYPE(simpar_type), INTENT(IN) :: simpar
536 REAL(kind=dp), DIMENSION(:), INTENT(IN) :: vector
537 REAL(kind=dp), DIMENSION(:, :), INTENT(INOUT) :: veps
538 REAL(kind=dp), INTENT(OUT) :: roll_tol
539 INTEGER, INTENT(INOUT) :: iroll
540 TYPE(mp_para_env_type), INTENT(IN) :: para_env
541 REAL(kind=dp), DIMENSION(:, :), INTENT(IN), &
542 OPTIONAL :: u
543 TYPE(cell_type), POINTER :: cell
544 TYPE(distribution_1d_type), POINTER :: local_particles
545
546 CHARACTER(LEN=*), PARAMETER :: routinen = 'rattle_roll_control'
547
548 INTEGER :: handle, i, ikind, imol, irattle_ext, irattle_int, k, lagrange_mult, log_unit, &
549 n3x3con, n4x6con, nconstraint, nkind, nmol_per_kind
550 LOGICAL :: do_ext_constraint, dump_lm
551 REAL(kind=dp) :: int_max_sigma, mass, max_sigma, &
552 rattle_tol
553 REAL(kind=dp), DIMENSION(3, 3) :: r_rattle
554 REAL(kind=dp), DIMENSION(SIZE(vel, 2)) :: imass
555 TYPE(atomic_kind_type), POINTER :: atomic_kind
556 TYPE(colvar_counters) :: ncolv
557 TYPE(molecule_kind_type), POINTER :: molecule_kind
558 TYPE(molecule_type), POINTER :: molecule
559
560 CALL timeset(routinen, handle)
561 ! initialize locals
562 nkind = SIZE(molecule_kind_set)
563 rattle_tol = simpar%shake_tol
564 log_unit = simpar%info_constraint
565 lagrange_mult = simpar%lagrange_multipliers
566 dump_lm = simpar%dump_lm
567 ! setting up for roll
568 IF (simpar%ensemble == npt_i_ensemble .OR. simpar%ensemble == npt_ia_ensemble) THEN
569 CALL get_roll_matrix('RATTLE', v_shake=r_rattle, vector_v=vector)
570 ELSE IF (simpar%ensemble == npt_f_ensemble) THEN
571 CALL get_roll_matrix('RATTLE', v_shake=r_rattle, vector_v=vector, u=u)
572 END IF
573 DO k = 1, SIZE(vel, 2)
574 atomic_kind => particle_set(k)%atomic_kind
575 CALL get_atomic_kind(atomic_kind=atomic_kind, mass=mass)
576 imass(k) = 1.0_dp/max(mass, epsilon(0.0_dp))
577 END DO
578 do_ext_constraint = (gci%ntot /= 0)
579 irattle_ext = 0
580 max_sigma = -1.0e+10_dp
581 rattle_inter_loop: DO WHILE (abs(max_sigma) >= rattle_tol)
582 max_sigma = 0.0_dp
583 irattle_ext = irattle_ext + 1
584 ! Intramolecular Constraints
585 mol: DO ikind = 1, nkind
586 nmol_per_kind = local_molecules%n_el(ikind)
587 DO imol = 1, nmol_per_kind
588 i = local_molecules%list(ikind)%array(imol)
589 molecule => molecule_set(i)
590 molecule_kind => molecule%molecule_kind
591 CALL get_molecule_kind(molecule_kind, ncolv=ncolv, &
592 ng3x3=n3x3con, ng4x6=n4x6con, &
593 nconstraint=nconstraint)
594 IF (nconstraint == 0) cycle
595 int_max_sigma = -1.0e+10_dp
596 irattle_int = merge(0, 1, irattle_ext == 1 .OR. .NOT. gci%joint_colvar_checks)
597 rattle_roll_intramolecular: DO WHILE (abs(int_max_sigma) >= rattle_tol)
598 int_max_sigma = 0.0_dp
599 irattle_int = irattle_int + 1
600 ! 3x3
601 IF (n3x3con /= 0) THEN
602 CALL rattle_roll_3x3_int(molecule, particle_set, vel, r_rattle, dt, &
603 veps)
604 END IF
605 ! 4x6
606 IF (n4x6con /= 0) THEN
607 CALL rattle_roll_4x6_int(molecule, particle_set, vel, r_rattle, dt, &
608 veps)
609 END IF
610 ! Collective Variables
611 IF (ncolv%ntot /= 0) THEN
612 CALL rattle_roll_colv_int(molecule, particle_set, vel, r_rattle, dt, &
613 irattle_int, veps, cell, imass, int_max_sigma)
614 END IF
615 END DO rattle_roll_intramolecular
616 max_sigma = max(max_sigma, int_max_sigma)
617 CALL rattle_int_info(log_unit, i, irattle_int, max_sigma)
618 END DO
619 END DO mol
620 ! Intermolecular Constraints
621 IF (do_ext_constraint) THEN
622 CALL update_temporary_set(para_env, vel=vel)
623 ! 3x3
624 IF (gci%ng3x3 /= 0) THEN
625 CALL rattle_roll_3x3_ext(gci, particle_set, vel, r_rattle, dt, &
626 veps)
627 END IF
628 ! 4x6
629 IF (gci%ng4x6 /= 0) THEN
630 CALL rattle_roll_4x6_ext(gci, particle_set, vel, r_rattle, dt, &
631 veps)
632 END IF
633 ! Collective Variables
634 IF (gci%ncolv%ntot /= 0) THEN
635 CALL rattle_roll_colv_ext(gci, particle_set, vel, r_rattle, dt, &
636 irattle_ext, veps, cell, imass, max_sigma)
637 END IF
638 IF (gci%joint_colvar_checks) THEN
639 CALL check_local_colvars(local_molecules, molecule_set, particle_set, cell, para_env, &
640 max_sigma, vel=vel, rmat=r_rattle, veps=veps)
641 END IF
642 CALL restore_temporary_set(particle_set, local_particles, vel=vel)
643 END IF
644 CALL rattle_ext_info(log_unit, irattle_ext, max_sigma)
645 END DO rattle_inter_loop
646 CALL dump_lagrange_mult(dump_lm, lagrange_mult, local_molecules, molecule_set, gci, &
647 molecule_kind_set, para_env, "R")
648 CALL check_tol(roll_tol, iroll, 'RATTLE', veps=veps)
649 CALL timestop(handle)
650 END SUBROUTINE rattle_roll_control
651
652! **************************************************************************************************
653!> \brief Recheck local collective variables after global constraint corrections.
654!> \param local_molecules ...
655!> \param molecule_set ...
656!> \param particle_set ...
657!> \param cell ...
658!> \param group ...
659!> \param max_sigma ...
660!> \param pos ...
661!> \param vel ...
662!> \param rmat ...
663!> \param veps ...
664! **************************************************************************************************
665 SUBROUTINE check_local_colvars(local_molecules, molecule_set, particle_set, cell, group, &
666 max_sigma, pos, vel, rmat, veps)
667 TYPE(distribution_1d_type), POINTER :: local_molecules
668 TYPE(molecule_type), POINTER :: molecule_set(:)
669 TYPE(particle_type), POINTER :: particle_set(:)
670 TYPE(cell_type), POINTER :: cell
671
672 CLASS(mp_comm_type), INTENT(IN) :: group
673 REAL(kind=dp), INTENT(INOUT) :: max_sigma
674 REAL(kind=dp), INTENT(IN), OPTIONAL :: pos(:, :), vel(:, :), rmat(:, :), veps(:, :)
675
676 INTEGER :: ikind, imol, i
677 TYPE(molecule_type), POINTER :: molecule
678
679 ! Global corrections can invalidate already-converged local collective variables.
680 DO ikind = 1, SIZE(local_molecules%n_el)
681 DO imol = 1, local_molecules%n_el(ikind)
682 i = local_molecules%list(ikind)%array(imol)
683 molecule => molecule_set(i)
684 CALL check_colv_int(molecule, particle_set, cell, max_sigma, pos=pos, vel=vel, &
685 rmat=rmat, veps=veps)
686 END DO
687 END DO
688 CALL group%max(max_sigma)
689 END SUBROUTINE check_local_colvars
690
691! **************************************************************************************************
692!> \brief ...
693!> \param dump_lm ...
694!> \param log_unit ...
695!> \param local_molecules ...
696!> \param molecule_set ...
697!> \param gci ...
698!> \param molecule_kind_set ...
699!> \param group ...
700!> \param id_type ...
701!> \par History
702!> Teodoro Laino [tlaino] 2007 - Dumps lagrange multipliers
703! **************************************************************************************************
704 SUBROUTINE dump_lagrange_mult(dump_lm, log_unit, local_molecules, molecule_set, gci, &
705 molecule_kind_set, group, id_type)
706 LOGICAL, INTENT(IN) :: dump_lm
707 INTEGER, INTENT(IN) :: log_unit
708 TYPE(distribution_1d_type), POINTER :: local_molecules
709 TYPE(molecule_type), POINTER :: molecule_set(:)
710 TYPE(global_constraint_type), POINTER :: gci
711 TYPE(molecule_kind_type), POINTER :: molecule_kind_set(:)
712
713 CLASS(mp_comm_type), INTENT(IN) :: group
714 CHARACTER(LEN=1), INTENT(IN) :: id_type
715
716 CHARACTER(LEN=*), PARAMETER :: routinen = 'dump_lagrange_mult'
717
718 CHARACTER(LEN=default_string_length) :: label
719 INTEGER :: handle, i, ikind, imol, j, my_index, &
720 n3x3con, n4x6con, nconstraint, nkind
721 LOGICAL :: do_ext_constraint, do_int_constraint
722 REAL(kind=dp), DIMENSION(:), POINTER :: lagr
723 TYPE(colvar_counters) :: ncolv
724 TYPE(molecule_kind_type), POINTER :: molecule_kind
725 TYPE(molecule_type), POINTER :: molecule
726
727 CALL timeset(routinen, handle)
728 ! Total number of intramolecular constraints (distributed)
729 CALL get_molecule_kind_set(molecule_kind_set=molecule_kind_set, &
730 nconstraint=nconstraint)
731 do_int_constraint = (nconstraint > 0)
732 do_ext_constraint = (gci%ntot > 0)
733 IF (dump_lm .AND. (do_int_constraint .OR. do_ext_constraint)) THEN
734 nkind = SIZE(molecule_kind_set)
735 ALLOCATE (lagr(nconstraint))
736 lagr = 0.0_dp
737 ! Dump lagrange multipliers for Intramolecular Constraints
738 my_index = 0
739 IF (do_int_constraint) THEN
740 mol: DO ikind = 1, nkind
741 molecule_kind => molecule_kind_set(ikind)
742 CALL get_molecule_kind(molecule_kind, &
743 ncolv=ncolv, &
744 ng3x3=n3x3con, &
745 ng4x6=n4x6con)
746 DO imol = 1, molecule_kind%nmolecule
747 i = molecule_kind%molecule_list(imol)
748 IF (any(local_molecules%list(ikind)%array == i)) THEN
749 molecule => molecule_set(i)
750 ! Collective Variables
751 DO j = 1, ncolv%ntot
752 lagr(my_index + 1) = molecule%lci%lcolv(j)%lambda
753 my_index = my_index + 1
754 END DO
755 ! 3x3
756 DO j = 1, n3x3con
757 lagr(my_index + 1:my_index + 3) = molecule%lci%lg3x3(j)%lambda(:)
758 my_index = my_index + 3
759 END DO
760 ! 4x6
761 DO j = 1, n4x6con
762 lagr(my_index + 1:my_index + 6) = molecule%lci%lg4x6(j)%lambda(:)
763 my_index = my_index + 6
764 END DO
765 ELSE
766 my_index = my_index + ncolv%ntot + 3*n3x3con + 6*n4x6con
767 END IF
768 END DO
769 END DO mol
770 CALL group%sum(lagr)
771 END IF
772 ! Intermolecular constraints
773 IF (do_ext_constraint) THEN
774 CALL reallocate(lagr, 1, SIZE(lagr) + gci%ntot)
775 ! Collective Variables
776 DO j = 1, gci%ncolv%ntot
777 lagr(my_index + 1) = gci%lcolv(j)%lambda
778 my_index = my_index + 1
779 END DO
780 ! 3x3
781 DO j = 1, gci%ng3x3
782 lagr(my_index + 1:my_index + 3) = gci%lg3x3(j)%lambda(:)
783 my_index = my_index + 3
784 END DO
785 ! 4x6
786 DO j = 1, gci%ng4x6
787 lagr(my_index + 1:my_index + 6) = gci%lg4x6(j)%lambda(:)
788 my_index = my_index + 6
789 END DO
790 END IF
791 IF (log_unit > 0) THEN
792 IF (id_type == "S") THEN
793 label = "Shake Lagrangian Multipliers:"
794 ELSE IF (id_type == "R") THEN
795 label = "Rattle Lagrangian Multipliers:"
796 ELSE
797 cpabort("Only S for Shake or R for Rattle are supported for Lagrangian Multipliers")
798 END IF
799 WRITE (log_unit, fmt='(A,T40,4F15.9)') trim(label), lagr(1:min(4, SIZE(lagr)))
800 DO j = 5, SIZE(lagr), 4
801 WRITE (log_unit, fmt='(T40,4F15.9)') lagr(j:min(j + 3, SIZE(lagr)))
802 END DO
803 END IF
804 DEALLOCATE (lagr)
805 END IF
806 CALL timestop(handle)
807
808 END SUBROUTINE dump_lagrange_mult
809
810! **************************************************************************************************
811!> \brief Dumps convergence info about shake - intramolecular constraint loop
812!> \param log_unit ...
813!> \param i ...
814!> \param ishake_int ...
815!> \param max_sigma ...
816!> \par History
817!> Teodoro Laino [tlaino] 2007 - University of Zurich
818! **************************************************************************************************
819 SUBROUTINE shake_int_info(log_unit, i, ishake_int, max_sigma)
820 INTEGER, INTENT(IN) :: log_unit, i, ishake_int
821 REAL(kind=dp), INTENT(IN) :: max_sigma
822
823 IF (log_unit > 0) THEN
824 ! Dump info if requested
825 WRITE (log_unit, '("SHAKE_INFO|",2X,2(A,I6),A,F15.9)') &
826 "Molecule Nr.:", i, " Nr. Iterations:", ishake_int, " Max. Err.:", max_sigma
827 END IF
828 ! Notify a not converged SHAKE
829 IF (ishake_int > max_shake_iter) THEN
830 CALL cp_warn(__location__, &
831 "Shake NOT converged in "//cp_to_string(max_shake_iter)//" iterations in the "// &
832 "intramolecular constraint loop for Molecule nr. "//cp_to_string(i)// &
833 ". CP2K continues but results could be meaningless. ")
834 END IF
835 END SUBROUTINE shake_int_info
836
837! **************************************************************************************************
838!> \brief Dumps convergence info about shake - intermolecular constraint loop
839!> \param log_unit ...
840!> \param ishake_ext ...
841!> \param max_sigma ...
842!> \par History
843!> Teodoro Laino [tlaino] 2007 - University of Zurich
844! **************************************************************************************************
845 SUBROUTINE shake_ext_info(log_unit, ishake_ext, max_sigma)
846 INTEGER, INTENT(IN) :: log_unit, ishake_ext
847 REAL(kind=dp), INTENT(IN) :: max_sigma
848
849 IF (log_unit > 0) THEN
850 ! Dump info if requested
851 WRITE (log_unit, '("SHAKE_INFO|",2X,A,I6,A,F15.9)') &
852 "External Shake Nr. Iterations:", ishake_ext, &
853 " Max. Err.:", max_sigma
854 END IF
855 ! Notify a not converged SHAKE
856 IF (ishake_ext > max_shake_iter) THEN
857 CALL cp_warn(__location__, &
858 "Shake NOT converged in "//cp_to_string(max_shake_iter)//" iterations in the "// &
859 "intermolecular constraint. CP2K continues but results could be meaningless.")
860 END IF
861 END SUBROUTINE shake_ext_info
862
863! **************************************************************************************************
864!> \brief Dumps convergence info about rattle - intramolecular constraint loop
865!> \param log_unit ...
866!> \param i ...
867!> \param irattle_int ...
868!> \param max_sigma ...
869!> \par History
870!> Teodoro Laino [tlaino] 2007 - University of Zurich
871! **************************************************************************************************
872 SUBROUTINE rattle_int_info(log_unit, i, irattle_int, max_sigma)
873 INTEGER, INTENT(IN) :: log_unit, i, irattle_int
874 REAL(kind=dp), INTENT(IN) :: max_sigma
875
876 IF (log_unit > 0) THEN
877 ! Dump info if requested
878 WRITE (log_unit, '("RATTLE_INFO|",1X,2(A,I6),A,F15.9)') &
879 "Molecule Nr.:", i, " Nr. Iterations:", irattle_int, " Max. Err.:", max_sigma
880 END IF
881 ! Notify a not converged RATTLE
882 IF (irattle_int > max_shake_iter) THEN
883 CALL cp_warn(__location__, &
884 "Rattle NOT converged in "//cp_to_string(max_shake_iter)//" iterations in the "// &
885 "intramolecular constraint loop for Molecule nr. "//cp_to_string(i)// &
886 ". CP2K continues but results could be meaningless.")
887 END IF
888 END SUBROUTINE rattle_int_info
889
890! **************************************************************************************************
891!> \brief Dumps convergence info about rattle - intermolecular constraint loop
892!> \param log_unit ...
893!> \param irattle_ext ...
894!> \param max_sigma ...
895!> \par History
896!> Teodoro Laino [tlaino] 2007 - University of Zurich
897! **************************************************************************************************
898 SUBROUTINE rattle_ext_info(log_unit, irattle_ext, max_sigma)
899 INTEGER, INTENT(IN) :: log_unit, irattle_ext
900 REAL(kind=dp), INTENT(IN) :: max_sigma
901
902 IF (log_unit > 0) THEN
903 ! Dump info if requested
904 WRITE (log_unit, '("RATTLE_INFO|",1X,A,I6,A,F15.9)') &
905 "External Rattle Nr. Iterations:", irattle_ext, &
906 " Max. Err.:", max_sigma
907 END IF
908 ! Notify a not converged RATTLE
909 IF (irattle_ext > max_shake_iter) THEN
910 CALL cp_warn(__location__, &
911 "Rattle NOT converged in "//cp_to_string(max_shake_iter)//" iterations in the "// &
912 "intermolecular constraint. CP2K continues but results could be meaningless.")
913 END IF
914 END SUBROUTINE rattle_ext_info
915
916! **************************************************************************************************
917!> \brief Updates the TARGET of the COLLECTIVE constraints if the growth speed
918!> is different from zero.
919!> \param gci ...
920!> \param local_molecules ...
921!> \param molecule_set ...
922!> \param molecule_kind_set ...
923!> \param dt ...
924!> \param root_section ...
925!> \date 02.2008
926!> \author Teodoro Laino [tlaino] - University of Zurich
927! **************************************************************************************************
928 SUBROUTINE shake_update_targets(gci, local_molecules, molecule_set, &
929 molecule_kind_set, dt, root_section)
930
931 TYPE(global_constraint_type), POINTER :: gci
932 TYPE(distribution_1d_type), POINTER :: local_molecules
933 TYPE(molecule_type), POINTER :: molecule_set(:)
934 TYPE(molecule_kind_type), POINTER :: molecule_kind_set(:)
935 REAL(kind=dp), INTENT(in) :: dt
936 TYPE(section_vals_type), POINTER :: root_section
937
938 CHARACTER(LEN=*), PARAMETER :: routinen = 'shake_update_targets'
939
940 INTEGER :: handle, ikind, nkind
941 LOGICAL :: do_ext_constraint
942 TYPE(section_vals_type), POINTER :: motion_section
943
944 CALL timeset(routinen, handle)
945 cpassert(ASSOCIATED(local_molecules))
946 cpassert(ASSOCIATED(molecule_set))
947 motion_section => section_vals_get_subs_vals(root_section, "MOTION")
948 CALL shake_update_colv_targets(dt, motion_section)
949 nkind = SIZE(molecule_kind_set)
950 do_ext_constraint = (gci%ntot /= 0)
951 ! Intramolecular Constraints
952 mol: DO ikind = 1, nkind
953 IF (ASSOCIATED(molecule_kind_set(ikind)%colv_list)) THEN
954 CALL shake_update_colv_low(molecule_kind_set(ikind)%colv_list, dt, motion_section)
955 END IF
956 END DO mol
957 ! Intermolecular constraints
958 IF (do_ext_constraint) THEN
959 ! Collective Variables
960 IF (gci%ncolv%ntot /= 0) CALL shake_update_colv_ext(gci, dt, motion_section)
961 END IF
962 CALL timestop(handle)
963 END SUBROUTINE shake_update_targets
964
965END MODULE constraint
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
Handles all functions related to the CELL.
Definition cell_types.F:15
Initialize the collective variables types.
subroutine, public shake_3x3_ext(gci, particle_set, pos, vel, dt, ishake, max_sigma)
...
subroutine, public rattle_roll_3x3_ext(gci, particle_set, vel, r_rattle, dt, veps)
...
subroutine, public shake_roll_3x3_int(molecule, particle_set, pos, vel, r_shake, v_shake, dt, ishake, max_sigma)
...
subroutine, public rattle_3x3_int(molecule, particle_set, vel, dt)
...
subroutine, public shake_3x3_int(molecule, particle_set, pos, vel, dt, ishake, max_sigma)
...
subroutine, public rattle_3x3_ext(gci, particle_set, vel, dt)
...
subroutine, public shake_roll_3x3_ext(gci, particle_set, pos, vel, r_shake, v_shake, dt, ishake, max_sigma)
...
subroutine, public rattle_roll_3x3_int(molecule, particle_set, vel, r_rattle, dt, veps)
...
subroutine, public rattle_roll_4x6_int(molecule, particle_set, vel, r_rattle, dt, veps)
Intramolecular rattle_4x6_roll.
subroutine, public rattle_4x6_int(molecule, particle_set, vel, dt)
Intramolecular rattle_4x6.
subroutine, public shake_roll_4x6_ext(gci, particle_set, pos, vel, r_shake, dt, ishake, max_sigma)
Intramolecular shake_4x6_roll.
subroutine, public rattle_4x6_ext(gci, particle_set, vel, dt)
Intramolecular rattle_4x6.
subroutine, public shake_4x6_ext(gci, particle_set, pos, vel, dt, ishake, max_sigma)
Intramolecular shake_4x6.
subroutine, public shake_roll_4x6_int(molecule, particle_set, pos, vel, r_shake, dt, ishake, max_sigma)
Intramolecular shake_4x6_roll.
subroutine, public rattle_roll_4x6_ext(gci, particle_set, vel, r_rattle, dt, veps)
Intramolecular rattle_4x6_roll.
subroutine, public shake_4x6_int(molecule, particle_set, pos, vel, dt, ishake, max_sigma)
Intramolecular shake_4x6.
Module that handles the COLLECTIVE constraints.
subroutine, public shake_colv_int(molecule, particle_set, pos, vel, dt, ishake, cell, imass, max_sigma)
Intramolecular subroutine shake_colv algorithm for collective variables constraints updates the multi...
subroutine, public shake_roll_colv_int(molecule, particle_set, pos, vel, r_shake, v_shake, dt, ishake, cell, imass, max_sigma)
Intramolecular subroutine shake algorithm (box allowed to change) for collective variables constraint...
subroutine, public shake_update_colv_ext(gci, dt, motion_section)
Intermolecular subroutine for updating the TARGET value for collective constraints.
subroutine, public rattle_roll_colv_ext(gci, particle_set, vel, r_rattle, dt, irattle, veps, cell, imass, max_sigma)
Intermolecular subroutine rattle algorithm (box allowed to change) for collective variables constrain...
subroutine, public shake_update_colv_targets(dt, motion_section)
Real Shake subroutine - Low Level - for updating the TARGET value.
subroutine, public shake_colv_ext(gci, particle_set, pos, vel, dt, ishake, cell, imass, max_sigma)
Intermolecular subroutine shake_colv algorithm for collective variables constraints updates the multi...
subroutine, public rattle_roll_colv_int(molecule, particle_set, vel, r_rattle, dt, irattle, veps, cell, imass, max_sigma)
Intramolecular subroutine rattle algorithm (box allowed to change) for collective variables constrain...
subroutine, public rattle_colv_int(molecule, particle_set, vel, dt, irattle, cell, imass, max_sigma)
Intramolecular subroutine rattle algorithm for collective variables constraints updates the multiplie...
subroutine, public rattle_colv_ext(gci, particle_set, vel, dt, irattle, cell, imass, max_sigma)
Intermolecular subroutine rattle algorithm for collective variables constraints updates the multiplie...
subroutine, public shake_update_colv_low(colv_list, dt, motion_section, initialize)
Cache the actual target rate, including a partially clamped interval.
subroutine, public shake_roll_colv_ext(gci, particle_set, pos, vel, r_shake, v_shake, dt, ishake, cell, imass, max_sigma)
Intermolecular subroutine shake algorithm (box allowed to change) for collective variables constraint...
subroutine, public check_colv_int(molecule, particle_set, cell, max_sigma, pos, vel, rmat, veps)
Evaluate position or velocity residuals of local collective variables.
Contains routines useful for the application of constraints during MD.
subroutine, public get_roll_matrix(char, r_shake, v_shake, vector_r, vector_v, u)
...
subroutine, public restore_temporary_set(particle_set, local_particles, pos, vel)
...
subroutine, public update_temporary_set(group, pos, vel)
...
subroutine, public check_tol(roll_tol, iroll, char, matrix, veps)
...
Routines to handle the virtual site constraint/restraint.
subroutine, public shake_vsite_ext(gci, pos)
Intramolecular virtual site.
subroutine, public shake_vsite_int(molecule, pos)
Intramolecular virtual site.
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:242
subroutine, public rattle_roll_control(gci, local_molecules, molecule_set, molecule_kind_set, particle_set, vel, dt, simpar, vector, veps, roll_tol, iroll, para_env, u, cell, local_particles)
...
Definition constraint.F:527
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:102
subroutine, public shake_roll_control(gci, local_molecules, molecule_set, molecule_kind_set, particle_set, pos, vel, dt, simpar, roll_tol, iroll, vector_r, vector_v, group, u, cell, local_particles)
...
Definition constraint.F:371
subroutine, public shake_update_targets(gci, local_molecules, molecule_set, molecule_kind_set, dt, root_section)
Updates the TARGET of the COLLECTIVE constraints if the growth speed is different from zero.
Definition constraint.F:930
various routines to log and control the output. The idea is that decisions about where to log should ...
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public npt_i_ensemble
integer, parameter, public npt_ia_ensemble
integer, parameter, public npt_f_ensemble
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
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
Utility routines for the memory handling.
Interface to the message passing library MPI.
Define the molecule kind structure types and the corresponding functionality.
subroutine, public get_molecule_kind(molecule_kind, atom_list, bond_list, bend_list, ub_list, impr_list, opbend_list, colv_list, fixd_list, g3x3_list, g4x6_list, vsite_list, torsion_list, shell_list, name, mass, charge, kind_number, natom, nbend, nbond, nub, nimpr, nopbend, nconstraint, nconstraint_fixd, nfixd, ncolv, ng3x3, ng4x6, nvsite, nfixd_restraint, ng3x3_restraint, ng4x6_restraint, nvsite_restraint, nrestraints, nmolecule, nsgf, nshell, ntorsion, molecule_list, nelectron, nelectron_alpha, nelectron_beta, bond_kind_set, bend_kind_set, ub_kind_set, impr_kind_set, opbend_kind_set, torsion_kind_set, molname_generated)
Get informations about a molecule kind.
subroutine, public get_molecule_kind_set(molecule_kind_set, maxatom, natom, nbond, nbend, nub, ntorsion, nimpr, nopbend, nconstraint, nconstraint_fixd, nmolecule, nrestraints)
Get informations about a molecule kind set.
Define the data structure for the molecule information.
Define the data structure for the particle information.
Type for storing MD parameters.
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
Definition cell_types.F:60
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.