46 atom_type, bond_type, colvar_constraint_type, fixd_constraint_type, g3x3_constraint_type, &
50 global_constraint_type,&
51 local_colvar_constraint_type,&
52 local_constraint_type,&
53 local_g3x3_constraint_type,&
54 local_g4x6_constraint_type,&
63 #include "./base/base_uses.f90"
67 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'topology_constraint_util'
86 topology, qmmm_env, particle_set, input_file, subsys_section, gci)
87 TYPE(molecule_kind_type),
DIMENSION(:),
POINTER :: molecule_kind_set
88 TYPE(molecule_type),
DIMENSION(:),
POINTER :: molecule_set
90 TYPE(qmmm_env_mm_type),
OPTIONAL,
POINTER :: qmmm_env
91 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
92 TYPE(section_vals_type),
POINTER :: input_file, subsys_section
93 TYPE(global_constraint_type),
POINTER :: gci
95 CHARACTER(len=*),
PARAMETER :: routinen =
'topology_constraint_pack'
97 CHARACTER(LEN=2) :: element_symbol
98 CHARACTER(LEN=default_string_length) :: molname, name
99 CHARACTER(LEN=default_string_length), &
100 DIMENSION(:),
POINTER :: atom_typeh, cnds
101 INTEGER :: cind, first, first_atom, gind, handle, handle2, i, ii, itype, iw, j, k, k1loc, &
102 k2loc, kk, last, last_atom, m, n_start_colv, natom, nbond, ncolv_glob, ncolv_mol, &
103 nfixd_list_gci, nfixd_restart, nfixd_restraint, nfixed_atoms, ng3x3, ng3x3_restraint, &
104 ng4x6, ng4x6_restraint, nhdist, nmolecule, nrep, nvsite, nvsite_restraint, offset
105 INTEGER,
DIMENSION(:),
POINTER :: constr_x_glob, inds, molecule_list
106 LOGICAL :: exclude_mm, exclude_qm, fix_atom_mm, fix_atom_molname, fix_atom_qm, &
107 fix_atom_qmmm, fix_fixed_atom, found_molname, is_qm, ishbond, ldummy, &
108 restart_restraint_clv, restart_restraint_pos, use_clv_info
109 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: missed_molname
110 REAL(kind=
dp) :: rmod, rvec(3)
111 REAL(kind=
dp),
DIMENSION(:),
POINTER :: hdist, r
112 TYPE(atom_type),
DIMENSION(:),
POINTER :: atom_list
113 TYPE(atomic_kind_type),
POINTER :: atomic_kind
114 TYPE(bond_type),
DIMENSION(:),
POINTER :: bond_list
115 TYPE(colvar_constraint_type),
DIMENSION(:), &
117 TYPE(colvar_counters) :: ncolv
120 TYPE(cp_logger_type),
POINTER :: logger
121 TYPE(fixd_constraint_type),
DIMENSION(:),
POINTER :: fixd_list, fixd_list_gci
122 TYPE(g3x3_constraint_type),
DIMENSION(:),
POINTER :: g3x3_list
123 TYPE(g4x6_constraint_type),
DIMENSION(:),
POINTER :: g4x6_list
124 TYPE(local_colvar_constraint_type),
DIMENSION(:), &
126 TYPE(local_constraint_type),
POINTER :: lci
127 TYPE(local_g3x3_constraint_type),
DIMENSION(:), &
129 TYPE(local_g4x6_constraint_type),
DIMENSION(:), &
131 TYPE(molecule_kind_type),
POINTER :: molecule_kind
132 TYPE(molecule_type),
POINTER :: molecule
133 TYPE(section_vals_type),
POINTER :: colvar_func_info, colvar_rest, &
134 fixd_restr_rest, hbonds_section
135 TYPE(vsite_constraint_type),
DIMENSION(:),
POINTER :: vsite_list
137 NULLIFY (logger, constr_x_mol, constr_x_glob)
140 extension=
".subsysLog")
141 CALL timeset(routinen, handle)
142 CALL timeset(routinen//
"_1", handle2)
146 "MOTION%CONSTRAINT%HBONDS")
148 "MOTION%CONSTRAINT%FIX_ATOM_RESTART")
151 "MOTION%CONSTRAINT%COLVAR_RESTART")
154 "COLVAR%COLVAR_FUNC_INFO")
161 molecule => molecule_set(i)
175 NULLIFY (gci%lcolv, &
187 gci%ng3x3_restraint = 0
188 gci%ng4x6_restraint = 0
189 gci%nvsite_restraint = 0
191 gci%nrestraint = gci%ng3x3_restraint + &
192 gci%ng4x6_restraint + &
193 gci%nvsite_restraint + &
195 CALL timestop(handle2)
196 CALL timeset(routinen//
"_2", handle2)
203 NULLIFY (atom_typeh, hdist)
204 ALLOCATE (constr_x_mol(
SIZE(molecule_kind_set)))
205 DO i = 1,
SIZE(molecule_kind_set)
206 ALLOCATE (constr_x_mol(i)%constr(1))
207 constr_x_mol(i)%constr(1) = 1
212 DO i = 1,
SIZE(molecule_kind_set)
213 constr_x_mol(i)%constr(1) = 0
217 constr_x_mol(inds(i))%constr(1) = 1
223 DO i = 1,
SIZE(molecule_kind_set)
224 constr_x_mol(i)%constr(1) = 0
228 found_molname = .false.
229 DO k = 1,
SIZE(molecule_kind_set)
230 molecule_kind => molecule_kind_set(k)
231 name = molecule_kind%name
233 IF (cnds(i) == name)
THEN
234 constr_x_mol(k)%constr(1) = 1
235 found_molname = .true.
238 CALL print_warning_molname(found_molname, cnds(i))
248 IF (
ASSOCIATED(hdist))
THEN
249 cpassert(
SIZE(hdist) ==
SIZE(atom_typeh))
254 DO i = 1,
SIZE(molecule_kind_set)
255 molecule_kind => molecule_kind_set(i)
256 IF (constr_x_mol(i)%constr(1) == 0) cycle
258 bond_list=bond_list, nbond=nbond, atom_list=atom_list, &
259 molecule_list=molecule_list)
262 molecule => molecule_set(molecule_list(1))
263 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
264 natom = last_atom - first_atom + 1
268 IF (j < 1 .OR. j > natom) cycle
269 atomic_kind => atom_list(j)%atomic_kind
272 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
273 IF (is_qm .AND. exclude_qm) ishbond = .false.
274 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
275 IF (.NOT. ishbond)
THEN
277 IF (j < 1 .OR. j > natom) cycle
278 atomic_kind => atom_list(j)%atomic_kind
281 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
282 IF (is_qm .AND. exclude_qm) ishbond = .false.
283 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
290 n_start_colv = cons_info%nconst_colv
291 cons_info%nconst_colv = nhdist + n_start_colv
292 CALL reallocate(cons_info%const_colv_mol, 1, cons_info%nconst_colv)
293 CALL reallocate(cons_info%const_colv_molname, 1, cons_info%nconst_colv)
294 CALL reallocate(cons_info%const_colv_target, 1, cons_info%nconst_colv)
295 CALL reallocate(cons_info%const_colv_target_growth, 1, cons_info%nconst_colv)
298 CALL reallocate(cons_info%colv_intermolecular, 1, cons_info%nconst_colv)
299 CALL reallocate(cons_info%colv_restraint, 1, cons_info%nconst_colv)
300 CALL reallocate(cons_info%colv_k0, 1, cons_info%nconst_colv)
301 CALL reallocate(cons_info%colv_exclude_qm, 1, cons_info%nconst_colv)
302 CALL reallocate(cons_info%colv_exclude_mm, 1, cons_info%nconst_colv)
304 cons_info%colv_intermolecular(n_start_colv + 1:cons_info%nconst_colv) = .false.
305 cons_info%colv_exclude_qm(n_start_colv + 1:cons_info%nconst_colv) = .false.
306 cons_info%colv_exclude_mm(n_start_colv + 1:cons_info%nconst_colv) = .false.
307 cons_info%colv_restraint(n_start_colv + 1:cons_info%nconst_colv) = cons_info%hbonds_restraint
308 cons_info%colv_k0(n_start_colv + 1:cons_info%nconst_colv) = cons_info%hbonds_k0
311 DO i = 1,
SIZE(molecule_kind_set)
312 IF (constr_x_mol(i)%constr(1) == 0) cycle
313 molecule_kind => molecule_kind_set(i)
315 bond_list=bond_list, nbond=nbond, atom_list=atom_list, &
316 molecule_list=molecule_list)
317 molecule => molecule_set(molecule_list(1))
318 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
319 natom = last_atom - first_atom + 1
320 offset = first_atom - 1
324 IF (j < 1 .OR. j > natom) cycle
325 atomic_kind => atom_list(j)%atomic_kind
328 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
329 IF (is_qm .AND. exclude_qm) ishbond = .false.
330 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
331 IF (.NOT. ishbond)
THEN
333 IF (j < 1 .OR. j > natom) cycle
334 atomic_kind => atom_list(j)%atomic_kind
337 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
338 IF (is_qm .AND. exclude_qm) ishbond = .false.
339 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
343 rvec = particle_set(offset + bond_list(k)%a)%r - particle_set(offset + bond_list(k)%b)%r
344 rmod = sqrt(dot_product(rvec, rvec))
345 IF (
ASSOCIATED(hdist))
THEN
346 IF (
SIZE(hdist) > 0)
THEN
347 IF (bond_list(k)%a == j) atomic_kind => atom_list(bond_list(k)%b)%atomic_kind
348 IF (bond_list(k)%b == j) atomic_kind => atom_list(bond_list(k)%a)%atomic_kind
350 name=name, element_symbol=element_symbol)
352 DO m = 1,
SIZE(hdist)
353 IF (trim(name) == trim(atom_typeh(m)))
EXIT
354 IF (trim(element_symbol) == trim(atom_typeh(m)))
EXIT
356 IF (m <=
SIZE(hdist))
THEN
361 cons_info%const_colv_mol(nhdist + n_start_colv) = i
362 cons_info%const_colv_molname(nhdist + n_start_colv) =
"UNDEF"
363 cons_info%const_colv_target(nhdist + n_start_colv) = rmod
364 cons_info%const_colv_target_growth(nhdist + n_start_colv) = 0.0_dp
365 CALL colvar_create(cons_info%colvar_set(nhdist + n_start_colv)%colvar, &
367 cons_info%colvar_set(nhdist + n_start_colv)%colvar%dist_param%i_at = bond_list(k)%a
368 cons_info%colvar_set(nhdist + n_start_colv)%colvar%dist_param%j_at = bond_list(k)%b
369 CALL colvar_setup(cons_info%colvar_set(nhdist + n_start_colv)%colvar)
373 DO j = 1,
SIZE(constr_x_mol)
374 DEALLOCATE (constr_x_mol(j)%constr)
376 DEALLOCATE (constr_x_mol)
379 CALL timestop(handle2)
380 CALL timeset(routinen//
"_3", handle2)
387 DO ii = 1,
SIZE(cons_info%colvar_set)
391 CALL give_constraint_array(cons_info%const_colv_mol, &
392 cons_info%const_colv_molname, &
393 cons_info%colv_intermolecular, &
397 cons_info%colv_exclude_qm, &
398 cons_info%colv_exclude_mm)
402 DO ii = 1,
SIZE(molecule_kind_set)
403 molecule_kind => molecule_kind_set(ii)
405 nmolecule=nmolecule, molecule_list=molecule_list)
406 ncolv_mol =
SIZE(constr_x_mol(ii)%constr)
407 ALLOCATE (colv_list(ncolv_mol))
412 molecule => molecule_set(molecule_list(1))
414 CALL setup_colv_list(colv_list, constr_x_mol(ii)%constr, gind, &
415 cons_info,
topology, particle_set, restart_restraint_clv, &
416 colvar_rest, first_atom)
420 molecule => molecule_set(molecule_list(j))
421 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
422 ALLOCATE (lcolv(ncolv_mol))
423 CALL setup_lcolv(lcolv, constr_x_mol(ii)%constr, first_atom, last_atom, &
424 cons_info, particle_set, colvar_func_info, use_clv_info, cind)
428 DO j = 1,
SIZE(constr_x_mol)
429 DEALLOCATE (constr_x_mol(j)%constr)
431 DEALLOCATE (constr_x_mol)
434 IF (
ASSOCIATED(constr_x_glob))
THEN
435 ncolv_glob =
SIZE(constr_x_glob)
436 ALLOCATE (colv_list(ncolv_glob))
437 CALL setup_colv_list(colv_list, constr_x_glob, gind, cons_info, &
438 topology, particle_set, restart_restraint_clv, colvar_rest, &
441 ALLOCATE (lcolv(ncolv_glob))
442 CALL setup_lcolv(lcolv, constr_x_glob, 1,
SIZE(particle_set), cons_info, &
443 particle_set, colvar_func_info, use_clv_info, cind)
444 gci%colv_list => colv_list
448 gci%ntot = gci%ncolv%ntot + gci%ntot
449 DEALLOCATE (constr_x_glob)
453 CALL timestop(handle2)
454 CALL timeset(routinen//
"_4", handle2)
460 CALL give_constraint_array(cons_info%const_g33_mol, &
461 cons_info%const_g33_molname, &
462 cons_info%g33_intermolecular, &
466 cons_info%g33_exclude_qm, &
467 cons_info%g33_exclude_mm)
469 DO ii = 1,
SIZE(molecule_kind_set)
470 molecule_kind => molecule_kind_set(ii)
472 nmolecule=nmolecule, &
473 molecule_list=molecule_list)
474 ng3x3 =
SIZE(constr_x_mol(ii)%constr)
475 ALLOCATE (g3x3_list(ng3x3))
476 CALL setup_g3x3_list(g3x3_list, constr_x_mol(ii)%constr, cons_info, ng3x3_restraint)
477 CALL set_molecule_kind(molecule_kind, ng3x3=ng3x3, ng3x3_restraint=ng3x3_restraint, g3x3_list=g3x3_list)
479 molecule => molecule_set(molecule_list(j))
480 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
481 ALLOCATE (lg3x3(ng3x3))
482 CALL setup_lg3x3(lg3x3, g3x3_list, first_atom, last_atom)
486 DO j = 1,
SIZE(constr_x_mol)
487 DEALLOCATE (constr_x_mol(j)%constr)
489 DEALLOCATE (constr_x_mol)
491 IF (
ASSOCIATED(constr_x_glob))
THEN
492 ng3x3 =
SIZE(constr_x_glob)
493 ALLOCATE (g3x3_list(ng3x3))
494 CALL setup_g3x3_list(g3x3_list, constr_x_glob, cons_info, ng3x3_restraint)
495 ALLOCATE (lg3x3(ng3x3))
496 CALL setup_lg3x3(lg3x3, g3x3_list, first_atom, last_atom)
497 gci%g3x3_list => g3x3_list
500 gci%ng3x3_restraint = ng3x3_restraint
502 gci%ntot = 3*gci%ng3x3 + gci%ntot
503 DEALLOCATE (constr_x_glob)
507 CALL timestop(handle2)
508 CALL timeset(routinen//
"_5", handle2)
514 CALL give_constraint_array(cons_info%const_g46_mol, &
515 cons_info%const_g46_molname, &
516 cons_info%g46_intermolecular, &
520 cons_info%g46_exclude_qm, &
521 cons_info%g46_exclude_mm)
523 DO ii = 1,
SIZE(molecule_kind_set)
524 molecule_kind => molecule_kind_set(ii)
526 nmolecule=nmolecule, molecule_list=molecule_list)
527 ng4x6 =
SIZE(constr_x_mol(ii)%constr)
528 ALLOCATE (g4x6_list(ng4x6))
529 CALL setup_g4x6_list(g4x6_list, constr_x_mol(ii)%constr, cons_info, ng4x6_restraint)
530 CALL set_molecule_kind(molecule_kind, ng4x6=ng4x6, ng4x6_restraint=ng4x6_restraint, g4x6_list=g4x6_list)
532 molecule => molecule_set(molecule_list(j))
533 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
534 ALLOCATE (lg4x6(ng4x6))
535 CALL setup_lg4x6(lg4x6, g4x6_list, first_atom, last_atom)
539 DO j = 1,
SIZE(constr_x_mol)
540 DEALLOCATE (constr_x_mol(j)%constr)
542 DEALLOCATE (constr_x_mol)
544 IF (
ASSOCIATED(constr_x_glob))
THEN
545 ng4x6 =
SIZE(constr_x_glob)
546 ALLOCATE (g4x6_list(ng4x6))
547 CALL setup_g4x6_list(g4x6_list, constr_x_glob, cons_info, ng4x6_restraint)
548 ALLOCATE (lg4x6(ng4x6))
549 CALL setup_lg4x6(lg4x6, g4x6_list, first_atom, last_atom)
550 gci%g4x6_list => g4x6_list
553 gci%ng4x6_restraint = ng4x6_restraint
555 gci%ntot = 6*gci%ng4x6 + gci%ntot
556 DEALLOCATE (constr_x_glob)
560 CALL timestop(handle2)
561 CALL timeset(routinen//
"_6", handle2)
567 CALL give_constraint_array(cons_info%const_vsite_mol, &
568 cons_info%const_vsite_molname, &
569 cons_info%vsite_intermolecular, &
573 cons_info%vsite_exclude_qm, &
574 cons_info%vsite_exclude_mm)
576 DO ii = 1,
SIZE(molecule_kind_set)
577 molecule_kind => molecule_kind_set(ii)
579 nmolecule=nmolecule, molecule_list=molecule_list)
580 nvsite =
SIZE(constr_x_mol(ii)%constr)
581 ALLOCATE (vsite_list(nvsite))
582 CALL setup_vsite_list(vsite_list, constr_x_mol(ii)%constr, cons_info, nvsite_restraint)
583 CALL set_molecule_kind(molecule_kind, nvsite=nvsite, nvsite_restraint=nvsite_restraint, &
584 vsite_list=vsite_list)
586 DO j = 1,
SIZE(constr_x_mol)
587 DEALLOCATE (constr_x_mol(j)%constr)
589 DEALLOCATE (constr_x_mol)
591 IF (
ASSOCIATED(constr_x_glob))
THEN
592 nvsite =
SIZE(constr_x_glob)
593 ALLOCATE (vsite_list(nvsite))
594 CALL setup_vsite_list(vsite_list, constr_x_glob, cons_info, nvsite_restraint)
595 gci%vsite_list => vsite_list
597 gci%nvsite_restraint = nvsite_restraint
599 gci%ntot = gci%nvsite + gci%ntot
600 DEALLOCATE (constr_x_glob)
603 CALL timestop(handle2)
604 CALL timeset(routinen//
"_7", handle2)
610 ALLOCATE (fixd_list_gci(
SIZE(particle_set)))
612 ALLOCATE (missed_molname(
SIZE(cons_info%fixed_molnames, 1)))
613 missed_molname = .true.
615 DO i = 1,
SIZE(molecule_kind_set)
616 molecule_kind => molecule_kind_set(i)
618 nmolecule=nmolecule, molecule_list=molecule_list, name=molname)
620 WHERE (molname .EQ. cons_info%fixed_molnames)
621 missed_molname = .false.
626 molecule => molecule_set(molecule_list(j))
627 CALL get_molecule(molecule, first_atom=first, last_atom=last)
628 fix_atom_molname = .false.
629 IF (
ASSOCIATED(cons_info%fixed_molnames))
THEN
630 DO k = 1,
SIZE(cons_info%fixed_molnames)
631 IF (cons_info%fixed_molnames(k) .EQ. molname)
THEN
632 fix_atom_molname = .true.
633 IF (is_qm .AND. cons_info%fixed_exclude_qm(k)) fix_atom_molname = .false.
634 IF ((.NOT. is_qm) .AND. cons_info%fixed_exclude_mm(k)) fix_atom_molname = .false.
639 fix_atom_qmmm = .false.
640 IF (
PRESENT(qmmm_env))
THEN
641 SELECT CASE (cons_info%freeze_qm)
643 IF (any(qmmm_env%qm_atom_index == k)) fix_atom_qmmm = .true.
645 IF (any(qmmm_env%qm_molecule_index == molecule_list(j))) fix_atom_qmmm = .true.
647 SELECT CASE (cons_info%freeze_mm)
649 IF (all(qmmm_env%qm_atom_index /= k)) fix_atom_qmmm = .true.
651 IF (all(qmmm_env%qm_molecule_index /= molecule_list(j))) fix_atom_qmmm = .true.
654 IF (any(cons_info%fixed_atoms == k) .OR. fix_atom_qmmm .OR. fix_atom_molname)
THEN
655 nfixed_atoms = nfixed_atoms + 1
659 ALLOCATE (fixd_list(nfixed_atoms))
662 IF (nfixed_atoms /= 0)
THEN
664 molecule => molecule_set(molecule_list(j))
665 CALL get_molecule(molecule, first_atom=first, last_atom=last)
666 fix_atom_molname = .false.
667 IF (
ASSOCIATED(cons_info%fixed_molnames))
THEN
668 DO k1loc = 1,
SIZE(cons_info%fixed_molnames)
669 IF (cons_info%fixed_molnames(k1loc) .EQ. molname)
THEN
670 fix_atom_molname = .true.
671 itype = cons_info%fixed_mol_type(k1loc)
678 fix_fixed_atom = .false.
679 DO k2loc = 1,
SIZE(cons_info%fixed_atoms)
680 IF (cons_info%fixed_atoms(k2loc) == k)
THEN
681 fix_fixed_atom = .true.
682 itype = cons_info%fixed_type(k2loc)
687 fix_atom_qmmm = .false.
688 fix_atom_mm = .false.
689 fix_atom_qm = .false.
690 IF (
PRESENT(qmmm_env))
THEN
691 SELECT CASE (cons_info%freeze_qm)
693 IF (any(qmmm_env%qm_atom_index == k))
THEN
694 fix_atom_qmmm = .true.
696 itype = cons_info%freeze_qm_type
699 IF (any(qmmm_env%qm_molecule_index == molecule_list(j)))
THEN
700 fix_atom_qmmm = .true.
702 itype = cons_info%freeze_qm_type
705 SELECT CASE (cons_info%freeze_mm)
707 IF (all(qmmm_env%qm_atom_index /= k))
THEN
708 fix_atom_qmmm = .true.
710 itype = cons_info%freeze_mm_type
713 IF (all(qmmm_env%qm_molecule_index /= molecule_list(j)))
THEN
714 fix_atom_qmmm = .true.
716 itype = cons_info%freeze_mm_type
720 IF (fix_atom_qm .AND. fix_atom_mm)
THEN
721 CALL cp_abort(__location__, &
722 "Atom number: "//cp_to_string(k)// &
723 " has been defined both QM and MM. General Error!")
727 IF ((fix_fixed_atom .AND. fix_atom_qmmm) .OR. (fix_fixed_atom .AND. fix_atom_molname) &
728 .OR. (fix_atom_qmmm .AND. fix_atom_molname))
THEN
729 CALL cp_abort(__location__, &
730 "Atom number: "//cp_to_string(k)// &
731 " has been constrained/restrained to be fixed in more than one"// &
732 " input section. Check and correct your input file!")
735 IF (fix_fixed_atom .OR. fix_atom_qmmm .OR. fix_atom_molname)
THEN
737 fixd_list(kk)%fixd = k
738 fixd_list(kk)%coord = particle_set(k)%r
739 fixd_list(kk)%itype = itype
741 IF (fix_fixed_atom)
THEN
742 fixd_list(kk)%restraint%active = cons_info%fixed_restraint(k2loc)
743 fixd_list(kk)%restraint%k0 = cons_info%fixed_k0(k2loc)
744 ELSEIF (fix_atom_qm)
THEN
745 fixd_list(kk)%restraint%active = cons_info%fixed_qm_restraint
746 fixd_list(kk)%restraint%k0 = cons_info%fixed_qm_k0
747 ELSEIF (fix_atom_mm)
THEN
748 fixd_list(kk)%restraint%active = cons_info%fixed_mm_restraint
749 fixd_list(kk)%restraint%k0 = cons_info%fixed_mm_k0
750 ELSEIF (fix_atom_molname)
THEN
751 fixd_list(kk)%restraint%active = cons_info%fixed_mol_restraint(k1loc)
752 fixd_list(kk)%restraint%k0 = cons_info%fixed_mol_k0(k1loc)
757 IF (fixd_list(kk)%restraint%active)
THEN
758 nfixd_restraint = nfixd_restraint + 1
759 nfixd_restart = nfixd_restart + 1
763 fixd_list(kk)%coord(2) = huge(0.0_dp)
764 fixd_list(kk)%coord(3) = huge(0.0_dp)
766 fixd_list(kk)%coord(1) = huge(0.0_dp)
767 fixd_list(kk)%coord(3) = huge(0.0_dp)
769 fixd_list(kk)%coord(1) = huge(0.0_dp)
770 fixd_list(kk)%coord(2) = huge(0.0_dp)
772 fixd_list(kk)%coord(3) = huge(0.0_dp)
774 fixd_list(kk)%coord(2) = huge(0.0_dp)
776 fixd_list(kk)%coord(1) = huge(0.0_dp)
778 IF (restart_restraint_pos)
THEN
781 i_rep_val=nfixd_restart, r_vals=r)
784 cpassert(
SIZE(r) == 1)
785 fixd_list(kk)%coord(1) = r(1)
787 cpassert(
SIZE(r) == 1)
788 fixd_list(kk)%coord(2) = r(1)
790 cpassert(
SIZE(r) == 1)
791 fixd_list(kk)%coord(3) = r(1)
793 cpassert(
SIZE(r) == 2)
794 fixd_list(kk)%coord(1) = r(1)
795 fixd_list(kk)%coord(2) = r(2)
797 cpassert(
SIZE(r) == 2)
798 fixd_list(kk)%coord(1) = r(1)
799 fixd_list(kk)%coord(3) = r(2)
801 cpassert(
SIZE(r) == 2)
802 fixd_list(kk)%coord(2) = r(1)
803 fixd_list(kk)%coord(3) = r(2)
805 cpassert(
SIZE(r) == 3)
806 fixd_list(kk)%coord(1:3) = r(1:3)
813 r(1) = fixd_list(kk)%coord(1)
816 r(1) = fixd_list(kk)%coord(2)
819 r(1) = fixd_list(kk)%coord(3)
822 r(1) = fixd_list(kk)%coord(1)
823 r(2) = fixd_list(kk)%coord(2)
826 r(1) = fixd_list(kk)%coord(1)
827 r(2) = fixd_list(kk)%coord(3)
830 r(1) = fixd_list(kk)%coord(1)
831 r(2) = fixd_list(kk)%coord(3)
834 r(1:3) = fixd_list(kk)%coord(1:3)
837 i_rep_val=nfixd_restart, r_vals_ptr=r)
845 WRITE (iw, *)
"MOLECULE KIND:", i,
" NR. FIXED ATOMS:",
SIZE(fixd_list(:)%fixd),
" LIST::", fixd_list(:)%fixd
847 CALL set_molecule_kind(molecule_kind, nfixd=nfixed_atoms, nfixd_restraint=nfixd_restraint, &
849 fixd_list_gci(nfixd_list_gci + 1:nfixd_list_gci + nfixed_atoms) = fixd_list
850 nfixd_list_gci = nfixd_list_gci + nfixed_atoms
853 WRITE (iw, *)
"TOTAL NUMBER OF FIXED ATOMS:", nfixd_list_gci
855 cpassert(count(missed_molname) == 0)
856 DEALLOCATE (missed_molname)
858 IF (gci%ntot /= 0)
THEN
859 ALLOCATE (fixd_list(nfixd_list_gci))
860 fixd_list(1:nfixd_list_gci) = fixd_list_gci(1:nfixd_list_gci)
861 gci%fixd_list => fixd_list
863 DEALLOCATE (fixd_list_gci)
866 gci%nrestraint = gci%ng3x3_restraint + &
867 gci%ng4x6_restraint + &
868 gci%nvsite_restraint + &
871 "PRINT%TOPOLOGY_INFO/UTIL_INFO")
872 CALL timestop(handle2)
873 CALL timestop(handle)
891 SUBROUTINE setup_colv_list(colv_list, ilist, gind, cons_info, topology, &
892 particle_set, restart_restraint_clv, colvar_rest, first_atom)
894 TYPE(colvar_constraint_type),
DIMENSION(:), &
896 INTEGER,
DIMENSION(:),
POINTER :: ilist
897 INTEGER,
INTENT(INOUT) :: gind
900 TYPE(particle_type),
DIMENSION(:),
OPTIONAL, &
901 POINTER :: particle_set
902 LOGICAL,
INTENT(IN) :: restart_restraint_clv
903 TYPE(section_vals_type),
POINTER :: colvar_rest
904 INTEGER,
INTENT(IN) :: first_atom
906 INTEGER :: j, kdim, kk, ncolv_mol
907 REAL(kind=
dp) :: rmod
908 TYPE(colvar_type),
POINTER :: local_colvar
911 DO kk = 1,
SIZE(ilist)
913 ncolv_mol = ncolv_mol + 1
914 kdim =
SIZE(cons_info%colvar_set(j)%colvar%i_atom)
915 ALLOCATE (colv_list(ncolv_mol)%i_atoms(kdim))
916 colv_list(ncolv_mol)%inp_seq_num = j
917 colv_list(ncolv_mol)%type_id = cons_info%colvar_set(j)%colvar%type_id
918 colv_list(ncolv_mol)%i_atoms = cons_info%colvar_set(j)%colvar%i_atom
919 colv_list(ncolv_mol)%use_points = cons_info%colvar_set(j)%colvar%use_points
921 colv_list(ncolv_mol)%restraint%active = cons_info%colv_restraint(j)
922 colv_list(ncolv_mol)%restraint%k0 = cons_info%colv_k0(j)
923 IF (cons_info%const_colv_target(j) == -huge(0.0_dp))
THEN
925 NULLIFY (local_colvar)
926 CALL colvar_clone(local_colvar, cons_info%colvar_set(j)%colvar, &
927 i_atom_offset=first_atom - 1)
929 colv_list(ncolv_mol)%expected_value = local_colvar%ss
932 colv_list(ncolv_mol)%expected_value = cons_info%const_colv_target(j)
934 colv_list(ncolv_mol)%expected_value_growth_speed = cons_info%const_colv_target_growth(j)
936 IF (colv_list(ncolv_mol)%restraint%active .AND. &
937 (colv_list(ncolv_mol)%expected_value_growth_speed == 0.0_dp))
THEN
939 IF (restart_restraint_clv)
THEN
941 i_rep_val=gind, r_val=rmod)
942 colv_list(ncolv_mol)%expected_value = rmod
944 rmod = colv_list(ncolv_mol)%expected_value
946 i_rep_val=gind, r_val=rmod)
952 cons_info%colvar_set(j)%colvar%torsion_param%o0 = colv_list(ncolv_mol)%expected_value
955 END SUBROUTINE setup_colv_list
967 SUBROUTINE setup_g3x3_list(g3x3_list, ilist, cons_info, ng3x3_restraint)
968 TYPE(g3x3_constraint_type),
DIMENSION(:),
POINTER :: g3x3_list
969 INTEGER,
DIMENSION(:),
POINTER :: ilist
971 INTEGER,
INTENT(OUT) :: ng3x3_restraint
976 DO ng3x3 = 1,
SIZE(ilist)
978 g3x3_list(ng3x3)%a = cons_info%const_g33_a(j)
979 g3x3_list(ng3x3)%b = cons_info%const_g33_b(j)
980 g3x3_list(ng3x3)%c = cons_info%const_g33_c(j)
981 g3x3_list(ng3x3)%dab = cons_info%const_g33_dab(j)
982 g3x3_list(ng3x3)%dac = cons_info%const_g33_dac(j)
983 g3x3_list(ng3x3)%dbc = cons_info%const_g33_dbc(j)
985 g3x3_list(ng3x3)%restraint%active = cons_info%g33_restraint(j)
986 g3x3_list(ng3x3)%restraint%k0 = cons_info%g33_k0(j)
987 IF (g3x3_list(ng3x3)%restraint%active) ng3x3_restraint = ng3x3_restraint + 1
990 END SUBROUTINE setup_g3x3_list
1002 SUBROUTINE setup_g4x6_list(g4x6_list, ilist, cons_info, ng4x6_restraint)
1003 TYPE(g4x6_constraint_type),
DIMENSION(:),
POINTER :: g4x6_list
1004 INTEGER,
DIMENSION(:),
POINTER :: ilist
1006 INTEGER,
INTENT(OUT) :: ng4x6_restraint
1012 DO ng4x6 = 1,
SIZE(ilist)
1014 g4x6_list(ng4x6)%a = cons_info%const_g46_a(j)
1015 g4x6_list(ng4x6)%b = cons_info%const_g46_b(j)
1016 g4x6_list(ng4x6)%c = cons_info%const_g46_c(j)
1017 g4x6_list(ng4x6)%d = cons_info%const_g46_d(j)
1018 g4x6_list(ng4x6)%dab = cons_info%const_g46_dab(j)
1019 g4x6_list(ng4x6)%dac = cons_info%const_g46_dac(j)
1020 g4x6_list(ng4x6)%dbc = cons_info%const_g46_dbc(j)
1021 g4x6_list(ng4x6)%dad = cons_info%const_g46_dad(j)
1022 g4x6_list(ng4x6)%dbd = cons_info%const_g46_dbd(j)
1023 g4x6_list(ng4x6)%dcd = cons_info%const_g46_dcd(j)
1025 g4x6_list(ng4x6)%restraint%active = cons_info%g46_restraint(j)
1026 g4x6_list(ng4x6)%restraint%k0 = cons_info%g46_k0(j)
1027 IF (g4x6_list(ng4x6)%restraint%active) ng4x6_restraint = ng4x6_restraint + 1
1030 END SUBROUTINE setup_g4x6_list
1041 SUBROUTINE setup_vsite_list(vsite_list, ilist, cons_info, nvsite_restraint)
1042 TYPE(vsite_constraint_type),
DIMENSION(:),
POINTER :: vsite_list
1043 INTEGER,
DIMENSION(:),
POINTER :: ilist
1045 INTEGER,
INTENT(OUT) :: nvsite_restraint
1047 INTEGER :: j, nvsite
1050 nvsite_restraint = 0
1051 DO nvsite = 1,
SIZE(ilist)
1053 vsite_list(nvsite)%a = cons_info%const_vsite_a(j)
1054 vsite_list(nvsite)%b = cons_info%const_vsite_b(j)
1055 vsite_list(nvsite)%c = cons_info%const_vsite_c(j)
1056 vsite_list(nvsite)%d = cons_info%const_vsite_d(j)
1057 vsite_list(nvsite)%wbc = cons_info%const_vsite_wbc(j)
1058 vsite_list(nvsite)%wdc = cons_info%const_vsite_wdc(j)
1060 vsite_list(nvsite)%restraint%active = cons_info%vsite_restraint(j)
1061 vsite_list(nvsite)%restraint%k0 = cons_info%vsite_k0(j)
1062 IF (vsite_list(nvsite)%restraint%active) nvsite_restraint = nvsite_restraint + 1
1065 END SUBROUTINE setup_vsite_list
1081 SUBROUTINE setup_lcolv(lcolv, ilist, first_atom, last_atom, cons_info, &
1082 particle_set, colvar_func_info, use_clv_info, &
1084 TYPE(local_colvar_constraint_type),
DIMENSION(:), &
1086 INTEGER,
DIMENSION(:),
POINTER :: ilist
1087 INTEGER,
INTENT(IN) :: first_atom, last_atom
1089 TYPE(particle_type),
DIMENSION(:),
OPTIONAL, &
1090 POINTER :: particle_set
1091 TYPE(section_vals_type),
POINTER :: colvar_func_info
1092 LOGICAL,
INTENT(IN) :: use_clv_info
1093 INTEGER,
INTENT(INOUT) :: cind
1095 INTEGER :: ind, k, kk
1096 REAL(kind=
dp),
DIMENSION(:),
POINTER :: r_vals
1098 DO kk = 1,
SIZE(ilist)
1100 lcolv(kk)%init = .false.
1101 lcolv(kk)%lambda = 0.0_dp
1102 lcolv(kk)%sigma = 0.0_dp
1105 NULLIFY (lcolv(kk)%colvar, lcolv(kk)%colvar_old)
1107 CALL colvar_clone(lcolv(kk)%colvar, cons_info%colvar_set(k)%colvar, &
1108 i_atom_offset=first_atom - 1)
1117 IF (use_clv_info)
THEN
1119 i_rep_val=cind, r_vals=r_vals)
1120 SELECT CASE (lcolv(kk)%colvar%type_id)
1122 cpassert(
SIZE(r_vals) == 3)
1123 lcolv(kk)%colvar%xyz_diag_param%r0 = r_vals
1125 cpassert(
SIZE(r_vals) == 6)
1126 lcolv(kk)%colvar%xyz_outerdiag_param%r0(:, 1) = r_vals(1:3)
1127 lcolv(kk)%colvar%xyz_outerdiag_param%r0(:, 2) = r_vals(4:6)
1130 SELECT CASE (lcolv(kk)%colvar%type_id)
1132 ALLOCATE (r_vals(3))
1133 ind = first_atom - 1 + lcolv(kk)%colvar%xyz_diag_param%i_atom
1134 r_vals = particle_set(ind)%r
1135 lcolv(kk)%colvar%xyz_diag_param%r0 = r_vals
1137 ALLOCATE (r_vals(6))
1138 ind = first_atom - 1 + lcolv(kk)%colvar%xyz_outerdiag_param%i_atoms(1)
1139 r_vals(1:3) = particle_set(ind)%r
1140 ind = first_atom - 1 + lcolv(kk)%colvar%xyz_outerdiag_param%i_atoms(2)
1141 r_vals(4:6) = particle_set(ind)%r
1142 lcolv(kk)%colvar%xyz_outerdiag_param%r0(:, 1) = r_vals(1:3)
1143 lcolv(kk)%colvar%xyz_outerdiag_param%r0(:, 2) = r_vals(4:6)
1146 i_rep_val=cind, r_vals_ptr=r_vals)
1151 CALL colvar_clone(lcolv(kk)%colvar_old, lcolv(kk)%colvar)
1154 IF (any(lcolv(kk)%colvar%i_atom > last_atom) .OR. &
1155 any(lcolv(kk)%colvar%i_atom < first_atom))
THEN
1156 WRITE (*,
'(T5,"|",T8,A)')
"Error in constraints setup!"
1157 WRITE (*,
'(T5,"|",T8,A)')
"A constraint has been defined for a molecule type", &
1158 " but the atoms specified in the constraint and the atoms defined for", &
1159 " the molecule DO NOT match!", &
1160 "This could be very probable due to a wrong connectivity, or an error", &
1161 " in the constraint specification in the input file.", &
1162 " Please check it carefully!"
1166 END SUBROUTINE setup_lcolv
1178 SUBROUTINE setup_lg3x3(lg3x3, g3x3_list, first_atom, last_atom)
1179 TYPE(local_g3x3_constraint_type),
DIMENSION(:), &
1181 TYPE(g3x3_constraint_type),
DIMENSION(:),
POINTER :: g3x3_list
1182 INTEGER,
INTENT(IN) :: first_atom, last_atom
1186 DO kk = 1,
SIZE(lg3x3)
1187 lg3x3(kk)%init = .false.
1188 lg3x3(kk)%scale = 0.0_dp
1189 lg3x3(kk)%scale_old = 0.0_dp
1190 lg3x3(kk)%fa = 0.0_dp
1191 lg3x3(kk)%fb = 0.0_dp
1192 lg3x3(kk)%fc = 0.0_dp
1193 lg3x3(kk)%ra_old = 0.0_dp
1194 lg3x3(kk)%rb_old = 0.0_dp
1195 lg3x3(kk)%rc_old = 0.0_dp
1196 lg3x3(kk)%va = 0.0_dp
1197 lg3x3(kk)%vb = 0.0_dp
1198 lg3x3(kk)%vc = 0.0_dp
1199 lg3x3(kk)%lambda = 0.0_dp
1200 IF ((g3x3_list(kk)%a + first_atom - 1 < first_atom) .OR. &
1201 (g3x3_list(kk)%b + first_atom - 1 < first_atom) .OR. &
1202 (g3x3_list(kk)%c + first_atom - 1 < first_atom) .OR. &
1203 (g3x3_list(kk)%a + first_atom - 1 > last_atom) .OR. &
1204 (g3x3_list(kk)%b + first_atom - 1 > last_atom) .OR. &
1205 (g3x3_list(kk)%c + first_atom - 1 > last_atom))
THEN
1206 WRITE (*,
'(T5,"|",T8,A)')
"Error in constraints setup!"
1207 WRITE (*,
'(T5,"|",T8,A)')
"A constraint has been defined for a molecule type", &
1208 " but the atoms specified in the constraint and the atoms defined for", &
1209 " the molecule DO NOT match!", &
1210 "This could be very probable due to a wrong connectivity, or an error", &
1211 " in the constraint specification in the input file.", &
1212 " Please check it carefully!"
1217 END SUBROUTINE setup_lg3x3
1229 SUBROUTINE setup_lg4x6(lg4x6, g4x6_list, first_atom, last_atom)
1230 TYPE(local_g4x6_constraint_type),
DIMENSION(:), &
1232 TYPE(g4x6_constraint_type),
DIMENSION(:),
POINTER :: g4x6_list
1233 INTEGER,
INTENT(IN) :: first_atom, last_atom
1237 DO kk = 1,
SIZE(lg4x6)
1238 lg4x6(kk)%init = .false.
1239 lg4x6(kk)%scale = 0.0_dp
1240 lg4x6(kk)%scale_old = 0.0_dp
1241 lg4x6(kk)%fa = 0.0_dp
1242 lg4x6(kk)%fb = 0.0_dp
1243 lg4x6(kk)%fc = 0.0_dp
1244 lg4x6(kk)%fd = 0.0_dp
1245 lg4x6(kk)%fe = 0.0_dp
1246 lg4x6(kk)%ff = 0.0_dp
1247 lg4x6(kk)%ra_old = 0.0_dp
1248 lg4x6(kk)%rb_old = 0.0_dp
1249 lg4x6(kk)%rc_old = 0.0_dp
1250 lg4x6(kk)%rd_old = 0.0_dp
1251 lg4x6(kk)%re_old = 0.0_dp
1252 lg4x6(kk)%rf_old = 0.0_dp
1253 lg4x6(kk)%va = 0.0_dp
1254 lg4x6(kk)%vb = 0.0_dp
1255 lg4x6(kk)%vc = 0.0_dp
1256 lg4x6(kk)%vd = 0.0_dp
1257 lg4x6(kk)%ve = 0.0_dp
1258 lg4x6(kk)%vf = 0.0_dp
1259 lg4x6(kk)%lambda = 0.0_dp
1260 IF ((g4x6_list(kk)%a + first_atom - 1 < first_atom) .OR. &
1261 (g4x6_list(kk)%b + first_atom - 1 < first_atom) .OR. &
1262 (g4x6_list(kk)%c + first_atom - 1 < first_atom) .OR. &
1263 (g4x6_list(kk)%d + first_atom - 1 < first_atom) .OR. &
1264 (g4x6_list(kk)%a + first_atom - 1 > last_atom) .OR. &
1265 (g4x6_list(kk)%b + first_atom - 1 > last_atom) .OR. &
1266 (g4x6_list(kk)%c + first_atom - 1 > last_atom) .OR. &
1267 (g4x6_list(kk)%d + first_atom - 1 > last_atom))
THEN
1268 WRITE (*,
'(T5,"|",T8,A)')
"Error in constraints setup!"
1269 WRITE (*,
'(T5,"|",T8,A)')
"A constrained has been defined for a molecule type", &
1270 " but the atoms specified in the constraint and the atoms defined for", &
1271 " the molecule DO NOT match!", &
1272 "This could be very probable due to a wrong connectivity, or an error", &
1273 " in the constraint specification in the input file.", &
1274 " Please check it carefully!"
1279 END SUBROUTINE setup_lg4x6
1295 SUBROUTINE give_constraint_array(const_mol, const_molname, const_intermolecular, &
1296 constr_x_mol, constr_x_glob, molecule_kind_set, exclude_qm, exclude_mm)
1298 INTEGER,
DIMENSION(:),
POINTER :: const_mol
1299 CHARACTER(LEN=default_string_length), &
1300 DIMENSION(:),
POINTER :: const_molname
1301 LOGICAL,
DIMENSION(:),
POINTER :: const_intermolecular
1303 INTEGER,
DIMENSION(:),
POINTER :: constr_x_glob
1304 TYPE(molecule_kind_type),
DIMENSION(:),
POINTER :: molecule_kind_set
1305 LOGICAL,
DIMENSION(:),
POINTER :: exclude_qm, exclude_mm
1307 CHARACTER(len=*),
PARAMETER :: routinen =
'give_constraint_array'
1309 CHARACTER(LEN=default_string_length) :: myname, name
1310 INTEGER :: handle, i, iglob, isize, k
1311 LOGICAL :: found_molname, is_qm
1312 TYPE(molecule_kind_type),
POINTER :: molecule_kind
1314 CALL timeset(routinen, handle)
1315 NULLIFY (molecule_kind)
1316 ALLOCATE (constr_x_mol(
SIZE(molecule_kind_set)))
1317 DO i = 1,
SIZE(constr_x_mol)
1318 NULLIFY (constr_x_mol(i)%constr)
1319 ALLOCATE (constr_x_mol(i)%constr(0))
1321 cpassert(
SIZE(const_mol) ==
SIZE(const_molname))
1323 DO i = 1,
SIZE(const_mol)
1324 IF (const_intermolecular(i))
THEN
1327 CALL reallocate(constr_x_glob, 1, iglob)
1328 constr_x_glob(iglob) = i
1331 IF (const_mol(i) /= 0)
THEN
1333 IF (k >
SIZE(molecule_kind_set)) &
1334 CALL cp_abort(__location__, &
1335 "A constraint has been specified providing the molecule index. But the"// &
1336 " molecule index ("//cp_to_string(k)//
") is out of range of the possible"// &
1337 " molecule kinds ("//cp_to_string(
SIZE(molecule_kind_set))//
").")
1338 isize =
SIZE(constr_x_mol(k)%constr)
1339 CALL reallocate(constr_x_mol(k)%constr, 1, isize + 1)
1340 constr_x_mol(k)%constr(isize + 1) = i
1342 myname = const_molname(i)
1343 found_molname = .false.
1344 DO k = 1,
SIZE(molecule_kind_set)
1345 molecule_kind => molecule_kind_set(k)
1346 name = molecule_kind%name
1348 IF (is_qm .AND. exclude_qm(i)) cycle
1349 IF (.NOT. is_qm .AND. exclude_mm(i)) cycle
1350 IF (name == myname)
THEN
1351 isize =
SIZE(constr_x_mol(k)%constr)
1352 CALL reallocate(constr_x_mol(k)%constr, 1, isize + 1)
1353 constr_x_mol(k)%constr(isize + 1) = i
1354 found_molname = .true.
1357 CALL print_warning_molname(found_molname, myname)
1361 CALL timestop(handle)
1362 END SUBROUTINE give_constraint_array
1370 SUBROUTINE print_warning_molname(found, name)
1371 LOGICAL,
INTENT(IN) :: found
1372 CHARACTER(LEN=*),
INTENT(IN) :: name
1375 CALL cp_warn(__location__, &
1376 " MOLNAME ("//trim(name)//
") was defined for constraints, but this molecule name "// &
1377 "is not defined. Please check carefully your PDB, PSF (has priority over PDB) or "// &
1378 "input driven CP2K coordinates. In case you may not find the reason for this warning "// &
1379 "it may be a good idea to print all molecule information (including kind name) activating "// &
1380 "the print_key MOLECULES specific of the SUBSYS%PRINT section. ")
1382 END SUBROUTINE print_warning_molname
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.
elemental logical function, public is_hydrogen(atomic_kind)
Determines if the atomic_kind is HYDROGEN.
Handles all functions related to the CELL.
integer, parameter, public use_perd_xyz
integer, parameter, public use_perd_y
integer, parameter, public use_perd_xz
integer, parameter, public use_perd_x
integer, parameter, public use_perd_z
integer, parameter, public use_perd_yz
integer, parameter, public use_perd_xy
defines collective variables s({R}) and the derivative of this variable wrt R these can then be used ...
subroutine, public colvar_eval_mol_f(colvar, cell, particles, pos, fixd_list)
evaluates the derivatives (dsdr) given and due to the given colvar variables in a molecular environme...
Initialize the collective variables types.
recursive subroutine, public colvar_release(colvar)
releases the memory that might have been allocated by the colvar
integer, parameter, public xyz_outerdiag_colvar_id
subroutine, public colvar_create(colvar, colvar_id)
initializes a colvar_param type
recursive subroutine, public colvar_clone(colvar_out, colvar_in, i_atom_offset)
Clone a colvar type.
subroutine, public colvar_p_reallocate(colvar_set, lb1_new, ub1_new)
Change the dimension of a colvar_p_type.
integer, parameter, public dist_colvar_id
subroutine, public colvar_setup(colvar)
Finalize the setup of the collective variable.
integer, parameter, public torsion_colvar_id
integer, parameter, public xyz_diag_colvar_id
evaluations of colvar for internal coordinates schemes
subroutine, public post_process_colvar(colvar, particles)
Complete the description of the COORDINATION colvar when defined using KINDS.
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Utility routines for the memory handling.
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 setup_colvar_counters(colv_list, ncolv)
...
subroutine, public set_molecule_kind(molecule_kind, name, mass, charge, kind_number, molecule_list, atom_list, nbond, bond_list, nbend, bend_list, nub, ub_list, nimpr, impr_list, nopbend, opbend_list, ntorsion, torsion_list, fixd_list, ncolv, colv_list, ng3x3, g3x3_list, ng4x6, nfixd, g4x6_list, nvsite, vsite_list, ng3x3_restraint, ng4x6_restraint, nfixd_restraint, nshell, shell_list, nvsite_restraint, bond_kind_set, bend_kind_set, ub_kind_set, torsion_kind_set, impr_kind_set, opbend_kind_set, nelectron, nsgf, molname_generated)
Set the components of a molecule kind.
Define the data structure for the molecule information.
subroutine, public get_molecule(molecule, molecule_kind, lmi, lci, lg3x3, lg4x6, lcolv, first_atom, last_atom, first_shell, last_shell)
Get components from a molecule data set.
subroutine, public set_molecule(molecule, molecule_kind, lmi, lci, lcolv, lg3x3, lg4x6)
Set a molecule data set.
Define the data structure for the particle information.
logical function, public qmmm_ff_precond_only_qm(id1, id2, id3, id4, is_link)
This function handles the atom names and modifies the "_QM_" prefix, in order to find the parameters ...
Collection of subroutine needed for topology related things.
subroutine, public topology_constraint_pack(molecule_kind_set, molecule_set, topology, qmmm_env, particle_set, input_file, subsys_section, gci)
Pack in all the information needed for the constraints.
Control for reading in different topologies and coordinates.