(git:ed6f26b)
Loading...
Searching...
No Matches
fist_force.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2025 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \par History
10!> Torsions added(DG)05-Dec-2000
11!> Variable names changed(DG)05-Dec-2000
12!> CJM SEPT-12-2002: int_env is now passed
13!> CJM NOV-30-2003: only uses fist_env
14!> \author CJM & JGH
15! **************************************************************************************************
19 USE atprop_types, ONLY: atprop_type
20 USE cell_methods, ONLY: init_cell
21 USE cell_types, ONLY: cell_type
24 USE cp_output_handling, ONLY: cp_p_file,&
36 USE ewalds, ONLY: ewald_evaluate,&
57 USE kinds, ONLY: dp
66 USE pme, ONLY: pme_evaluate
72 USE spme, ONLY: spme_evaluate
73 USE virial_types, ONLY: virial_type
74#include "./base/base_uses.f90"
75
76 IMPLICIT NONE
77 PRIVATE
79 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'fist_force'
80
81 TYPE debug_variables_type
82 REAL(KIND=dp) :: pot_manybody = 0.0_dp, pot_bend = 0.0_dp, pot_torsion = 0.0_dp
83 REAL(KIND=dp) :: pot_nonbond = 0.0_dp, pot_g = 0.0_dp, pot_bond = 0.0_dp
84 REAL(KIND=dp) :: pot_imptors = 0.0_dp, pot_urey_bradley = 0.0_dp
85 REAL(KIND=dp) :: pot_opbend = 0.0_dp
86 REAL(KIND=dp), DIMENSION(:, :), POINTER :: f_nonbond => null(), f_g => null(), f_bond => null(), f_bend => null(), &
87 f_torsion => null(), f_imptors => null(), f_ub => null(), &
88 f_opbend => null()
89 REAL(KIND=dp), DIMENSION(3, 3) :: pv_nonbond = 0.0_dp, pv_g = 0.0_dp, pv_bond = 0.0_dp, pv_ub = 0.0_dp, &
90 pv_bend = 0.0_dp, pv_torsion = 0.0_dp, pv_imptors = 0.0_dp, &
91 pv_opbend = 0.0_dp
92 END TYPE debug_variables_type
93
94CONTAINS
95
96! **************************************************************************************************
97!> \brief Calculates the total potential energy, total force, and the
98!> total pressure tensor from the potentials
99!> \param fist_env ...
100!> \param debug ...
101!> \par History
102!> Harald Forbert(Dec-2000): Changes for multiple linked lists
103!> cjm, 20-Feb-2001: box_ref used to initialize ewald. Now
104!> have consistent restarts with npt and ewald
105!> JGH(15-Mar-2001): box_change replaces ensemble parameter
106!> Call ewald_setup if box has changed
107!> Consistent setup for PME and SPME
108!> cjm, 28-Feb-2006: box_change is gone
109!> \author CJM & JGH
110! **************************************************************************************************
111 SUBROUTINE fist_calc_energy_force(fist_env, debug)
112 TYPE(fist_environment_type), POINTER :: fist_env
113 TYPE(debug_variables_type), INTENT(INOUT), &
114 OPTIONAL :: debug
115
116 CHARACTER(len=*), PARAMETER :: routinen = 'fist_calc_energy_force'
117
118 INTEGER :: do_ipol, ewald_type, fg_coulomb_size, handle, i, ii, ikind, iparticle_kind, &
119 iparticle_local, iw, iw2, j, natoms, nlocal_particles, node, nparticle_kind, &
120 nparticle_local, nshell, shell_index
121 LOGICAL :: do_multipoles, shell_model_ad, &
122 shell_present, use_virial
123 REAL(kind=dp) :: ef_ener, fc, fs, mass, pot_bend, pot_bond, pot_imptors, pot_manybody, &
124 pot_nonbond, pot_opbend, pot_shell, pot_torsion, pot_urey_bradley, vg_coulomb, xdum1, &
125 xdum2, xdum3
126 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: ef_f, f_nonbond, f_total, fcore_nonbond, &
127 fcore_shell_bonded, fcore_total, fg_coulomb, fgcore_coulomb, fgshell_coulomb, &
128 fshell_nonbond, fshell_total
129 REAL(kind=dp), DIMENSION(3, 3) :: ef_pv, ident, pv_bc, pv_bend, pv_bond, &
130 pv_g, pv_imptors, pv_nonbond, &
131 pv_opbend, pv_torsion, pv_urey_bradley
132 REAL(kind=dp), DIMENSION(:), POINTER :: e_coulomb
133 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
134 TYPE(atomic_kind_type), POINTER :: atomic_kind
135 TYPE(atprop_type), POINTER :: atprop_env
136 TYPE(cell_type), POINTER :: cell
137 TYPE(cp_logger_type), POINTER :: logger
138 TYPE(cp_subsys_type), POINTER :: subsys
139 TYPE(distribution_1d_type), POINTER :: local_molecules, local_particles
140 TYPE(ewald_environment_type), POINTER :: ewald_env
141 TYPE(ewald_pw_type), POINTER :: ewald_pw
142 TYPE(exclusion_type), DIMENSION(:), POINTER :: exclusions
143 TYPE(fist_efield_type), POINTER :: efield
144 TYPE(fist_energy_type), POINTER :: thermo
145 TYPE(fist_nonbond_env_type), POINTER :: fist_nonbond_env
146 TYPE(molecule_kind_type), DIMENSION(:), POINTER :: molecule_kind_set
147 TYPE(molecule_type), DIMENSION(:), POINTER :: molecule_set
148 TYPE(mp_para_env_type), POINTER :: para_env
149 TYPE(multipole_type), POINTER :: multipoles
150 TYPE(particle_type), DIMENSION(:), POINTER :: core_particle_set, particle_set, &
151 shell_particle_set
152 TYPE(section_vals_type), POINTER :: force_env_section, mm_section, &
153 print_section
154 TYPE(shell_kind_type), POINTER :: shell
155 TYPE(virial_type), POINTER :: virial
156
157 CALL timeset(routinen, handle)
158 NULLIFY (logger)
159 NULLIFY (subsys, virial, atprop_env, para_env, force_env_section)
160 logger => cp_get_default_logger()
161
162 CALL fist_env_get(fist_env, &
163 subsys=subsys, &
164 para_env=para_env, &
165 input=force_env_section)
166
167 CALL cp_subsys_get(subsys, &
168 virial=virial, &
169 atprop=atprop_env)
170
171 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
172 NULLIFY (atomic_kind, atomic_kind_set, cell, ewald_pw, ewald_env, &
173 fist_nonbond_env, mm_section, local_molecules, local_particles, &
174 molecule_kind_set, molecule_set, particle_set, print_section, &
175 shell, shell_particle_set, core_particle_set, thermo, multipoles, &
176 e_coulomb)
177
178 mm_section => section_vals_get_subs_vals(force_env_section, "MM")
179 iw = cp_print_key_unit_nr(logger, mm_section, "PRINT%DERIVATIVES", &
180 extension=".mmLog")
181 iw2 = cp_print_key_unit_nr(logger, mm_section, "PRINT%EWALD_INFO", &
182 extension=".mmLog")
183
184 CALL fist_env_get(fist_env, ewald_pw=ewald_pw, ewald_env=ewald_env, &
185 local_particles=local_particles, particle_set=particle_set, &
186 atomic_kind_set=atomic_kind_set, molecule_set=molecule_set, &
187 local_molecules=local_molecules, thermo=thermo, &
188 molecule_kind_set=molecule_kind_set, fist_nonbond_env=fist_nonbond_env, &
189 cell=cell, shell_model=shell_present, shell_model_ad=shell_model_ad, &
190 multipoles=multipoles, exclusions=exclusions, efield=efield)
191
192 CALL ewald_env_get(ewald_env, ewald_type=ewald_type, do_multipoles=do_multipoles, &
193 do_ipol=do_ipol)
194
195 ! Initialize ewald grids
196 CALL init_cell(cell)
197 CALL ewald_pw_grid_update(ewald_pw, ewald_env, cell%hmat)
198
199 natoms = SIZE(particle_set)
200 nlocal_particles = 0
201 nparticle_kind = SIZE(atomic_kind_set)
202 DO ikind = 1, nparticle_kind
203 nlocal_particles = nlocal_particles + local_particles%n_el(ikind)
204 END DO
205
206 ALLOCATE (f_nonbond(3, natoms))
207 f_nonbond = 0.0_dp
208
209 nshell = 0
210 IF (shell_present) THEN
211 CALL fist_env_get(fist_env, shell_particle_set=shell_particle_set, &
212 core_particle_set=core_particle_set)
213 cpassert(ASSOCIATED(shell_particle_set))
214 cpassert(ASSOCIATED(core_particle_set))
215 nshell = SIZE(shell_particle_set)
216 ALLOCATE (fshell_nonbond(3, nshell))
217 fshell_nonbond = 0.0_dp
218 ALLOCATE (fcore_nonbond(3, nshell))
219 fcore_nonbond = 0.0_dp
220 ELSE
221 NULLIFY (shell_particle_set, core_particle_set)
222 END IF
223
224 IF (fist_nonbond_env%do_nonbonded) THEN
225 ! First check with list_control to update neighbor lists
226 IF (ASSOCIATED(exclusions)) THEN
227 CALL list_control(atomic_kind_set, particle_set, local_particles, &
228 cell, fist_nonbond_env, para_env, mm_section, shell_particle_set, &
229 core_particle_set, exclusions=exclusions)
230 ELSE
231 CALL list_control(atomic_kind_set, particle_set, local_particles, &
232 cell, fist_nonbond_env, para_env, mm_section, shell_particle_set, &
233 core_particle_set)
234 END IF
235 END IF
236
237 ! Initialize force, energy and pressure tensor arrays
238 DO i = 1, natoms
239 particle_set(i)%f(1) = 0.0_dp
240 particle_set(i)%f(2) = 0.0_dp
241 particle_set(i)%f(3) = 0.0_dp
242 END DO
243 IF (nshell > 0) THEN
244 DO i = 1, nshell
245 shell_particle_set(i)%f(1) = 0.0_dp
246 shell_particle_set(i)%f(2) = 0.0_dp
247 shell_particle_set(i)%f(3) = 0.0_dp
248 core_particle_set(i)%f(1) = 0.0_dp
249 core_particle_set(i)%f(2) = 0.0_dp
250 core_particle_set(i)%f(3) = 0.0_dp
251 END DO
252 END IF
253
254 IF (use_virial) THEN
255 pv_bc = 0.0_dp
256 pv_bond = 0.0_dp
257 pv_bend = 0.0_dp
258 pv_torsion = 0.0_dp
259 pv_imptors = 0.0_dp
260 pv_opbend = 0.0_dp
261 pv_urey_bradley = 0.0_dp
262 pv_nonbond = 0.0_dp
263 pv_g = 0.0_dp
264 virial%pv_virial = 0.0_dp
265 END IF
266
267 pot_nonbond = 0.0_dp
268 pot_manybody = 0.0_dp
269 pot_bond = 0.0_dp
270 pot_bend = 0.0_dp
271 pot_torsion = 0.0_dp
272 pot_opbend = 0.0_dp
273 pot_imptors = 0.0_dp
274 pot_urey_bradley = 0.0_dp
275 pot_shell = 0.0_dp
276 vg_coulomb = 0.0_dp
277 thermo%pot = 0.0_dp
278 thermo%harm_shell = 0.0_dp
279
280 ! Get real-space non-bonded forces:
281 IF (iw > 0) THEN
282 WRITE (iw, '(A)') " FIST:: FORCES IN INPUT..."
283 WRITE (iw, '(3f15.9)') ((particle_set(i)%f(j), j=1, 3), i=1, SIZE(particle_set))
284 END IF
285
286 IF (fist_nonbond_env%do_nonbonded) THEN
287 ! Compute density for EAM
288 CALL density_nonbond(fist_nonbond_env, particle_set, cell, para_env)
289
290 ! Compute embedding function and manybody energy
291 CALL energy_manybody(fist_nonbond_env, atomic_kind_set, local_particles, particle_set, &
292 cell, pot_manybody, para_env, mm_section, use_virial)
293
294 ! Nonbond contribution + Manybody Forces
295 IF (shell_present) THEN
296 CALL force_nonbond(fist_nonbond_env, ewald_env, particle_set, cell, &
297 pot_nonbond, f_nonbond, pv_nonbond, &
298 fshell_nonbond=fshell_nonbond, fcore_nonbond=fcore_nonbond, &
299 atprop_env=atprop_env, &
300 atomic_kind_set=atomic_kind_set, use_virial=use_virial)
301 ELSE
302 CALL force_nonbond(fist_nonbond_env, ewald_env, particle_set, cell, &
303 pot_nonbond, f_nonbond, pv_nonbond, atprop_env=atprop_env, &
304 atomic_kind_set=atomic_kind_set, use_virial=use_virial)
305 CALL force_nonbond_manybody(fist_nonbond_env, particle_set, cell, f_nonbond, pv_nonbond, &
306 use_virial=use_virial)
307 END IF
308 END IF
309
310 IF (iw > 0) THEN
311 WRITE (iw, '(A)') " FIST:: NONBOND + R-SPACE ELECTROSTATIC FORCES ..."
312 WRITE (iw, '(3f15.9)') f_nonbond
313 IF (shell_present .AND. shell_model_ad) THEN
314 WRITE (iw, '(A)') " FIST:: SHELL NONBOND + R-SPACE ELECTROSTATIC FORCES ..."
315 WRITE (iw, '(3f15.9)') fshell_nonbond
316 WRITE (iw, '(A)') " FIST:: CORE NONBOND + R-SPACE ELECTROSTATIC FORCES ..."
317 WRITE (iw, '(3f15.9)') fcore_nonbond
318 END IF
319 END IF
320
321 ! Get g-space non-bonded forces:
322 IF (ewald_type /= do_ewald_none) THEN
323 ! Determine size of the forces array
324 SELECT CASE (ewald_type)
325 CASE (do_ewald_ewald)
326 fg_coulomb_size = nlocal_particles
327 CASE DEFAULT
328 fg_coulomb_size = natoms
329 END SELECT
330 ! Allocate and zeroing arrays
331 ALLOCATE (fg_coulomb(3, fg_coulomb_size))
332 fg_coulomb = 0.0_dp
333 IF (shell_present) THEN
334 ALLOCATE (fgshell_coulomb(3, nshell))
335 ALLOCATE (fgcore_coulomb(3, nshell))
336 fgshell_coulomb = 0.0_dp
337 fgcore_coulomb = 0.0_dp
338 END IF
339 IF (shell_present .AND. do_multipoles) THEN
340 cpabort("Multipoles and Core-Shell model not implemented.")
341 END IF
342 ! If not multipole: Compute self-interaction and neutralizing background
343 ! for multipoles is handled separately..
344 IF (.NOT. do_multipoles) THEN
345 CALL ewald_self(ewald_env, cell, atomic_kind_set, local_particles, &
346 thermo%e_self, thermo%e_neut, fist_nonbond_env%charges)
347 IF (atprop_env%energy) THEN
348 CALL ewald_self_atom(ewald_env, atomic_kind_set, local_particles, &
349 atprop_env%atener, fist_nonbond_env%charges)
350 atprop_env%atener = atprop_env%atener + thermo%e_neut/SIZE(atprop_env%atener)
351 END IF
352 END IF
353
354 ! Polarizable force-field
355 IF (do_ipol /= do_fist_pol_none) THEN
356 ! Check if an array of chagres was provided and in case abort due to lack of implementation
357 IF (ASSOCIATED(fist_nonbond_env%charges)) THEN
358 cpabort("Polarizable force field and array charges not implemented!")
359 END IF
360 ! Converge the dipoles self-consistently
361 CALL fist_pol_evaluate(atomic_kind_set, multipoles, ewald_env, &
362 ewald_pw, fist_nonbond_env, cell, particle_set, &
363 local_particles, thermo, vg_coulomb, pot_nonbond, f_nonbond, &
364 fg_coulomb, use_virial, pv_g, pv_nonbond, mm_section, do_ipol)
365 ELSE
366 ! Non-Polarizable force-field
367 SELECT CASE (ewald_type)
368 CASE (do_ewald_ewald)
369 ! Parallelisation over atoms --> allocate local atoms
370 IF (shell_present) THEN
371 ! Check if an array of chagres was provided and in case abort due to lack of implementation
372 IF (ASSOCIATED(fist_nonbond_env%charges)) THEN
373 cpabort("Core-Shell and array charges not implemented!")
374 END IF
375 IF (do_multipoles) THEN
376 cpabort("Multipole Ewald and CORE-SHELL not yet implemented within Ewald sum!")
377 ELSE
378 cpabort("Core-Shell model not yet implemented within Ewald sums.")
379 END IF
380 ELSE
381 IF (do_multipoles) THEN
382 ! Check if an array of chagres was provided and in case abort due to lack of implementation
383 IF (ASSOCIATED(fist_nonbond_env%charges)) THEN
384 cpabort("Multipole Ewald and array charges not implemented!")
385 END IF
386 CALL ewald_multipole_evaluate(ewald_env, ewald_pw, fist_nonbond_env, cell, &
387 particle_set, local_particles, vg_coulomb, pot_nonbond, thermo%e_neut, &
388 thermo%e_self, multipoles%task, do_correction_bonded=.true., do_forces=.true., &
389 do_stress=use_virial, do_efield=.false., radii=multipoles%radii, &
390 charges=multipoles%charges, dipoles=multipoles%dipoles, &
391 quadrupoles=multipoles%quadrupoles, forces_local=fg_coulomb, &
392 forces_glob=f_nonbond, pv_local=pv_g, pv_glob=pv_nonbond, iw=iw2, &
393 do_debug=.true., atomic_kind_set=atomic_kind_set, mm_section=mm_section)
394 ELSE
395 IF (atprop_env%energy) THEN
396 ALLOCATE (e_coulomb(fg_coulomb_size))
397 END IF
398 CALL ewald_evaluate(ewald_env, ewald_pw, cell, atomic_kind_set, particle_set, &
399 local_particles, fg_coulomb, vg_coulomb, pv_g, use_virial=use_virial, &
400 charges=fist_nonbond_env%charges, e_coulomb=e_coulomb)
401 END IF
402 END IF
403 CASE (do_ewald_pme)
404 ! Parallelisation over grids --> allocate all atoms
405 IF (shell_present) THEN
406 ! Check if an array of chagres was provided and in case abort due to lack of implementation
407 IF (ASSOCIATED(fist_nonbond_env%charges)) THEN
408 cpabort("Core-Shell and array charges not implemented!")
409 END IF
410 IF (do_multipoles) THEN
411 cpabort("Multipole Ewald and CORE-SHELL not yet implemented within a PME scheme!")
412 ELSE
413 CALL pme_evaluate(ewald_env, ewald_pw, cell, particle_set, vg_coulomb, fg_coulomb, &
414 pv_g, shell_particle_set=shell_particle_set, core_particle_set=core_particle_set, &
415 fgshell_coulomb=fgshell_coulomb, fgcore_coulomb=fgcore_coulomb, use_virial=use_virial, &
416 atprop=atprop_env)
417 CALL para_env%sum(fgshell_coulomb)
418 CALL para_env%sum(fgcore_coulomb)
419 END IF
420 ELSE
421 IF (do_multipoles) THEN
422 cpabort("Multipole Ewald not yet implemented within a PME scheme!")
423 ELSE
424 CALL pme_evaluate(ewald_env, ewald_pw, cell, particle_set, vg_coulomb, fg_coulomb, &
425 pv_g, use_virial=use_virial, charges=fist_nonbond_env%charges, &
426 atprop=atprop_env)
427 END IF
428 END IF
429 CALL para_env%sum(fg_coulomb)
430 CASE (do_ewald_spme)
431 ! Parallelisation over grids --> allocate all atoms
432 IF (shell_present) THEN
433 ! Check if an array of charges was provided and in case abort due to lack of implementation
434 IF (ASSOCIATED(fist_nonbond_env%charges)) THEN
435 cpabort("Core-Shell and array charges not implemented!")
436 END IF
437 IF (do_multipoles) THEN
438 cpabort("Multipole Ewald and CORE-SHELL not yet implemented within a SPME scheme!")
439 ELSE
440 CALL spme_evaluate(ewald_env, ewald_pw, cell, particle_set, fg_coulomb, vg_coulomb, &
441 pv_g, shell_particle_set=shell_particle_set, core_particle_set=core_particle_set, &
442 fgshell_coulomb=fgshell_coulomb, fgcore_coulomb=fgcore_coulomb, use_virial=use_virial, &
443 atprop=atprop_env)
444 CALL para_env%sum(fgshell_coulomb)
445 CALL para_env%sum(fgcore_coulomb)
446 END IF
447 ELSE
448 IF (do_multipoles) THEN
449 cpabort("Multipole Ewald not yet implemented within a SPME scheme!")
450 ELSE
451 CALL spme_evaluate(ewald_env, ewald_pw, cell, particle_set, fg_coulomb, vg_coulomb, &
452 pv_g, use_virial=use_virial, charges=fist_nonbond_env%charges, &
453 atprop=atprop_env)
454 END IF
455 END IF
456 CALL para_env%sum(fg_coulomb)
457 END SELECT
458 END IF
459
460 ! Subtract the interaction between screening charges. This is a
461 ! correction in real-space and depends on the neighborlists. Therefore
462 ! it is only executed if fist_nonbond_env%do_nonbonded is set.
463 IF (fist_nonbond_env%do_nonbonded) THEN
464 ! Correction for core-shell model
465 IF (shell_present) THEN
466 CALL bonded_correct_gaussian(fist_nonbond_env, atomic_kind_set, &
467 local_particles, particle_set, ewald_env, thermo%e_bonded, &
468 pv_bc, shell_particle_set=shell_particle_set, &
469 core_particle_set=core_particle_set, atprop_env=atprop_env, cell=cell, &
470 use_virial=use_virial)
471 ELSE
472 IF (.NOT. do_multipoles) THEN
473 CALL bonded_correct_gaussian(fist_nonbond_env, &
474 atomic_kind_set, local_particles, particle_set, &
475 ewald_env, thermo%e_bonded, pv_bc=pv_bc, atprop_env=atprop_env, cell=cell, &
476 use_virial=use_virial)
477 END IF
478 END IF
479 END IF
480
481 IF (.NOT. do_multipoles) THEN
482 ! Multipole code has its own printing routine.
483 CALL ewald_print(iw2, pot_nonbond, vg_coulomb, thermo%e_self, thermo%e_neut, &
484 thermo%e_bonded)
485 END IF
486 ELSE
487 IF (use_virial) THEN
488 pv_g = 0.0_dp
489 pv_bc = 0.0_dp
490 END IF
491 thermo%e_neut = 0.0_dp
492 END IF
493
494 IF (iw > 0) THEN
495 IF (ALLOCATED(fg_coulomb)) THEN
496 WRITE (iw, '(A)') " FIST:: NONBONDED ELECTROSTATIC FORCES IN G-SPACE..."
497 WRITE (iw, '(3f15.9)') ((fg_coulomb(j, i), j=1, 3), i=1, SIZE(fg_coulomb, 2))
498 END IF
499 IF (shell_present .AND. shell_model_ad .AND. ALLOCATED(fgshell_coulomb)) THEN
500 WRITE (iw, '(A)') " FIST:: SHELL NONBONDED ELECTROSTATIC FORCES IN G-SPACE..."
501 WRITE (iw, '(3f15.9)') ((fgshell_coulomb(j, i), j=1, 3), i=1, SIZE(fgshell_coulomb, 2))
502 WRITE (iw, '(A)') " FIST:: CORE NONBONDED ELECTROSTATIC FORCES IN G-SPACE..."
503 WRITE (iw, '(3f15.9)') ((fgcore_coulomb(j, i), j=1, 3), i=1, SIZE(fgcore_coulomb, 2))
504 END IF
505 END IF
506
507 ! calculate the action of an (external) electric field
508 IF (efield%apply_field) THEN
509 ALLOCATE (ef_f(3, natoms))
510 CALL fist_efield_energy_force(ef_ener, ef_f, ef_pv, atomic_kind_set, particle_set, cell, &
511 efield, use_virial=use_virial, iunit=iw, charges=fist_nonbond_env%charges)
512 END IF
513
514 ! Get intramolecular forces
515 IF (PRESENT(debug)) THEN
516 CALL force_intra_control(molecule_set, molecule_kind_set, &
517 local_molecules, particle_set, shell_particle_set, &
518 core_particle_set, pot_bond, pot_bend, pot_urey_bradley, &
519 pot_torsion, pot_imptors, pot_opbend, pot_shell, pv_bond, pv_bend, &
520 pv_urey_bradley, pv_torsion, pv_imptors, pv_opbend, &
521 debug%f_bond, debug%f_bend, debug%f_torsion, debug%f_ub, &
522 debug%f_imptors, debug%f_opbend, cell, use_virial, atprop_env)
523
524 ELSE
525 CALL force_intra_control(molecule_set, molecule_kind_set, &
526 local_molecules, particle_set, shell_particle_set, &
527 core_particle_set, pot_bond, pot_bend, pot_urey_bradley, &
528 pot_torsion, pot_imptors, pot_opbend, pot_shell, pv_bond, pv_bend, &
529 pv_urey_bradley, pv_torsion, pv_imptors, pv_opbend, &
530 cell=cell, use_virial=use_virial, atprop_env=atprop_env)
531 END IF
532
533 ! Perform global sum of the intra-molecular (bonded) forces for the core-shell atoms
534 IF (shell_present .AND. shell_model_ad) THEN
535 ALLOCATE (fcore_shell_bonded(3, nshell))
536 fcore_shell_bonded = 0.0_dp
537 DO i = 1, natoms
538 shell_index = particle_set(i)%shell_index
539 IF (shell_index /= 0) THEN
540 fcore_shell_bonded(1:3, shell_index) = particle_set(i)%f(1:3)
541 END IF
542 END DO
543 CALL para_env%sum(fcore_shell_bonded)
544 DO i = 1, natoms
545 shell_index = particle_set(i)%shell_index
546 IF (shell_index /= 0) THEN
547 particle_set(i)%f(1:3) = fcore_shell_bonded(1:3, shell_index)
548 END IF
549 END DO
550 DEALLOCATE (fcore_shell_bonded)
551 END IF
552
553 IF (iw > 0) THEN
554 xdum1 = cp_unit_from_cp2k(pot_bond, "kcalmol")
555 xdum2 = cp_unit_from_cp2k(pot_bend, "kcalmol")
556 xdum3 = cp_unit_from_cp2k(pot_urey_bradley, "kcalmol")
557 WRITE (iw, '(A)') " FIST energy contributions in kcal/mol:"
558 WRITE (iw, '(1x,"BOND = ",f13.4,'// &
559 '2x,"ANGLE = ",f13.4,'// &
560 '2x,"UBRAD = ",f13.4)') xdum1, xdum2, xdum3
561 xdum1 = cp_unit_from_cp2k(pot_torsion, "kcalmol")
562 xdum2 = cp_unit_from_cp2k(pot_imptors, "kcalmol")
563 xdum3 = cp_unit_from_cp2k(pot_opbend, "kcalmol")
564 WRITE (iw, '(1x,"TORSION = ",f13.4,'// &
565 '2x,"IMPTORS = ",f13.4,'// &
566 '2x,"OPBEND = ",f13.4)') xdum1, xdum2, xdum3
567
568 WRITE (iw, '(A)') " FIST:: CORRECTED BONDED ELECTROSTATIC FORCES + INTERNAL FORCES..."
569 WRITE (iw, '(3f15.9)') ((particle_set(i)%f(j), j=1, 3), i=1, SIZE(particle_set))
570 IF (shell_present .AND. shell_model_ad) THEN
571 WRITE (iw, '(A)') " FIST:: SHELL CORRECTED BONDED ELECTROSTATIC FORCES + INTERNAL FORCES..."
572 WRITE (iw, '(3f15.9)') ((shell_particle_set(i)%f(j), j=1, 3), i=1, SIZE(shell_particle_set))
573 WRITE (iw, '(A)') " FIST:: CORE CORRECTED BONDED ELECTROSTATIC FORCES + INTERNAL FORCES..."
574 WRITE (iw, '(3f15.9)') ((core_particle_set(i)%f(j), j=1, 3), i=1, SIZE(core_particle_set))
575 END IF
576 END IF
577
578 ! add up all the potential energies
579 thermo%pot = pot_nonbond + pot_bond + pot_bend + pot_torsion + pot_opbend + &
580 pot_imptors + pot_urey_bradley + pot_manybody + pot_shell
581
582 CALL para_env%sum(thermo%pot)
583
584 IF (shell_present) THEN
585 thermo%harm_shell = pot_shell
586 CALL para_env%sum(thermo%harm_shell)
587 END IF
588 ! add g-space contributions if needed
589 IF (ewald_type /= do_ewald_none) THEN
590 ! e_self, e_neut, and ebonded are already summed over all processors
591 ! vg_coulomb is not calculated in parallel
592 thermo%e_gspace = vg_coulomb
593 thermo%pot = thermo%pot + thermo%e_self + thermo%e_neut
594 thermo%pot = thermo%pot + vg_coulomb + thermo%e_bonded
595 ! add the induction energy of the dipoles for polarizable models
596 IF (do_ipol /= do_fist_pol_none) thermo%pot = thermo%pot + thermo%e_induction
597 END IF
598
599 ! add up all the forces
600 !
601 ! nonbonded forces might be calculated for atoms not on this node
602 ! ewald forces are strictly local -> sum only over pnode
603 ! We first sum the forces in f_nonbond, this allows for a more efficient
604 ! global sum in the parallel code and in the end copy them back to part
605 ALLOCATE (f_total(3, natoms))
606 f_total = 0.0_dp
607 DO i = 1, natoms
608 f_total(1, i) = particle_set(i)%f(1) + f_nonbond(1, i)
609 f_total(2, i) = particle_set(i)%f(2) + f_nonbond(2, i)
610 f_total(3, i) = particle_set(i)%f(3) + f_nonbond(3, i)
611 END DO
612 IF (shell_present) THEN
613 ALLOCATE (fshell_total(3, nshell))
614 fshell_total = 0.0_dp
615 ALLOCATE (fcore_total(3, nshell))
616 fcore_total = 0.0_dp
617 DO i = 1, nshell
618 fcore_total(1, i) = core_particle_set(i)%f(1) + fcore_nonbond(1, i)
619 fcore_total(2, i) = core_particle_set(i)%f(2) + fcore_nonbond(2, i)
620 fcore_total(3, i) = core_particle_set(i)%f(3) + fcore_nonbond(3, i)
621 fshell_total(1, i) = shell_particle_set(i)%f(1) + fshell_nonbond(1, i)
622 fshell_total(2, i) = shell_particle_set(i)%f(2) + fshell_nonbond(2, i)
623 fshell_total(3, i) = shell_particle_set(i)%f(3) + fshell_nonbond(3, i)
624 END DO
625 END IF
626
627 IF (iw > 0) THEN
628 WRITE (iw, '(A)') " FIST::(1)INTERNAL + ELECTROSTATIC BONDED + NONBONDED"
629 WRITE (iw, '(3f15.9)') ((f_total(j, i), j=1, 3), i=1, natoms)
630 IF (shell_present .AND. shell_model_ad) THEN
631 WRITE (iw, '(A)') " FIST::(1)SHELL INTERNAL + ELECTROSTATIC BONDED + NONBONDED"
632 WRITE (iw, '(3f15.9)') ((fshell_total(j, i), j=1, 3), i=1, nshell)
633 WRITE (iw, '(A)') " FIST::(1)CORE INTERNAL + ELECTROSTATIC BONDED + NONBONDED"
634 WRITE (iw, '(3f15.9)') ((fcore_total(j, i), j=1, 3), i=1, nshell)
635 END IF
636 END IF
637
638 ! Adding in the reciprocal forces: EWALD is a special case because of distrubted data
639 IF (ewald_type == do_ewald_ewald) THEN
640 node = 0
641 DO iparticle_kind = 1, nparticle_kind
642 nparticle_local = local_particles%n_el(iparticle_kind)
643 DO iparticle_local = 1, nparticle_local
644 ii = local_particles%list(iparticle_kind)%array(iparticle_local)
645 node = node + 1
646 f_total(1, ii) = f_total(1, ii) + fg_coulomb(1, node)
647 f_total(2, ii) = f_total(2, ii) + fg_coulomb(2, node)
648 f_total(3, ii) = f_total(3, ii) + fg_coulomb(3, node)
649 IF (PRESENT(debug)) THEN
650 debug%f_g(1, ii) = debug%f_g(1, ii) + fg_coulomb(1, node)
651 debug%f_g(2, ii) = debug%f_g(2, ii) + fg_coulomb(2, node)
652 debug%f_g(3, ii) = debug%f_g(3, ii) + fg_coulomb(3, node)
653 END IF
654 IF (atprop_env%energy) THEN
655 atprop_env%atener(ii) = atprop_env%atener(ii) + e_coulomb(node)
656 END IF
657 END DO
658 END DO
659 IF (atprop_env%energy) THEN
660 DEALLOCATE (e_coulomb)
661 END IF
662 END IF
663
664 IF (iw > 0) THEN
665 WRITE (iw, '(A)') " FIST::(2)TOTAL FORCES(1)+ ELECTROSTATIC FORCES"
666 WRITE (iw, '(3f15.9)') ((f_total(j, i), j=1, 3), i=1, natoms)
667 IF (shell_present .AND. shell_model_ad) THEN
668 WRITE (iw, '(A)') " FIST::(2)SHELL TOTAL FORCES(1)+ ELECTROSTATIC FORCES "
669 WRITE (iw, '(3f15.9)') ((fshell_total(j, i), j=1, 3), i=1, nshell)
670 WRITE (iw, '(A)') " FIST::(2)CORE TOTAL FORCES(1)+ ELECTROSTATIC FORCES"
671 WRITE (iw, '(3f15.9)') ((fcore_total(j, i), j=1, 3), i=1, nshell)
672 END IF
673 END IF
674
675 IF (use_virial) THEN
676 ! Add up all the pressure tensors
677 IF (ewald_type == do_ewald_none) THEN
678 virial%pv_virial = pv_nonbond + pv_bond + pv_bend + pv_torsion + pv_imptors + pv_urey_bradley
679 CALL para_env%sum(virial%pv_virial)
680 ELSE
681 ident = 0.0_dp
682 DO i = 1, 3
683 ident(i, i) = 1.0_dp
684 END DO
685
686 virial%pv_virial = pv_nonbond + pv_bond + pv_bend + pv_torsion + pv_imptors + pv_urey_bradley + pv_bc
687 CALL para_env%sum(virial%pv_virial)
688
689 virial%pv_virial = virial%pv_virial + ident*thermo%e_neut
690 virial%pv_virial = virial%pv_virial + pv_g
691 END IF
692 END IF
693
694 ! Sum total forces
695 CALL para_env%sum(f_total)
696 IF (shell_present .AND. shell_model_ad) THEN
697 CALL para_env%sum(fcore_total)
698 CALL para_env%sum(fshell_total)
699 END IF
700
701 ! contributions from fields (currently all quantities are fully replicated!)
702 IF (efield%apply_field) THEN
703 thermo%pot = thermo%pot + ef_ener
704 f_total(1:3, 1:natoms) = f_total(1:3, 1:natoms) + ef_f(1:3, 1:natoms)
705 IF (use_virial) THEN
706 virial%pv_virial(1:3, 1:3) = virial%pv_virial(1:3, 1:3) + ef_pv(1:3, 1:3)
707 END IF
708 DEALLOCATE (ef_f)
709 END IF
710
711 ! Assign to particle_set
712 SELECT CASE (ewald_type)
714 IF (shell_present .AND. shell_model_ad) THEN
715 DO i = 1, natoms
716 shell_index = particle_set(i)%shell_index
717 IF (shell_index == 0) THEN
718 particle_set(i)%f(1:3) = f_total(1:3, i) + fg_coulomb(1:3, i)
719 ELSE
720 atomic_kind => particle_set(i)%atomic_kind
721 CALL get_atomic_kind(atomic_kind=atomic_kind, shell=shell, mass=mass)
722 fc = shell%mass_core/mass
723 fcore_total(1:3, shell_index) = fcore_total(1:3, shell_index) + particle_set(i)%f(1:3)*fc
724 fs = shell%mass_shell/mass
725 fshell_total(1:3, shell_index) = fshell_total(1:3, shell_index) + particle_set(i)%f(1:3)*fs
726 END IF
727 END DO
728
729 DO i = 1, nshell
730 core_particle_set(i)%f(1) = fcore_total(1, i) + fgcore_coulomb(1, i)
731 core_particle_set(i)%f(2) = fcore_total(2, i) + fgcore_coulomb(2, i)
732 core_particle_set(i)%f(3) = fcore_total(3, i) + fgcore_coulomb(3, i)
733 shell_particle_set(i)%f(1) = fshell_total(1, i) + fgshell_coulomb(1, i)
734 shell_particle_set(i)%f(2) = fshell_total(2, i) + fgshell_coulomb(2, i)
735 shell_particle_set(i)%f(3) = fshell_total(3, i) + fgshell_coulomb(3, i)
736 END DO
737
738 ELSEIF (shell_present .AND. .NOT. shell_model_ad) THEN
739 cpabort("Non adiabatic shell-model not implemented.")
740 ELSE
741 DO i = 1, natoms
742 particle_set(i)%f(1) = f_total(1, i) + fg_coulomb(1, i)
743 particle_set(i)%f(2) = f_total(2, i) + fg_coulomb(2, i)
744 particle_set(i)%f(3) = f_total(3, i) + fg_coulomb(3, i)
745 END DO
746 END IF
748 IF (shell_present .AND. shell_model_ad) THEN
749 DO i = 1, natoms
750 shell_index = particle_set(i)%shell_index
751 IF (shell_index == 0) THEN
752 particle_set(i)%f(1:3) = f_total(1:3, i)
753 ELSE
754 atomic_kind => particle_set(i)%atomic_kind
755 CALL get_atomic_kind(atomic_kind=atomic_kind, shell=shell, mass=mass)
756 fc = shell%mass_core/mass
757 fcore_total(1:3, shell_index) = fcore_total(1:3, shell_index) + particle_set(i)%f(1:3)*fc
758 fs = shell%mass_shell/mass
759 fshell_total(1:3, shell_index) = fshell_total(1:3, shell_index) + particle_set(i)%f(1:3)*fs
760 END IF
761 END DO
762 DO i = 1, nshell
763 core_particle_set(i)%f(1) = fcore_total(1, i)
764 core_particle_set(i)%f(2) = fcore_total(2, i)
765 core_particle_set(i)%f(3) = fcore_total(3, i)
766 shell_particle_set(i)%f(1) = fshell_total(1, i)
767 shell_particle_set(i)%f(2) = fshell_total(2, i)
768 shell_particle_set(i)%f(3) = fshell_total(3, i)
769 END DO
770 ELSEIF (shell_present .AND. .NOT. shell_model_ad) THEN
771 cpabort("Non adiabatic shell-model not implemented.")
772 ELSE
773 DO i = 1, natoms
774 particle_set(i)%f(1) = f_total(1, i)
775 particle_set(i)%f(2) = f_total(2, i)
776 particle_set(i)%f(3) = f_total(3, i)
777 END DO
778 END IF
779 END SELECT
780
781 IF (iw > 0) THEN
782 WRITE (iw, '(A)') " FIST::(3)TOTAL FORCES - THE END..."
783 WRITE (iw, '(3f15.9)') ((particle_set(i)%f(j), j=1, 3), i=1, natoms)
784 IF (shell_present .AND. shell_model_ad) THEN
785 WRITE (iw, '(A)') " FIST::(3)SHELL TOTAL FORCES - THE END..."
786 WRITE (iw, '(3f15.9)') ((shell_particle_set(i)%f(j), j=1, 3), i=1, nshell)
787 WRITE (iw, '(A)') " FIST::(3)CORE TOTAL FORCES - THE END..."
788 WRITE (iw, '(3f15.9)') ((core_particle_set(i)%f(j), j=1, 3), i=1, nshell)
789 END IF
790 WRITE (iw, '(A,f15.9)') "Energy after FIST calculation.. exiting now ::", thermo%pot
791 END IF
792 !
793 ! If we are doing debugging, check if variables are present and assign
794 !
795 IF (PRESENT(debug)) THEN
796 CALL para_env%sum(pot_manybody)
797 debug%pot_manybody = pot_manybody
798 CALL para_env%sum(pot_nonbond)
799 debug%pot_nonbond = pot_nonbond
800 CALL para_env%sum(pot_bond)
801 debug%pot_bond = pot_bond
802 CALL para_env%sum(pot_bend)
803 debug%pot_bend = pot_bend
804 CALL para_env%sum(pot_torsion)
805 debug%pot_torsion = pot_torsion
806 CALL para_env%sum(pot_imptors)
807 debug%pot_imptors = pot_imptors
808 CALL para_env%sum(pot_opbend)
809 debug%pot_opbend = pot_opbend
810 CALL para_env%sum(pot_urey_bradley)
811 debug%pot_urey_bradley = pot_urey_bradley
812 CALL para_env%sum(f_nonbond)
813 debug%f_nonbond = f_nonbond
814 IF (use_virial) THEN
815 CALL para_env%sum(pv_nonbond)
816 debug%pv_nonbond = pv_nonbond
817 CALL para_env%sum(pv_bond)
818 debug%pv_bond = pv_bond
819 CALL para_env%sum(pv_bend)
820 debug%pv_bend = pv_bend
821 CALL para_env%sum(pv_torsion)
822 debug%pv_torsion = pv_torsion
823 CALL para_env%sum(pv_imptors)
824 debug%pv_imptors = pv_imptors
825 CALL para_env%sum(pv_urey_bradley)
826 debug%pv_ub = pv_urey_bradley
827 END IF
828 SELECT CASE (ewald_type)
830 debug%pot_g = vg_coulomb
831 debug%pv_g = pv_g
832 debug%f_g = fg_coulomb
833 CASE (do_ewald_ewald)
834 debug%pot_g = vg_coulomb
835 IF (use_virial) debug%pv_g = pv_g
836 CASE default
837 debug%pot_g = 0.0_dp
838 debug%f_g = 0.0_dp
839 IF (use_virial) debug%pv_g = 0.0_dp
840 END SELECT
841 END IF
842
843 ! print properties if requested
844 print_section => section_vals_get_subs_vals(mm_section, "PRINT")
845 CALL print_fist(fist_env, print_section, atomic_kind_set, particle_set, cell)
846
847 ! deallocating all local variables
848 IF (ALLOCATED(fg_coulomb)) THEN
849 DEALLOCATE (fg_coulomb)
850 END IF
851 IF (ALLOCATED(f_total)) THEN
852 DEALLOCATE (f_total)
853 END IF
854 DEALLOCATE (f_nonbond)
855 IF (shell_present) THEN
856 DEALLOCATE (fshell_total)
857 IF (ewald_type /= do_ewald_none) THEN
858 DEALLOCATE (fgshell_coulomb)
859 END IF
860 DEALLOCATE (fshell_nonbond)
861 END IF
862 CALL cp_print_key_finished_output(iw, logger, mm_section, "PRINT%DERIVATIVES")
863 CALL cp_print_key_finished_output(iw2, logger, mm_section, "PRINT%EWALD_INFO")
864 CALL timestop(handle)
865
866 END SUBROUTINE fist_calc_energy_force
867
868! **************************************************************************************************
869!> \brief Print properties number according the requests in input file
870!> \param fist_env ...
871!> \param print_section ...
872!> \param atomic_kind_set ...
873!> \param particle_set ...
874!> \param cell ...
875!> \par History
876!> [01.2006] created
877!> \author Teodoro Laino
878! **************************************************************************************************
879 SUBROUTINE print_fist(fist_env, print_section, atomic_kind_set, particle_set, cell)
880 TYPE(fist_environment_type), POINTER :: fist_env
881 TYPE(section_vals_type), POINTER :: print_section
882 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
883 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
884 TYPE(cell_type), POINTER :: cell
885
886 INTEGER :: unit_nr
887 TYPE(cp_logger_type), POINTER :: logger
888 TYPE(fist_nonbond_env_type), POINTER :: fist_nonbond_env
889 TYPE(section_vals_type), POINTER :: print_key
890
891 NULLIFY (logger, print_key, fist_nonbond_env)
892 logger => cp_get_default_logger()
893 print_key => section_vals_get_subs_vals(print_section, "dipole")
894 CALL fist_env_get(fist_env, fist_nonbond_env=fist_nonbond_env)
895 IF (btest(cp_print_key_should_output(logger%iter_info, print_key), &
896 cp_p_file)) THEN
897 unit_nr = cp_print_key_unit_nr(logger, print_section, "dipole", &
898 extension=".data", middle_name="MM_DIPOLE", log_filename=.false.)
899 CALL fist_dipole(fist_env, print_section, atomic_kind_set, particle_set, &
900 cell, unit_nr, fist_nonbond_env%charges)
901 CALL cp_print_key_finished_output(unit_nr, logger, print_key)
902 END IF
903
904 END SUBROUTINE print_fist
905
906END MODULE fist_force
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.
Holds information on atomic properties.
Handles all functions related to the CELL.
subroutine, public init_cell(cell, hmat, periodic)
Initialise/readjust a simulation cell after hmat has been changed.
Handles all functions related to the CELL.
Definition cell_types.F:15
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,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
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
unit conversion facility
Definition cp_units.F:30
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
Definition cp_units.F:1179
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
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.
Treats the electrostatic for multipoles (up to quadrupoles)
recursive subroutine, public ewald_multipole_evaluate(ewald_env, ewald_pw, nonbond_env, cell, particle_set, local_particles, energy_local, energy_glob, e_neut, e_self, task, do_correction_bonded, do_forces, do_stress, do_efield, radii, charges, dipoles, quadrupoles, forces_local, forces_glob, pv_local, pv_glob, efield0, efield1, efield2, iw, do_debug, atomic_kind_set, mm_section)
Computes the potential and the force for a lattice sum of multipoles (up to quadrupole)
subroutine, public ewald_self_atom(ewald_env, atomic_kind_set, local_particles, e_self, charges)
Computes the self interaction per atom.
Definition ewalds.F:364
subroutine, public ewald_evaluate(ewald_env, ewald_pw, cell, atomic_kind_set, particle_set, local_particles, fg_coulomb, vg_coulomb, pv_g, use_virial, charges, e_coulomb)
computes the potential and the force from the g-space part of the 1/r potential Ref....
Definition ewalds.F:77
subroutine, public ewald_print(iw, pot_nonbond, e_gspace, e_self, e_neut, e_bonded)
...
Definition ewalds.F:424
subroutine, public ewald_self(ewald_env, cell, atomic_kind_set, local_particles, e_self, e_neut, charges)
Computes the self interaction from g-space and the neutralizing background.
Definition ewalds.F:279
an exclusion type
subroutine, public fist_efield_energy_force(qenergy, qforce, qpv, atomic_kind_set, particle_set, cell, efield, use_virial, iunit, charges)
...
subroutine, public fist_dipole(fist_env, print_section, atomic_kind_set, particle_set, cell, unit_nr, charges)
Evaluates the Dipole of a classical charge distribution(point-like) possibly using the berry phase fo...
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_calc_energy_force(fist_env, debug)
Calculates the total potential energy, total force, and the total pressure tensor from the potentials...
Definition fist_force.F:112
subroutine, public force_intra_control(molecule_set, molecule_kind_set, local_molecules, particle_set, shell_particle_set, core_particle_set, pot_bond, pot_bend, pot_urey_bradley, pot_torsion, pot_imp_torsion, pot_opbend, pot_shell, pv_bond, pv_bend, pv_urey_bradley, pv_torsion, pv_imp_torsion, pv_opbend, f_bond, f_bend, f_torsion, f_ub, f_imptor, f_opbend, cell, use_virial, atprop_env)
Computes the the intramolecular energies, forces, and pressure tensors.
subroutine, public list_control(atomic_kind_set, particle_set, local_particles, cell, fist_nonbond_env, para_env, mm_section, shell_particle_set, core_particle_set, force_update, exclusions)
...
subroutine, public force_nonbond(fist_nonbond_env, ewald_env, particle_set, cell, pot_nonbond, f_nonbond, pv_nonbond, fshell_nonbond, fcore_nonbond, atprop_env, atomic_kind_set, use_virial)
Calculates the force and the potential of the minimum image, and the pressure tensor.
subroutine, public bonded_correct_gaussian(fist_nonbond_env, atomic_kind_set, local_particles, particle_set, ewald_env, v_bonded_corr, pv_bc, shell_particle_set, core_particle_set, atprop_env, cell, use_virial)
corrects electrostatics for bonded terms
subroutine, public fist_pol_evaluate(atomic_kind_set, multipoles, ewald_env, ewald_pw, fist_nonbond_env, cell, particle_set, local_particles, thermo, vg_coulomb, pot_nonbond, f_nonbond, fg_coulomb, use_virial, pv_g, pv_nonbond, mm_section, do_ipol)
Main driver for evaluating energy/forces in a polarizable forcefield.
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_fist_pol_none
objects that represent the structure of input sections and the data contained in an input section
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
subroutine, public density_nonbond(fist_nonbond_env, particle_set, cell, para_env)
...
subroutine, public force_nonbond_manybody(fist_nonbond_env, particle_set, cell, f_nonbond, pv_nonbond, use_virial)
...
subroutine, public energy_manybody(fist_nonbond_env, atomic_kind_set, local_particles, particle_set, cell, pot_manybody, para_env, mm_section, use_virial)
computes the embedding contribution to the energy
Interface to the message passing library MPI.
Define the molecule kind structure types and the corresponding functionality.
Define the data structure for the molecule information.
Multipole structure: for multipole (fixed and induced) in FF based MD.
Define the data structure for the particle information.
Definition pme.F:13
subroutine, public pme_evaluate(ewald_env, ewald_pw, box, particle_set, vg_coulomb, fg_coulomb, pv_g, shell_particle_set, core_particle_set, fgshell_coulomb, fgcore_coulomb, use_virial, charges, atprop)
...
Definition pme.F:96
functions related to the poisson solver on regular grids
integer, parameter, public do_ewald_pme
integer, parameter, public do_ewald_ewald
integer, parameter, public do_ewald_none
integer, parameter, public do_ewald_spme
Calculate the electrostatic energy by the Smooth Particle Ewald method.
Definition spme.F:14
subroutine, public spme_evaluate(ewald_env, ewald_pw, box, particle_set, fg_coulomb, vg_coulomb, pv_g, shell_particle_set, core_particle_set, fgshell_coulomb, fgcore_coulomb, use_virial, charges, atprop)
...
Definition spme.F:94
Provides all information about an atomic kind.
type for the atomic properties
Type defining parameters related to the simulation cell.
Definition cell_types.F:55
type of a logger, at the moment it contains just a print level starting at which level it should be l...
represents a system: atoms, molecules, their pos,vel,...
structure to store local (to a processor) ordered lists of integers.
A type used to store lists of exclusions and onfos.
stores all the informations relevant to an mpi environment