67#include "./base/base_uses.f90"
72 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .false.
73 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'cp_subsys_methods'
94 root_section, force_env_section, subsys_section, &
95 use_motion_section, qmmm, qmmm_env, exclusions, elkind)
100 LOGICAL,
INTENT(IN),
OPTIONAL :: use_motion_section
101 LOGICAL,
OPTIONAL :: qmmm
104 POINTER :: exclusions
105 LOGICAL,
INTENT(IN),
OPTIONAL :: elkind
107 INTEGER :: stress_tensor
108 INTEGER,
DIMENSION(:),
POINTER :: seed_vals
109 LOGICAL :: atomic_energy, my_use_motion_section, &
110 pv_availability, pv_diagonal, &
123 cpassert(.NOT.
ASSOCIATED(subsys))
126 CALL para_env%retain()
127 subsys%para_env => para_env
129 my_use_motion_section = .false.
130 IF (
PRESENT(use_motion_section)) &
131 my_use_motion_section = use_motion_section
134 IF (
PRESENT(force_env_section)) &
135 my_force_env_section => force_env_section
138 IF (
PRESENT(subsys_section)) &
139 my_subsys_section => subsys_section
142 IF (
SIZE(seed_vals) == 1)
THEN
143 subsys%seed(:, :) = real(seed_vals(1), kind=
dp)
144 ELSE IF (
SIZE(seed_vals) == 6)
THEN
145 subsys%seed(1:3, 1:2) = reshape(real(seed_vals(:), kind=
dp), (/3, 2/))
147 cpabort(
"Supply exactly 1 or 6 arguments for SEED in &SUBSYS only!")
152 CALL cp_subsys_read_colvar(subsys, colvar_section)
156 CALL topology_control(atomic_kind_set, particle_set, molecule_kind_set, molecule_set, &
157 subsys%colvar_p, subsys%gci, root_section, para_env, &
158 force_env_section=my_force_env_section, &
159 subsys_section=my_subsys_section, use_motion_section=my_use_motion_section, &
160 qmmm=qmmm, qmmm_env=qmmm_env, exclusions=exclusions, elkind=elkind)
167 CALL cp_subsys_set(subsys, particles=particles, atomic_kinds=atomic_kinds, &
168 molecules=mols, molecule_kinds=mol_kinds)
177 SELECT CASE (stress_tensor)
179 pv_availability = .false.
180 pv_numerical = .false.
181 pv_diagonal = .false.
183 pv_availability = .true.
184 pv_numerical = .false.
185 pv_diagonal = .false.
187 pv_availability = .true.
188 pv_numerical = .true.
189 pv_diagonal = .false.
191 pv_availability = .true.
192 pv_numerical = .false.
195 pv_availability = .true.
196 pv_numerical = .true.
200 ALLOCATE (subsys%virial)
202 pv_availability=pv_availability, &
203 pv_numer=pv_numerical, &
204 pv_diagonal=pv_diagonal)
208 CALL section_vals_val_get(my_force_env_section,
"PROPERTIES%ATOMIC%ENERGY", l_val=atomic_energy)
209 subsys%atprop%energy = atomic_energy
221 SUBROUTINE cp_subsys_read_colvar(subsys, colvar_section)
228 ALLOCATE (subsys%colvar_p(ncol))
230 NULLIFY (subsys%colvar_p(ig)%colvar)
231 CALL colvar_read(subsys%colvar_p(ig)%colvar, ig, colvar_section, subsys%para_env)
233 END SUBROUTINE cp_subsys_read_colvar
256 small_para_env, sub_atom_index, sub_atom_kind_name, &
257 para_env, force_env_section, subsys_section, ignore_outside_box)
262 INTEGER,
DIMENSION(:),
INTENT(in) :: sub_atom_index
263 CHARACTER(len=default_string_length), &
264 DIMENSION(:),
INTENT(in) :: sub_atom_kind_name
267 LOGICAL,
INTENT(in),
OPTIONAL :: ignore_outside_box
269 CHARACTER(len=default_string_length) :: my_element, strtmp1
270 INTEGER :: iat, id_, nat
281 NULLIFY (mol_kinds, mols, particles, atomic_kinds, atomic_kind_set, particle_set, &
282 molecule_kind_set, molecule_set, particles, atomic_kinds)
284 cpassert(.NOT.
ASSOCIATED(small_subsys))
285 cpassert(
ASSOCIATED(big_subsys))
286 IF (big_subsys%para_env /= small_para_env) &
287 cpabort(
"big_subsys%para_env==small_para_env")
306 nat =
SIZE(sub_atom_index)
308 cpassert(.NOT.
ASSOCIATED(
topology%atom_info%r))
309 cpassert(.NOT.
ASSOCIATED(
topology%atom_info%id_atmname))
310 cpassert(.NOT.
ASSOCIATED(
topology%atom_info%id_molname))
311 cpassert(.NOT.
ASSOCIATED(
topology%atom_info%id_resname))
312 cpassert(.NOT.
ASSOCIATED(
topology%atom_info%atm_mass))
313 cpassert(.NOT.
ASSOCIATED(
topology%atom_info%atm_charge))
314 ALLOCATE (
topology%atom_info%r(3, nat),
topology%atom_info%id_atmname(nat), &
321 topology%atom_info%r(:, iat) = particles%els(sub_atom_index(iat))%r
329 IF (id_ == -1) id_ = len_trim(
id2str(
topology%atom_info%id_atmname(iat)))
331 strtmp1 = strtmp1(1:id_)
333 subsys_section, use_mm_map_first=.false.)
335 topology%atom_info%atm_mass(iat) = 0._dp
336 topology%atom_info%atm_charge(iat) = 0._dp
345 force_env_section=force_env_section)
352 topology, subsys_section=subsys_section)
359 molecule_kind_set, molecule_set,
topology, subsys_section=subsys_section, &
360 force_env_section=force_env_section, ignore_outside_box=ignore_outside_box)
372 ALLOCATE (small_subsys)
373 CALL para_env%retain()
374 small_subsys%para_env => para_env
379 CALL cp_subsys_set(small_subsys, particles=particles, atomic_kinds=atomic_kinds, &
380 molecules=mols, molecule_kinds=mol_kinds)
386 ALLOCATE (small_subsys%virial)
represent a simple array based list of the given type
subroutine, public atomic_kind_list_release(list)
releases a list (see doc/ReferenceCounting.html)
subroutine, public atomic_kind_list_create(list, els_ptr, owns_els, n_els)
creates a list
Define the atomic kind types and their sub types.
Holds information on atomic properties.
subroutine, public atprop_create(atprop_env)
...
Handles all functions related to the CELL.
subroutine, public cell_retain(cell)
retains the given cell (see doc/ReferenceCounting.html)
defines collective variables s({R}) and the derivative of this variable wrt R these can then be used ...
recursive subroutine, public colvar_read(colvar, icol, colvar_section, para_env)
reads a colvar from the input
set of type/routines to handle the storage of results in force_envs
subroutine, public cp_result_create(results)
Allocates and intitializes the cp_result.
Initialize a small environment for a particular calculation.
subroutine, public create_small_subsys(small_subsys, big_subsys, small_cell, small_para_env, sub_atom_index, sub_atom_kind_name, para_env, force_env_section, subsys_section, ignore_outside_box)
updates the molecule information of the given subsys
subroutine, public cp_subsys_create(subsys, para_env, root_section, force_env_section, subsys_section, use_motion_section, qmmm, qmmm_env, exclusions, elkind)
Creates allocates and fills subsys from given input.
types that represent a subsys, i.e. a part of the system
subroutine, public cp_subsys_set(subsys, atomic_kinds, particles, local_particles, molecules, molecule_kinds, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, results, cell)
sets various propreties of the subsys
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
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Interface to the message passing library MPI.
represent a simple array based list of the given type
subroutine, public molecule_kind_list_create(list, els_ptr, owns_els, n_els)
creates a list
subroutine, public molecule_kind_list_release(list)
releases a list (see doc/ReferenceCounting.html)
Define the molecule kind structure types and the corresponding functionality.
represent a simple array based list of the given type
subroutine, public molecule_list_create(list, els_ptr, owns_els, n_els)
creates a list
subroutine, public molecule_list_release(list)
releases a list (see doc/ReferenceCounting.html)
Define the data structure for the molecule information.
represent a simple array based list of the given type
subroutine, public particle_list_create(list, els_ptr, owns_els, n_els)
creates a list
subroutine, public particle_list_release(list)
releases a list (see doc/ReferenceCounting.html)
Define the data structure for the particle information.
generates a unique id number for a string (str2id) that can be used two compare two strings....
character(len=default_string_length) function, public s2s(str)
converts a string in a string of default_string_length
integer function, public str2id(str)
returns a unique id for a given string, and stores the string for later retrieval using the id.
character(len=default_string_length) function, public id2str(id)
returns the string associated with a given id
Collection of subroutine needed for topology related things.
subroutine, public topology_connectivity_pack(molecule_kind_set, molecule_set, topology, subsys_section)
topology connectivity pack
Collection of subroutine needed for topology related things.
subroutine, public topology_coordinate_pack(particle_set, atomic_kind_set, molecule_kind_set, molecule_set, topology, qmmm, qmmm_env, subsys_section, force_env_section, exclusions, ignore_outside_box)
Take info readin from different file format and stuff it into compatible data structure in cp2k.
subroutine, public deallocate_topology(topology)
Just DEALLOCATE all the stuff
subroutine, public init_topology(topology)
Just NULLIFY and zero all the stuff
Collection of subroutine needed for topology related things.
subroutine, public check_subsys_element(element_in, atom_name_in, element_out, subsys_section, use_mm_map_first)
Check and returns the ELEMENT label.
Control for reading in different topologies and coordinates.
subroutine, public topology_control(atomic_kind_set, particle_set, molecule_kind_set, molecule_set, colvar_p, gci, root_section, para_env, qmmm, qmmm_env, force_env_section, subsys_section, use_motion_section, exclusions, elkind)
...
subroutine, public connectivity_control(topology, para_env, qmmm, qmmm_env, subsys_section, force_env_section)
If reading in from external file, make sure its there first
subroutine, public virial_set(virial, pv_total, pv_kinetic, pv_virial, pv_xc, pv_fock_4c, pv_constraint, pv_overlap, pv_ekinetic, pv_ppl, pv_ppnl, pv_ecore_overlap, pv_ehartree, pv_exc, pv_exx, pv_vdw, pv_mp2, pv_nlcc, pv_gapw, pv_lrigpw, pv_availability, pv_calculate, pv_numer, pv_diagonal)
...
represent a list of objects
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
represents a system: atoms, molecules, their pos,vel,...
A type used to store lists of exclusions and onfos.
stores all the informations relevant to an mpi environment
represent a list of objects
represent a list of objects
represent a list of objects