38 ewald_environment_type,&
71 #include "./base/base_uses.f90"
77 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'fist_environment'
93 SUBROUTINE fist_init(fist_env, root_section, para_env, force_env_section, &
94 subsys_section, use_motion_section, prev_subsys)
96 TYPE(fist_environment_type),
POINTER :: fist_env
97 TYPE(section_vals_type),
POINTER :: root_section
98 TYPE(mp_para_env_type),
POINTER :: para_env
99 TYPE(section_vals_type),
POINTER :: force_env_section, subsys_section
100 LOGICAL,
INTENT(IN) :: use_motion_section
101 TYPE(cp_subsys_type),
OPTIONAL,
POINTER :: prev_subsys
103 CHARACTER(len=*),
PARAMETER :: routinen =
'fist_init'
105 INTEGER :: handle, iw
106 LOGICAL :: qmmm, shell_adiabatic, shell_present
107 REAL(kind=
dp),
DIMENSION(3) :: abc
108 TYPE(cell_type),
POINTER :: cell, cell_ref
109 TYPE(cp_logger_type),
POINTER :: logger
110 TYPE(cp_subsys_type),
POINTER :: subsys
111 TYPE(ewald_environment_type),
POINTER :: ewald_env
112 TYPE(exclusion_type),
DIMENSION(:),
POINTER :: exclusions
114 TYPE(fist_nonbond_env_type),
POINTER :: fist_nonbond_env
115 TYPE(particle_list_type),
POINTER :: core_particles, shell_particles
116 TYPE(particle_type),
DIMENSION(:),
POINTER :: core_particle_set, shell_particle_set
117 TYPE(qmmm_env_mm_type),
POINTER :: qmmm_env
118 TYPE(section_vals_type),
POINTER :: cell_section, ewald_section, mm_section, &
121 CALL timeset(routinen, handle)
124 NULLIFY (subsys, cell, cell_ref)
125 NULLIFY (ewald_env, fist_nonbond_env, qmmm_env, cell_section, &
126 poisson_section, shell_particle_set, shell_particles, &
127 core_particle_set, core_particles, exclusions)
128 IF (.NOT.
ASSOCIATED(subsys_section))
THEN
143 CALL read_cell(cell, cell_ref, cell_section=cell_section, para_env=para_env)
156 CALL ewald_env_set(ewald_env, poisson_section=poisson_section)
164 CALL fist_env_get(fist_env, qmmm=qmmm, qmmm_env=qmmm_env)
165 CALL cp_subsys_create(subsys, para_env=para_env, root_section=root_section, &
166 force_env_section=force_env_section, subsys_section=subsys_section, &
167 qmmm=qmmm, qmmm_env=qmmm_env, exclusions=exclusions, &
168 use_motion_section=use_motion_section)
169 CALL fist_env_set(fist_env, subsys=subsys, exclusions=exclusions)
172 subsys%molecule_kinds%els, subsys%molecules%els, &
173 ewald_env, fist_nonbond_env, root_section, para_env, qmmm=qmmm, &
174 qmmm_env=qmmm_env, subsys_section=subsys_section, &
175 mm_section=mm_section, shell_particle_set=shell_particle_set, &
176 core_particle_set=core_particle_set, cell=cell)
178 NULLIFY (shell_particles, core_particles)
179 IF (
ASSOCIATED(shell_particle_set))
THEN
185 IF (
ASSOCIATED(core_particle_set))
THEN
189 shell_present=shell_present, shell_adiabatic=shell_adiabatic)
190 CALL fist_env_set(fist_env, shell_model=shell_present, &
191 shell_model_ad=shell_adiabatic)
192 CALL cp_subsys_set(subsys, shell_particles=shell_particles, &
193 core_particles=core_particles)
197 CALL fist_init_subsys(fist_env, subsys, cell, cell_ref, fist_nonbond_env, ewald_env, &
198 force_env_section, subsys_section, prev_subsys)
203 CALL timestop(handle)
223 SUBROUTINE fist_init_subsys(fist_env, subsys, cell, cell_ref, fist_nonbond_env, &
224 ewald_env, force_env_section, subsys_section, &
227 TYPE(fist_environment_type),
POINTER :: fist_env
228 TYPE(cp_subsys_type),
POINTER :: subsys
229 TYPE(cell_type),
POINTER :: cell, cell_ref
230 TYPE(fist_nonbond_env_type),
POINTER :: fist_nonbond_env
231 TYPE(ewald_environment_type),
POINTER :: ewald_env
232 TYPE(section_vals_type),
POINTER :: force_env_section, subsys_section
233 TYPE(cp_subsys_type),
OPTIONAL,
POINTER :: prev_subsys
235 CHARACTER(len=*),
PARAMETER :: routinen =
'fist_init_subsys'
237 INTEGER :: handle, max_multipole
238 LOGICAL :: do_multipoles
239 TYPE(atomic_kind_type),
DIMENSION(:),
POINTER :: atomic_kind_set
240 TYPE(distribution_1d_type),
POINTER :: local_molecules, local_particles, &
242 TYPE(ewald_pw_type),
POINTER :: ewald_pw
243 TYPE(fist_energy_type),
POINTER :: thermo
244 TYPE(molecule_kind_type),
DIMENSION(:),
POINTER :: molecule_kind_set, prev_molecule_kind_set
245 TYPE(molecule_type),
DIMENSION(:),
POINTER :: molecule_set
246 TYPE(multipole_type),
POINTER :: multipoles
247 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
248 TYPE(section_vals_type),
POINTER :: grid_print_section
250 CALL timeset(routinen, handle)
251 NULLIFY (thermo, ewald_pw, local_molecules, local_particles, multipoles)
252 particle_set => subsys%particles%els
253 atomic_kind_set => subsys%atomic_kinds%els
254 molecule_set => subsys%molecules%els
255 molecule_kind_set => subsys%molecule_kinds%els
257 IF (
PRESENT(prev_subsys))
THEN
258 prev_molecule_kind_set => prev_subsys%molecule_kinds%els
259 prev_local_molecules => prev_subsys%local_molecules
261 NULLIFY (prev_molecule_kind_set)
262 NULLIFY (prev_local_molecules)
273 fist_nonbond_env%charges)
282 particle_set=particle_set, &
283 local_particles=local_particles, &
284 molecule_kind_set=molecule_kind_set, &
285 molecule_set=molecule_set, &
286 local_molecules=local_molecules, &
287 prev_molecule_kind_set=prev_molecule_kind_set, &
288 prev_local_molecules=prev_local_molecules, &
289 force_env_section=force_env_section)
293 "PRINT%GRID_INFORMATION")
295 CALL ewald_pw_create(ewald_pw, ewald_env, cell, cell_ref, grid_print_section)
302 max_multipole=max_multipole)
303 IF (do_multipoles)
THEN
304 ALLOCATE (multipoles)
312 local_molecules=local_molecules, &
313 local_particles=local_particles, &
314 ewald_env=ewald_env, ewald_pw=ewald_pw, &
315 fist_nonbond_env=fist_nonbond_env, &
320 CALL timestop(handle)
322 END SUBROUTINE fist_init_subsys
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public dick1958
integer, save, public devynck2012
integer, save, public mitchell1993
Handles all functions related to the CELL.
recursive subroutine, public read_cell(cell, cell_ref, use_ref_cell, cell_section, check_for_ref, para_env)
...
subroutine, public write_cell(cell, subsys_section, tag)
Write the cell parameters to the output unit.
Handles all functions related to the CELL.
subroutine, public cell_release(cell)
releases the given cell (see doc/ReferenceCounting.html)
subroutine, public get_cell(cell, alpha, beta, gamma, deth, orthorhombic, abc, periodic, h, h_inv, symmetry_id, tag)
Get informations about a simulation cell.
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,...
Initialize a small environment for a particular calculation.
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 write_symmetry(particle_set, cell, input_section)
Write symmetry information to output.
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
subroutine, public distribution_1d_release(distribution_1d)
releases the given distribution_1d
Distribution methods for atoms, particles, or molecules.
subroutine, public distribute_molecules_1d(atomic_kind_set, particle_set, local_particles, molecule_kind_set, molecule_set, local_molecules, force_env_section, prev_molecule_kind_set, prev_local_molecules)
Distribute molecules and particles.
subroutine, public ewald_env_set(ewald_env, ewald_type, alpha, epsilon, eps_pol, gmax, ns_max, precs, o_spline, para_env, poisson_section, interaction_cutoffs, cell_hmat)
Purpose: Set the EWALD environment.
subroutine, public ewald_env_create(ewald_env, para_env)
allocates and intitializes a ewald_env
subroutine, public read_ewald_section(ewald_env, ewald_section)
Purpose: read the EWALD section.
subroutine, public ewald_env_get(ewald_env, ewald_type, alpha, eps_pol, epsilon, gmax, ns_max, o_spline, group, para_env, poisson_section, precs, rcut, do_multipoles, max_multipole, do_ipol, max_ipol_iter, interaction_cutoffs, cell_hmat)
Purpose: Get the EWALD environment.
subroutine, public ewald_pw_grid_update(ewald_pw, ewald_env, cell_hmat)
Rescales pw_grids for given box, if necessary.
subroutine, public ewald_pw_create(ewald_pw, ewald_env, cell, cell_ref, print_section)
creates the structure ewald_pw_type
subroutine, public read_efield_section(input_section, efield)
Read input section PERIODIC_EFIELD.
subroutine, public allocate_fist_energy(fist_energy)
Allocate and/or initialise a Fist energy data structure.
subroutine, public fist_env_get(fist_env, atomic_kind_set, particle_set, ewald_pw, local_particles, local_molecules, molecule_kind_set, molecule_set, cell, cell_ref, ewald_env, fist_nonbond_env, thermo, para_env, subsys, qmmm, qmmm_env, input, shell_model, shell_model_ad, shell_particle_set, core_particle_set, multipoles, results, exclusions, efield)
Purpose: Get the FIST environment.
subroutine, public fist_env_set(fist_env, atomic_kind_set, particle_set, ewald_pw, local_particles, local_molecules, molecule_kind_set, molecule_set, cell_ref, ewald_env, fist_nonbond_env, thermo, subsys, qmmm, qmmm_env, input, shell_model, shell_model_ad, exclusions, efield)
Set the FIST environment.
initialize fist environment
subroutine, public fist_init(fist_env, root_section, para_env, force_env_section, subsys_section, use_motion_section, prev_subsys)
reads the input and database file for fist
subroutine, public force_field_control(atomic_kind_set, particle_set, molecule_kind_set, molecule_set, ewald_env, fist_nonbond_env, root_section, para_env, qmmm, qmmm_env, subsys_section, mm_section, shell_particle_set, core_particle_set, cell)
If reading in from external file, make sure its there first
Defines the basic variable types.
integer, parameter, public dp
Interface to the message passing library MPI.
Define the molecule kind structure types and the corresponding functionality.
subroutine, public write_molecule_kind_set(molecule_kind_set, subsys_section)
Write a moleculeatomic kind set data set to the output unit.
Define the data structure for the molecule information.
Multipole structure: for multipole (fixed and induced) in FF based MD.
subroutine, public create_multipole_type(multipoles, particle_set, subsys_section, max_multipole)
Create a multipole type.
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 methods related to particle_type.
subroutine, public write_fist_particle_coordinates(particle_set, subsys_section, charges)
Write the atomic coordinates to the output unit.
subroutine, public write_structure_data(particle_set, cell, input_section)
Write structure data requested by a separate structure data input section to the output unit....
subroutine, public write_particle_distances(particle_set, cell, subsys_section)
Write the matrix of the particle distances to the output unit.
Define the data structure for the particle information.