63#include "./base/base_uses.f90"
74 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'constraint'
75 INTEGER,
PARAMETER,
PRIVATE :: Max_Shake_Iter = 1000
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)
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
117 CHARACTER(LEN=*),
PARAMETER :: routinen =
'shake_control'
119 INTEGER :: handle, i, ikind, imol, ishake_ext, &
120 ishake_int, k, n3x3con, n4x6con, &
121 nconstraint, nkind, nmol_per_kind, &
123 LOGICAL :: do_ext_constraint
124 REAL(kind=
dp) :: int_max_sigma, mass, max_sigma
125 REAL(kind=
dp),
DIMENSION(SIZE(pos, 2)) :: imass
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
136 imass(k) = 1.0_dp/max(mass, epsilon(0.0_dp))
138 do_ext_constraint = (gci%ntot /= 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))
143 ishake_ext = ishake_ext + 1
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
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
161 IF (n3x3con /= 0)
THEN
162 CALL shake_3x3_int(molecule, particle_set, pos, vel, dt, ishake_int, &
166 IF (n4x6con /= 0)
THEN
167 CALL shake_4x6_int(molecule, particle_set, pos, vel, dt, ishake_int, &
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)
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)
179 IF (nvsitecon /= 0)
THEN
185 IF (do_ext_constraint)
THEN
188 IF (gci%ng3x3 /= 0)
THEN
189 CALL shake_3x3_ext(gci, particle_set, pos, vel, dt, ishake_ext, &
193 IF (gci%ng4x6 /= 0)
THEN
194 CALL shake_4x6_ext(gci, particle_set, pos, vel, dt, ishake_ext, &
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)
203 IF (gci%nvsite /= 0)
THEN
206 IF (gci%joint_colvar_checks)
THEN
207 CALL check_local_colvars(local_molecules, molecule_set, particle_set, cell, group, &
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")
217 CALL timestop(handle)
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, &
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
257 CHARACTER(LEN=*),
PARAMETER :: routinen =
'rattle_control'
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
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
275 imass(k) = 1.0_dp/max(mass, epsilon(0.0_dp))
277 do_ext_constraint = (gci%ntot /= 0)
279 max_sigma = -1.0e+10_dp
280 rattle_inter_loop:
DO WHILE (abs(max_sigma) >= rattle_tol)
282 irattle_ext = irattle_ext + 1
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
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
299 IF (n3x3con /= 0)
THEN
303 IF (n4x6con /= 0)
THEN
307 IF (ncolv%ntot /= 0)
THEN
309 irattle_int, cell, imass, int_max_sigma)
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)
317 IF (do_ext_constraint)
THEN
320 IF (gci%ng3x3 /= 0)
THEN
324 IF (gci%ng4x6 /= 0)
THEN
328 IF (gci%ncolv%ntot /= 0)
THEN
330 irattle_ext, cell, imass, max_sigma)
332 IF (gci%joint_colvar_checks)
THEN
333 CALL check_local_colvars(local_molecules, molecule_set, particle_set, cell, group, &
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)
369 molecule_kind_set, particle_set, pos, vel, dt, simpar, roll_tol, iroll, &
370 vector_r, vector_v, group, u, cell, local_particles)
377 REAL(kind=
dp),
INTENT(INOUT) :: pos(:, :), vel(:, :)
378 REAL(kind=
dp),
INTENT(IN) :: dt
380 REAL(kind=
dp),
INTENT(OUT) :: roll_tol
381 INTEGER,
INTENT(INOUT) :: iroll
382 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: vector_r, vector_v
385 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN), &
390 CHARACTER(LEN=*),
PARAMETER :: routinen =
'shake_roll_control'
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
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
415 DO k = 1,
SIZE(pos, 2)
416 atomic_kind => particle_set(k)%atomic_kind
418 imass(k) = 1.0_dp/max(mass, epsilon(0.0_dp))
420 do_ext_constraint = (gci%ntot /= 0)
422 max_sigma = -1.0e+10_dp
423 shake_inter_loop:
DO WHILE (abs(max_sigma) >= shake_tol)
425 ishake_ext = ishake_ext + 1
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
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
443 IF (n3x3con /= 0)
THEN
445 v_shake, dt, ishake_int, int_max_sigma)
448 IF (n4x6con /= 0)
THEN
450 dt, ishake_int, int_max_sigma)
453 IF (ncolv%ntot /= 0)
THEN
455 v_shake, dt, ishake_int, cell, imass, int_max_sigma)
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)
461 IF (nvsitecon /= 0)
THEN
462 cpabort(
"Virtual Site Constraint/Restraint not implemented for SHAKE_ROLL!")
467 IF (do_ext_constraint)
THEN
470 IF (gci%ng3x3 /= 0)
THEN
472 v_shake, dt, ishake_ext, max_sigma)
475 IF (gci%ng4x6 /= 0)
THEN
477 dt, ishake_ext, max_sigma)
480 IF (gci%ncolv%ntot /= 0)
THEN
482 v_shake, dt, ishake_ext, cell, imass, max_sigma)
485 IF (gci%nvsite /= 0)
THEN
486 cpabort(
"Virtual Site Constraint/Restraint not implemented for SHAKE_ROLL!")
488 IF (gci%joint_colvar_checks)
THEN
489 CALL check_local_colvars(local_molecules, molecule_set, particle_set, cell, group, &
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)
525 molecule_kind_set, particle_set, vel, dt, simpar, vector, &
526 veps, roll_tol, iroll, para_env, u, cell, local_particles)
533 REAL(kind=
dp),
INTENT(INOUT) :: vel(:, :)
534 REAL(kind=
dp),
INTENT(IN) :: dt
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
541 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN), &
546 CHARACTER(LEN=*),
PARAMETER :: routinen =
'rattle_roll_control'
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, &
553 REAL(kind=
dp),
DIMENSION(3, 3) :: r_rattle
554 REAL(kind=
dp),
DIMENSION(SIZE(vel, 2)) :: imass
560 CALL timeset(routinen, handle)
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
573 DO k = 1,
SIZE(vel, 2)
574 atomic_kind => particle_set(k)%atomic_kind
576 imass(k) = 1.0_dp/max(mass, epsilon(0.0_dp))
578 do_ext_constraint = (gci%ntot /= 0)
580 max_sigma = -1.0e+10_dp
581 rattle_inter_loop:
DO WHILE (abs(max_sigma) >= rattle_tol)
583 irattle_ext = irattle_ext + 1
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
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
601 IF (n3x3con /= 0)
THEN
606 IF (n4x6con /= 0)
THEN
611 IF (ncolv%ntot /= 0)
THEN
613 irattle_int, veps, cell, imass, int_max_sigma)
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)
621 IF (do_ext_constraint)
THEN
624 IF (gci%ng3x3 /= 0)
THEN
629 IF (gci%ng4x6 /= 0)
THEN
634 IF (gci%ncolv%ntot /= 0)
THEN
636 irattle_ext, veps, cell, imass, max_sigma)
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)
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)
665 SUBROUTINE check_local_colvars(local_molecules, molecule_set, particle_set, cell, group, &
666 max_sigma, pos, vel, rmat, veps)
673 REAL(kind=
dp),
INTENT(INOUT) :: max_sigma
674 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: pos(:, :), vel(:, :), rmat(:, :), veps(:, :)
676 INTEGER :: ikind, imol, i
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)
688 CALL group%max(max_sigma)
689 END SUBROUTINE check_local_colvars
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
714 CHARACTER(LEN=1),
INTENT(IN) :: id_type
716 CHARACTER(LEN=*),
PARAMETER :: routinen =
'dump_lagrange_mult'
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
727 CALL timeset(routinen, handle)
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))
739 IF (do_int_constraint)
THEN
740 mol:
DO ikind = 1, nkind
741 molecule_kind => molecule_kind_set(ikind)
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)
752 lagr(my_index + 1) = molecule%lci%lcolv(j)%lambda
753 my_index = my_index + 1
757 lagr(my_index + 1:my_index + 3) = molecule%lci%lg3x3(j)%lambda(:)
758 my_index = my_index + 3
762 lagr(my_index + 1:my_index + 6) = molecule%lci%lg4x6(j)%lambda(:)
763 my_index = my_index + 6
766 my_index = my_index + ncolv%ntot + 3*n3x3con + 6*n4x6con
773 IF (do_ext_constraint)
THEN
774 CALL reallocate(lagr, 1,
SIZE(lagr) + gci%ntot)
776 DO j = 1, gci%ncolv%ntot
777 lagr(my_index + 1) = gci%lcolv(j)%lambda
778 my_index = my_index + 1
782 lagr(my_index + 1:my_index + 3) = gci%lg3x3(j)%lambda(:)
783 my_index = my_index + 3
787 lagr(my_index + 1:my_index + 6) = gci%lg4x6(j)%lambda(:)
788 my_index = my_index + 6
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:"
797 cpabort(
"Only S for Shake or R for Rattle are supported for Lagrangian Multipliers")
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)))
806 CALL timestop(handle)
808 END SUBROUTINE dump_lagrange_mult
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
823 IF (log_unit > 0)
THEN
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
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. ")
835 END SUBROUTINE shake_int_info
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
849 IF (log_unit > 0)
THEN
851 WRITE (log_unit,
'("SHAKE_INFO|",2X,A,I6,A,F15.9)') &
852 "External Shake Nr. Iterations:", ishake_ext, &
853 " Max. Err.:", max_sigma
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.")
861 END SUBROUTINE shake_ext_info
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
876 IF (log_unit > 0)
THEN
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
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.")
888 END SUBROUTINE rattle_int_info
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
902 IF (log_unit > 0)
THEN
904 WRITE (log_unit,
'("RATTLE_INFO|",1X,A,I6,A,F15.9)') &
905 "External Rattle Nr. Iterations:", irattle_ext, &
906 " Max. Err.:", max_sigma
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.")
914 END SUBROUTINE rattle_ext_info
929 molecule_kind_set, dt, root_section)
935 REAL(kind=
dp),
INTENT(in) :: dt
938 CHARACTER(LEN=*),
PARAMETER :: routinen =
'shake_update_targets'
940 INTEGER :: handle, ikind, nkind
941 LOGICAL :: do_ext_constraint
944 CALL timeset(routinen, handle)
945 cpassert(
ASSOCIATED(local_molecules))
946 cpassert(
ASSOCIATED(molecule_set))
949 nkind =
SIZE(molecule_kind_set)
950 do_ext_constraint = (gci%ntot /= 0)
952 mol:
DO ikind = 1, nkind
953 IF (
ASSOCIATED(molecule_kind_set(ikind)%colv_list))
THEN
958 IF (do_ext_constraint)
THEN
962 CALL timestop(handle)
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.
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)
...
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)
...
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)
...
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)
...
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.
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...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
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.
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.