29 USE mathlib,
ONLY: invert_matrix
33 fixd_constraint_type,&
38 global_constraint_type,&
39 local_colvar_constraint_type,&
46 #include "./base/base_uses.f90"
57 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'colvar_utils'
70 TYPE(force_env_type),
POINTER :: force_env
71 LOGICAL,
INTENT(IN),
OPTIONAL :: only_intra_colvar, unique
74 CHARACTER(LEN=*),
PARAMETER :: routinen =
'number_of_colvar'
76 INTEGER :: handle, ikind, imol
77 LOGICAL :: my_unique, skip_inter_colvar
78 TYPE(colvar_counters) :: ncolv
79 TYPE(cp_subsys_type),
POINTER :: subsys
80 TYPE(global_constraint_type),
POINTER :: gci
81 TYPE(molecule_kind_list_type),
POINTER :: molecule_kinds
82 TYPE(molecule_kind_type),
POINTER :: molecule_kind, molecule_kind_set(:)
83 TYPE(molecule_list_type),
POINTER :: molecules
84 TYPE(molecule_type),
POINTER :: molecule, molecule_set(:)
86 NULLIFY (subsys, molecules, molecule_kind, molecule, molecule_set, gci)
87 CALL timeset(routinen, handle)
88 skip_inter_colvar = .false.
90 IF (
PRESENT(only_intra_colvar)) skip_inter_colvar = only_intra_colvar
91 IF (
PRESENT(unique)) my_unique = unique
94 CALL cp_subsys_get(subsys=subsys, molecules=molecules, gci=gci, &
95 molecule_kinds=molecule_kinds)
97 molecule_set => molecules%els
100 molecule_kind_set => molecule_kinds%els
101 DO ikind = 1, molecule_kinds%n_els
102 molecule_kind => molecule_kind_set(ikind)
104 ntot = ntot + ncolv%ntot
107 mol:
DO imol = 1,
SIZE(molecule_set)
108 molecule => molecule_set(imol)
109 molecule_kind => molecule%molecule_kind
113 ntot = ntot + ncolv%ntot
117 IF (.NOT. skip_inter_colvar)
THEN
118 IF (
ASSOCIATED(gci))
THEN
119 ntot = ntot + gci%ncolv%ntot
122 CALL timestop(handle)
133 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: targets
134 TYPE(force_env_type),
POINTER :: force_env
136 CHARACTER(LEN=*),
PARAMETER :: routinen =
'set_colvars_target'
138 INTEGER :: handle, i, ikind, ind, nkind
139 TYPE(cell_type),
POINTER :: cell
140 TYPE(colvar_constraint_type),
DIMENSION(:), &
142 TYPE(colvar_counters) :: ncolv
143 TYPE(cp_subsys_type),
POINTER :: subsys
144 TYPE(global_constraint_type),
POINTER :: gci
145 TYPE(molecule_kind_list_type),
POINTER :: molecule_kinds
146 TYPE(molecule_kind_type),
POINTER :: molecule_kind
148 NULLIFY (cell, subsys, molecule_kinds, molecule_kind, gci, colv_list)
149 CALL timeset(routinen, handle)
150 CALL force_env_get(force_env=force_env, subsys=subsys, cell=cell)
151 CALL cp_subsys_get(subsys=subsys, gci=gci, molecule_kinds=molecule_kinds)
153 nkind = molecule_kinds%n_els
155 mol:
DO ikind = 1, nkind
156 molecule_kind => molecule_kinds%els(ikind)
158 colv_list=colv_list, &
160 IF (ncolv%ntot /= 0)
THEN
161 DO i = 1,
SIZE(colv_list)
162 ind = colv_list(i)%inp_seq_num
163 colv_list(i)%expected_value = targets(ind)
168 IF (
ASSOCIATED(gci))
THEN
169 IF (gci%ncolv%ntot /= 0)
THEN
170 colv_list => gci%colv_list
171 DO i = 1,
SIZE(colv_list)
172 ind = colv_list(i)%inp_seq_num
173 colv_list(i)%expected_value = targets(ind)
177 CALL timestop(handle)
191 SUBROUTINE eval_colvar(force_env, coords, cvalues, Bmatrix, MassI, Amatrix)
193 TYPE(force_env_type),
POINTER :: force_env
194 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN),
OPTIONAL :: coords
195 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: cvalues
196 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: bmatrix
197 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: massi
198 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: amatrix
200 CHARACTER(LEN=*),
PARAMETER :: routinen =
'eval_colvar'
202 INTEGER :: handle, i, ikind, imol, n_tot, natom, &
203 nkind, nmol_per_kind, offset
204 INTEGER,
DIMENSION(:),
POINTER :: map, wrk
206 REAL(kind=
dp) :: inv_error
207 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: bwrk, gmatrix, gmatrix_i
208 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rwrk
209 TYPE(cell_type),
POINTER :: cell
210 TYPE(colvar_counters) :: ncolv
211 TYPE(cp_subsys_type),
POINTER :: subsys
212 TYPE(distribution_1d_type),
POINTER :: local_molecules
213 TYPE(global_constraint_type),
POINTER :: gci
214 TYPE(molecule_kind_list_type),
POINTER :: molecule_kinds
215 TYPE(molecule_kind_type),
POINTER :: molecule_kind
216 TYPE(molecule_list_type),
POINTER :: molecules
217 TYPE(molecule_type),
POINTER :: molecule, molecule_set(:)
218 TYPE(particle_list_type),
POINTER :: particles
219 TYPE(particle_type),
POINTER :: particle_set(:)
221 NULLIFY (cell, subsys, local_molecules, molecule_kinds, &
222 molecules, molecule_kind, molecule, &
223 molecule_set, particles, particle_set, gci)
224 IF (
PRESENT(bmatrix))
THEN
225 check =
ASSOCIATED(bmatrix)
229 CALL timeset(routinen, handle)
230 ALLOCATE (map(
SIZE(cvalues)))
232 CALL force_env_get(force_env=force_env, subsys=subsys, cell=cell)
236 particles=particles, &
237 molecules=molecules, &
238 local_molecules=local_molecules, &
240 molecule_kinds=molecule_kinds)
242 nkind = molecule_kinds%n_els
243 particle_set => particles%els
244 molecule_set => molecules%els
247 mol:
DO ikind = 1, nkind
248 nmol_per_kind = local_molecules%n_el(ikind)
249 DO imol = 1, nmol_per_kind
250 i = local_molecules%list(ikind)%array(imol)
251 molecule => molecule_set(i)
252 molecule_kind => molecule%molecule_kind
256 offset = get_colvar_offset(i, molecule_set)
258 IF (ncolv%ntot /= 0)
THEN
259 CALL eval_colv_int(molecule, particle_set, coords, cell, cvalues, &
260 bmatrix, offset, n_tot, map)
264 CALL force_env%para_env%sum(n_tot)
265 CALL force_env%para_env%sum(cvalues)
266 IF (
PRESENT(bmatrix))
CALL force_env%para_env%sum(bmatrix)
270 IF (
ASSOCIATED(gci))
THEN
271 IF (gci%ncolv%ntot /= 0)
THEN
272 CALL eval_colv_ext(gci, particle_set, coords, cell, cvalues, &
273 bmatrix, offset, n_tot, map)
276 cpassert(n_tot ==
SIZE(cvalues))
279 ALLOCATE (wrk(
SIZE(cvalues)))
280 ALLOCATE (rwrk(
SIZE(cvalues)))
281 CALL sort(map,
SIZE(map), wrk)
284 cvalues(i) = rwrk(wrk(i))
287 IF (
PRESENT(bmatrix))
THEN
288 check = n_tot ==
SIZE(bmatrix, 2)
290 ALLOCATE (bwrk(
SIZE(bmatrix, 1),
SIZE(bmatrix, 2)))
293 bmatrix(:, i) = bwrk(:, wrk(i))
301 IF (
PRESENT(bmatrix) .AND.
PRESENT(amatrix))
THEN
302 cpassert(
ASSOCIATED(amatrix))
303 check =
SIZE(bmatrix, 1) ==
SIZE(amatrix, 2)
305 check =
SIZE(bmatrix, 2) ==
SIZE(amatrix, 1)
307 ALLOCATE (gmatrix(n_tot, n_tot))
308 ALLOCATE (gmatrix_i(n_tot, n_tot))
309 gmatrix(:, :) = matmul(transpose(bmatrix), bmatrix)
310 CALL invert_matrix(gmatrix, gmatrix_i, inv_error)
311 IF (abs(inv_error) > 1.0e-8_dp) &
312 cpwarn(
"Error in inverting the Gmatrix larger than 1.0E-8!")
313 amatrix = matmul(gmatrix_i, transpose(bmatrix))
314 DEALLOCATE (gmatrix_i)
317 IF (
PRESENT(massi))
THEN
318 natom =
SIZE(particle_set)
319 cpassert(
ASSOCIATED(massi))
320 cpassert(
SIZE(massi) == natom*3)
322 massi((i - 1)*3 + 1) = 1.0_dp/particle_set(i)%atomic_kind%mass
323 massi((i - 1)*3 + 2) = 1.0_dp/particle_set(i)%atomic_kind%mass
324 massi((i - 1)*3 + 3) = 1.0_dp/particle_set(i)%atomic_kind%mass
327 CALL timestop(handle)
338 FUNCTION get_colvar_offset(i, molecule_set)
RESULT(offset)
339 INTEGER,
INTENT(IN) :: i
340 TYPE(molecule_type),
POINTER :: molecule_set(:)
344 TYPE(colvar_counters) :: ncolv
345 TYPE(molecule_kind_type),
POINTER :: molecule_kind
346 TYPE(molecule_type),
POINTER :: molecule
350 molecule => molecule_set(j)
351 molecule_kind => molecule%molecule_kind
354 offset = offset + ncolv%ntot
357 END FUNCTION get_colvar_offset
372 SUBROUTINE eval_colv_int(molecule, particle_set, coords, cell, cvalues, &
373 Bmatrix, offset, n_tot, map)
375 TYPE(molecule_type),
POINTER :: molecule
376 TYPE(particle_type),
POINTER :: particle_set(:)
377 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN),
OPTIONAL :: coords
378 TYPE(cell_type),
POINTER :: cell
379 REAL(kind=
dp),
DIMENSION(:),
INTENT(INOUT) :: cvalues
380 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: bmatrix
381 INTEGER,
INTENT(IN) :: offset
382 INTEGER,
INTENT(INOUT) :: n_tot
383 INTEGER,
DIMENSION(:),
POINTER :: map
385 TYPE(colvar_constraint_type),
POINTER :: colv_list(:)
386 TYPE(fixd_constraint_type),
DIMENSION(:),
POINTER :: fixd_list
387 TYPE(local_colvar_constraint_type),
POINTER :: lcolv(:)
388 TYPE(molecule_kind_type),
POINTER :: molecule_kind
392 molecule_kind => molecule%molecule_kind
395 CALL eval_colv_low(colv_list, fixd_list, lcolv, particle_set, &
396 coords, cell, cvalues, bmatrix, offset, n_tot, map)
398 END SUBROUTINE eval_colv_int
413 SUBROUTINE eval_colv_ext(gci, particle_set, coords, cell, cvalues, &
414 Bmatrix, offset, n_tot, map)
415 TYPE(global_constraint_type),
POINTER :: gci
416 TYPE(particle_type),
POINTER :: particle_set(:)
417 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN),
OPTIONAL :: coords
418 TYPE(cell_type),
POINTER :: cell
419 REAL(kind=
dp),
DIMENSION(:),
INTENT(INOUT) :: cvalues
420 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: bmatrix
421 INTEGER,
INTENT(IN) :: offset
422 INTEGER,
INTENT(INOUT) :: n_tot
423 INTEGER,
DIMENSION(:),
POINTER :: map
425 TYPE(colvar_constraint_type),
POINTER :: colv_list(:)
426 TYPE(fixd_constraint_type),
DIMENSION(:),
POINTER :: fixd_list
427 TYPE(local_colvar_constraint_type),
POINTER :: lcolv(:)
429 colv_list => gci%colv_list
430 fixd_list => gci%fixd_list
432 CALL eval_colv_low(colv_list, fixd_list, lcolv, particle_set, &
433 coords, cell, cvalues, bmatrix, offset, n_tot, map)
435 END SUBROUTINE eval_colv_ext
454 SUBROUTINE eval_colv_low(colv_list, fixd_list, lcolv, particle_set, coords, &
455 cell, cvalues, Bmatrix, offset, n_tot, map)
457 TYPE(colvar_constraint_type),
POINTER :: colv_list(:)
458 TYPE(fixd_constraint_type),
DIMENSION(:),
POINTER :: fixd_list
459 TYPE(local_colvar_constraint_type),
POINTER :: lcolv(:)
460 TYPE(particle_type),
POINTER :: particle_set(:)
461 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN),
OPTIONAL :: coords
462 TYPE(cell_type),
POINTER :: cell
463 REAL(kind=
dp),
DIMENSION(:),
INTENT(INOUT) :: cvalues
464 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: bmatrix
465 INTEGER,
INTENT(IN) :: offset
466 INTEGER,
INTENT(INOUT) :: n_tot
467 INTEGER,
DIMENSION(:),
POINTER :: map
469 INTEGER :: iatm, iconst, ind, ival
472 DO iconst = 1,
SIZE(colv_list)
476 IF (
PRESENT(coords))
THEN
478 pos=reshape(coords, (/3,
SIZE(particle_set)/)), fixd_list=fixd_list)
483 cvalues(ival) = lcolv(iconst)%colvar%ss
484 map(ival) = colv_list(iconst)%inp_seq_num
486 IF (
PRESENT(bmatrix))
THEN
487 DO iatm = 1,
SIZE(lcolv(iconst)%colvar%i_atom)
488 ind = (lcolv(iconst)%colvar%i_atom(iatm) - 1)*3
489 bmatrix(ind + 1, ival) = lcolv(iconst)%colvar%dsdr(1, iatm)
490 bmatrix(ind + 2, ival) = lcolv(iconst)%colvar%dsdr(2, iatm)
491 bmatrix(ind + 3, ival) = lcolv(iconst)%colvar%dsdr(3, iatm)
496 END SUBROUTINE eval_colv_low
510 SUBROUTINE get_clv_force(force_env, forces, coords, nsize_xyz, nsize_int, cvalues, &
512 TYPE(force_env_type),
POINTER :: force_env
513 REAL(kind=
dp),
DIMENSION(:),
INTENT(INOUT), &
514 OPTIONAL :: forces, coords
515 INTEGER,
INTENT(IN) :: nsize_xyz, nsize_int
516 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: cvalues, mmatrix
520 REAL(kind=
dp),
DIMENSION(:),
POINTER :: massi, wrk
521 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: amatrix, bmatrix
523 ALLOCATE (bmatrix(nsize_xyz, nsize_int))
524 ALLOCATE (massi(nsize_xyz))
526 IF (
PRESENT(forces))
THEN
527 ALLOCATE (wrk(nsize_int))
528 ALLOCATE (amatrix(nsize_int, nsize_xyz))
530 CALL eval_colvar(force_env, coords, cvalues, bmatrix, massi, amatrix)
531 wrk = matmul(amatrix, forces)
533 forces(1:nsize_int) = wrk
538 CALL eval_colvar(force_env, coords, cvalues, bmatrix, massi)
545 tmp = tmp + bmatrix(k, j)*massi(k)*bmatrix(k, i)
547 mmatrix((i - 1)*nsize_int + j) = tmp
548 mmatrix((j - 1)*nsize_int + i) = tmp
566 TYPE(colvar_type),
POINTER :: colvar
567 TYPE(particle_type),
DIMENSION(:),
OPTIONAL, &
570 CHARACTER(len=3) :: name_kind
571 INTEGER :: i, ii, j, natoms, nkinds, nr_frame, stat
573 natoms =
SIZE(particles)
575 IF (colvar%coord_param%use_kinds_from .OR. colvar%coord_param%use_kinds_to)
THEN
577 IF (colvar%coord_param%use_kinds_from)
THEN
578 colvar%coord_param%use_kinds_from = .false.
579 nkinds =
SIZE(colvar%coord_param%c_kinds_from)
582 name_kind = trim(particles(i)%atomic_kind%name)
584 IF (trim(colvar%coord_param%c_kinds_from(j)) == name_kind)
THEN
585 CALL reallocate(colvar%coord_param%i_at_from, 1, colvar%coord_param%n_atoms_from + 1)
586 colvar%coord_param%n_atoms_from = colvar%coord_param%n_atoms_from + 1
587 colvar%coord_param%i_at_from(colvar%coord_param%n_atoms_from) = i
591 stat = colvar%coord_param%n_atoms_from
595 IF (colvar%coord_param%use_kinds_to)
THEN
596 colvar%coord_param%use_kinds_to = .false.
597 nkinds =
SIZE(colvar%coord_param%c_kinds_to)
600 name_kind = trim(particles(i)%atomic_kind%name)
602 IF (trim(colvar%coord_param%c_kinds_to(j)) == name_kind)
THEN
603 CALL reallocate(colvar%coord_param%i_at_to, 1, colvar%coord_param%n_atoms_to + 1)
604 colvar%coord_param%n_atoms_to = colvar%coord_param%n_atoms_to + 1
605 colvar%coord_param%i_at_to(colvar%coord_param%n_atoms_to) = i
609 stat = colvar%coord_param%n_atoms_to
613 IF (colvar%coord_param%use_kinds_to_b)
THEN
614 colvar%coord_param%use_kinds_to_b = .false.
615 nkinds =
SIZE(colvar%coord_param%c_kinds_to_b)
618 name_kind = trim(particles(i)%atomic_kind%name)
620 IF (trim(colvar%coord_param%c_kinds_to_b(j)) == name_kind)
THEN
621 CALL reallocate(colvar%coord_param%i_at_to_b, 1, colvar%coord_param%n_atoms_to_b + 1)
622 colvar%coord_param%n_atoms_to_b = colvar%coord_param%n_atoms_to_b + 1
623 colvar%coord_param%i_at_to_b(colvar%coord_param%n_atoms_to_b) = i
627 stat = colvar%coord_param%n_atoms_to_b
637 IF (colvar%mindist_param%use_kinds_from .OR. colvar%mindist_param%use_kinds_to)
THEN
639 IF (colvar%mindist_param%use_kinds_from)
THEN
640 colvar%mindist_param%use_kinds_from = .false.
641 nkinds =
SIZE(colvar%mindist_param%k_coord_from)
644 name_kind = trim(particles(i)%atomic_kind%name)
646 IF (trim(colvar%mindist_param%k_coord_from(j)) == name_kind)
THEN
647 CALL reallocate(colvar%mindist_param%i_coord_from, 1, colvar%mindist_param%n_coord_from + 1)
648 colvar%mindist_param%n_coord_from = colvar%mindist_param%n_coord_from + 1
649 colvar%mindist_param%i_coord_from(colvar%mindist_param%n_coord_from) = i
653 stat = colvar%mindist_param%n_coord_from
657 IF (colvar%mindist_param%use_kinds_to)
THEN
658 colvar%mindist_param%use_kinds_to = .false.
659 nkinds =
SIZE(colvar%mindist_param%k_coord_to)
662 name_kind = trim(particles(i)%atomic_kind%name)
664 IF (trim(colvar%mindist_param%k_coord_to(j)) == name_kind)
THEN
665 CALL reallocate(colvar%mindist_param%i_coord_to, 1, colvar%mindist_param%n_coord_to + 1)
666 colvar%mindist_param%n_coord_to = colvar%mindist_param%n_coord_to + 1
667 colvar%mindist_param%i_coord_to(colvar%mindist_param%n_coord_to) = i
671 stat = colvar%mindist_param%n_coord_to
681 IF (colvar%population_param%use_kinds_from .OR. colvar%population_param%use_kinds_to)
THEN
683 IF (colvar%population_param%use_kinds_from)
THEN
684 colvar%population_param%use_kinds_from = .false.
685 nkinds =
SIZE(colvar%population_param%c_kinds_from)
688 name_kind = trim(particles(i)%atomic_kind%name)
690 IF (trim(colvar%population_param%c_kinds_from(j)) == name_kind)
THEN
691 CALL reallocate(colvar%population_param%i_at_from, 1, colvar%population_param%n_atoms_from + 1)
692 colvar%population_param%n_atoms_from = colvar%population_param%n_atoms_from + 1
693 colvar%population_param%i_at_from(colvar%population_param%n_atoms_from) = i
697 stat = colvar%population_param%n_atoms_from
701 IF (colvar%population_param%use_kinds_to)
THEN
702 colvar%population_param%use_kinds_to = .false.
703 nkinds =
SIZE(colvar%population_param%c_kinds_to)
706 name_kind = trim(particles(i)%atomic_kind%name)
708 IF (trim(colvar%population_param%c_kinds_to(j)) == name_kind)
THEN
709 CALL reallocate(colvar%population_param%i_at_to, 1, colvar%population_param%n_atoms_to + 1)
710 colvar%population_param%n_atoms_to = colvar%population_param%n_atoms_to + 1
711 colvar%population_param%i_at_to(colvar%population_param%n_atoms_to) = i
715 stat = colvar%population_param%n_atoms_to
726 IF (colvar%gyration_param%use_kinds)
THEN
728 IF (colvar%gyration_param%use_kinds)
THEN
729 colvar%gyration_param%use_kinds = .false.
730 nkinds =
SIZE(colvar%gyration_param%c_kinds)
733 name_kind = trim(particles(i)%atomic_kind%name)
735 IF (trim(colvar%gyration_param%c_kinds(j)) == name_kind)
THEN
736 CALL reallocate(colvar%gyration_param%i_at, 1, colvar%gyration_param%n_atoms + 1)
737 colvar%gyration_param%n_atoms = colvar%gyration_param%n_atoms + 1
738 colvar%gyration_param%i_at(colvar%gyration_param%n_atoms) = i
742 stat = colvar%gyration_param%n_atoms
751 IF (colvar%rmsd_param%subset ==
rmsd_all .OR. colvar%rmsd_param%subset ==
rmsd_list)
THEN
753 DO i = 1,
SIZE(colvar%rmsd_param%i_rmsd)
754 ii = colvar%rmsd_param%i_rmsd(i)
755 colvar%rmsd_param%weights(ii) = particles(ii)%atomic_kind%mass
759 IF (colvar%rmsd_param%align_frames)
THEN
760 nr_frame =
SIZE(colvar%rmsd_param%r_ref, 2)
762 CALL rmsd3(particles, colvar%rmsd_param%r_ref(:, i), colvar%rmsd_param%r_ref(:, 1), -1, &
770 IF (colvar%reaction_path_param%dist_rmsd .OR. colvar%reaction_path_param%rmsd)
THEN
771 IF (colvar%reaction_path_param%align_frames)
THEN
772 nr_frame = colvar%reaction_path_param%nr_frames
774 CALL rmsd3(particles, colvar%reaction_path_param%r_ref(:, i), colvar%reaction_path_param%r_ref(:, 1), -1, &
Handles all functions related to the CELL.
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.
integer, parameter, public population_colvar_id
integer, parameter, public distance_from_path_colvar_id
integer, parameter, public rmsd_colvar_id
integer, parameter, public mindist_colvar_id
integer, parameter, public gyration_colvar_id
integer, parameter, public coord_colvar_id
subroutine, public colvar_setup(colvar)
Finalize the setup of the collective variable.
integer, parameter, public reaction_path_colvar_id
evaluations of colvar for internal coordinates schemes
subroutine, public eval_colvar(force_env, coords, cvalues, Bmatrix, MassI, Amatrix)
Computes the values of colvars and the Wilson matrix B and its invers A.
subroutine, public get_clv_force(force_env, forces, coords, nsize_xyz, nsize_int, cvalues, Mmatrix)
Computes the forces in the frame of collective variables, and additional also the local metric tensor...
subroutine, public post_process_colvar(colvar, particles)
Complete the description of the COORDINATION colvar when defined using KINDS.
integer function, public number_of_colvar(force_env, only_intra_colvar, unique)
Gives back the number of colvar defined for a force_eval.
subroutine, public set_colvars_target(targets, force_env)
Set the value of target for constraints/restraints.
types that represent a subsys, i.e. a part of the system
subroutine, public cp_subsys_get(subsys, ref_count, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell)
returns information about various attributes of the given subsys
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
Interface for the force calculations.
recursive subroutine, public force_env_get(force_env, in_use, fist_env, qs_env, meta_env, fp_env, subsys, para_env, potential_energy, additional_potential, kinetic_energy, harmonic_shell, kinetic_shell, cell, sub_force_env, qmmm_env, qmmmx_env, eip_env, pwdft_env, globenv, input, force_env_section, method_name_id, root_section, mixed_env, nnp_env, embed_env)
returns various attributes about the force environment
Defines the basic variable types.
integer, parameter, public dp
Collection of simple mathematical functions and subroutines.
Utility routines for the memory handling.
represent a simple array based list of the given type
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.
represent a simple array based list of the given type
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.
represent a simple array based list of the given type
Define the data structure for the particle information.
Defines functions to perform rmsd in 3D.
subroutine, public rmsd3(particle_set, r, r0, output_unit, weights, my_val, rotate, transl, rot, drmsd3)
Computes the RMSD in 3D. Provides also derivatives.
Utilities for string manipulations.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
All kind of helpful little routines.