(git:374b731)
Loading...
Searching...
No Matches
ewalds.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \par History
10!> JGH (15-Mar-2001) : New routine ewald_setup (former pme_setup)
11!> JGH (23-Mar-2001) : Get rid of global variable ewald_grp
12! **************************************************************************************************
13MODULE ewalds
14
17 USE bibliography, ONLY: ewald1921,&
18 cite_reference
19 USE cell_types, ONLY: cell_type
21 USE dg_types, ONLY: dg_get,&
26 USE ewald_pw_types, ONLY: ewald_pw_get,&
28 USE kinds, ONLY: dp
29 USE mathconstants, ONLY: fourpi,&
30 oorootpi,&
31 pi
43#include "./base/base_uses.f90"
44
45 IMPLICIT NONE
46 LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .true.
47 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'ewalds'
48
49 PRIVATE
51
52CONTAINS
53
54! **************************************************************************************************
55!> \brief computes the potential and the force from the g-space part of
56!> the 1/r potential
57!> Ref.: J.-P. Hansen, Enrico Fermi School, 1985
58!> Note: Only the positive G-vectors are used in the sum.
59!> \param ewald_env ...
60!> \param ewald_pw ...
61!> \param cell ...
62!> \param atomic_kind_set ...
63!> \param particle_set ...
64!> \param local_particles ...
65!> \param fg_coulomb ...
66!> \param vg_coulomb ...
67!> \param pv_g ...
68!> \param use_virial ...
69!> \param charges ...
70!> \param e_coulomb ...
71!> \param pv_coulomb ...
72!> \par History
73!> JGH (21-Feb-2001) : changed name
74!> \author CJM
75! **************************************************************************************************
76 SUBROUTINE ewald_evaluate(ewald_env, ewald_pw, cell, atomic_kind_set, particle_set, &
77 local_particles, fg_coulomb, vg_coulomb, pv_g, use_virial, charges, e_coulomb, &
78 pv_coulomb)
79 TYPE(ewald_environment_type), POINTER :: ewald_env
80 TYPE(ewald_pw_type), POINTER :: ewald_pw
81 TYPE(cell_type), POINTER :: cell
82 TYPE(atomic_kind_type), POINTER :: atomic_kind_set(:)
83 TYPE(particle_type), POINTER :: particle_set(:)
84 TYPE(distribution_1d_type), POINTER :: local_particles
85 REAL(kind=dp), DIMENSION(:, :), INTENT(OUT) :: fg_coulomb
86 REAL(kind=dp), INTENT(OUT) :: vg_coulomb
87 REAL(kind=dp), DIMENSION(:, :), INTENT(OUT) :: pv_g
88 LOGICAL, INTENT(IN) :: use_virial
89 REAL(kind=dp), DIMENSION(:), OPTIONAL, POINTER :: charges, e_coulomb
90 REAL(kind=dp), DIMENSION(:, :, :), OPTIONAL, &
91 POINTER :: pv_coulomb
92
93 CHARACTER(LEN=*), PARAMETER :: routinen = 'ewald_evaluate'
94
95 COMPLEX(KIND=dp) :: snode
96 COMPLEX(KIND=dp), ALLOCATABLE, DIMENSION(:) :: summe
97 INTEGER :: gpt, handle, iparticle, iparticle_kind, &
98 iparticle_local, lp, mp, nnodes, node, &
99 np, nparticle_kind, nparticle_local
100 INTEGER, DIMENSION(:, :), POINTER :: bds
101 LOGICAL :: atenergy, atstress, use_charge_array
102 REAL(kind=dp) :: alpha, denom, e_igdotr, factor, &
103 four_alpha_sq, gauss, pref, q
104 REAL(kind=dp), DIMENSION(3) :: vec
105 REAL(kind=dp), DIMENSION(:), POINTER :: charge
106 REAL(kind=dp), DIMENSION(:, :, :), POINTER :: rho0
107 TYPE(atomic_kind_type), POINTER :: atomic_kind
108 TYPE(dg_rho0_type), POINTER :: dg_rho0
109 TYPE(dg_type), POINTER :: dg
110 TYPE(mp_comm_type) :: group
111 TYPE(pw_grid_type), POINTER :: pw_grid
112 TYPE(pw_pool_type), POINTER :: pw_pool
113 TYPE(structure_factor_type) :: exp_igr
114
115 CALL timeset(routinen, handle)
116 CALL cite_reference(ewald1921)
117 use_charge_array = PRESENT(charges)
118 IF (use_charge_array) use_charge_array = ASSOCIATED(charges)
119 atenergy = PRESENT(e_coulomb)
120 IF (atenergy) atenergy = ASSOCIATED(e_coulomb)
121 IF (atenergy) e_coulomb = 0._dp
122
123 atstress = PRESENT(pv_coulomb)
124 IF (atstress) atstress = ASSOCIATED(pv_coulomb)
125 IF (atstress) pv_coulomb = 0._dp
126
127 ! pointing
128 CALL ewald_env_get(ewald_env, alpha=alpha, group=group)
129 CALL ewald_pw_get(ewald_pw, pw_big_pool=pw_pool, dg=dg)
130 CALL dg_get(dg, dg_rho0=dg_rho0)
131 rho0 => dg_rho0%density%array
132 pw_grid => pw_pool%pw_grid
133 bds => pw_grid%bounds
134
135 ! allocating
136 nparticle_kind = SIZE(atomic_kind_set)
137 nnodes = 0
138 DO iparticle_kind = 1, nparticle_kind
139 nnodes = nnodes + local_particles%n_el(iparticle_kind)
140 END DO
141
142 CALL structure_factor_allocate(pw_grid%bounds, nnodes, exp_igr)
143
144 ALLOCATE (summe(1:pw_grid%ngpts_cut))
145 ALLOCATE (charge(1:nnodes))
146
147 ! Initializing vg_coulomb and fg_coulomb
148 vg_coulomb = 0.0_dp
149 fg_coulomb = 0.0_dp
150 IF (use_virial) pv_g = 0.0_dp
151 ! defining four_alpha_sq
152 four_alpha_sq = 4.0_dp*alpha**2
153 ! zero node count
154 node = 0
155 DO iparticle_kind = 1, nparticle_kind
156 nparticle_local = local_particles%n_el(iparticle_kind)
157 IF (use_charge_array) THEN
158 DO iparticle_local = 1, nparticle_local
159 node = node + 1
160 iparticle = local_particles%list(iparticle_kind)%array(iparticle_local)
161 charge(node) = charges(iparticle)
162 vec = matmul(cell%h_inv, particle_set(iparticle)%r)
163 CALL structure_factor_evaluate(vec, exp_igr%lb, &
164 exp_igr%ex(:, node), exp_igr%ey(:, node), exp_igr%ez(:, node))
165 END DO
166 ELSE
167 atomic_kind => atomic_kind_set(iparticle_kind)
168 CALL get_atomic_kind(atomic_kind=atomic_kind, qeff=q)
169 DO iparticle_local = 1, nparticle_local
170 node = node + 1
171 iparticle = local_particles%list(iparticle_kind)%array(iparticle_local)
172 charge(node) = q
173 vec = matmul(cell%h_inv, particle_set(iparticle)%r)
174 CALL structure_factor_evaluate(vec, exp_igr%lb, &
175 exp_igr%ex(:, node), exp_igr%ey(:, node), exp_igr%ez(:, node))
176 END DO
177 END IF
178 END DO
179
180 summe(:) = cmplx(0.0_dp, 0.0_dp, kind=dp)
181 ! looping over the positive g-vectors
182 DO gpt = 1, pw_grid%ngpts_cut_local
183
184 lp = pw_grid%mapl%pos(pw_grid%g_hat(1, gpt))
185 mp = pw_grid%mapm%pos(pw_grid%g_hat(2, gpt))
186 np = pw_grid%mapn%pos(pw_grid%g_hat(3, gpt))
187
188 lp = lp + bds(1, 1)
189 mp = mp + bds(1, 2)
190 np = np + bds(1, 3)
191
192 ! initializing sum to be used in the energy and force
193 DO node = 1, nnodes
194 summe(gpt) = summe(gpt) + charge(node)* &
195 (exp_igr%ex(lp, node) &
196 *exp_igr%ey(mp, node) &
197 *exp_igr%ez(np, node))
198 END DO
199 END DO
200 CALL group%sum(summe)
201
202 pref = fourpi/pw_grid%vol
203
204 ! looping over the positive g-vectors
205 DO gpt = 1, pw_grid%ngpts_cut_local
206 ! computing the potential energy
207 lp = pw_grid%mapl%pos(pw_grid%g_hat(1, gpt))
208 mp = pw_grid%mapm%pos(pw_grid%g_hat(2, gpt))
209 np = pw_grid%mapn%pos(pw_grid%g_hat(3, gpt))
210
211 lp = lp + bds(1, 1)
212 mp = mp + bds(1, 2)
213 np = np + bds(1, 3)
214
215 IF (pw_grid%gsq(gpt) <= 1.0e-10_dp) cycle
216
217 gauss = (rho0(lp, mp, np)*pw_grid%vol)**2/pw_grid%gsq(gpt)
218 factor = gauss*real(summe(gpt)*conjg(summe(gpt)), kind=dp)
219 vg_coulomb = vg_coulomb + factor
220
221 ! atomic energies
222 IF (atenergy) THEN
223 DO node = 1, nnodes
224 snode = conjg(exp_igr%ex(lp, node) &
225 *exp_igr%ey(mp, node) &
226 *exp_igr%ez(np, node))
227 e_coulomb(node) = e_coulomb(node) + gauss*charge(node)*real(summe(gpt)*snode, kind=dp)
228 END DO
229 END IF
230
231 ! computing the force
232 node = 0
233 DO node = 1, nnodes
234 e_igdotr = aimag(summe(gpt)*conjg &
235 (exp_igr%ex(lp, node) &
236 *exp_igr%ey(mp, node) &
237 *exp_igr%ez(np, node)))
238 fg_coulomb(:, node) = fg_coulomb(:, node) &
239 + charge(node)*gauss*e_igdotr*pw_grid%g(:, gpt)
240 END DO
241
242 ! compute the virial P*V
243 denom = 1.0_dp/four_alpha_sq + 1.0_dp/pw_grid%gsq(gpt)
244 IF (use_virial) THEN
245 pv_g(1, 1) = pv_g(1, 1) + factor*(1.0_dp - 2.0_dp*pw_grid%g(1, gpt)*pw_grid%g(1, gpt)*denom)
246 pv_g(1, 2) = pv_g(1, 2) - factor*(2.0_dp*pw_grid%g(1, gpt)*pw_grid%g(2, gpt)*denom)
247 pv_g(1, 3) = pv_g(1, 3) - factor*(2.0_dp*pw_grid%g(1, gpt)*pw_grid%g(3, gpt)*denom)
248 pv_g(2, 1) = pv_g(2, 1) - factor*(2.0_dp*pw_grid%g(2, gpt)*pw_grid%g(1, gpt)*denom)
249 pv_g(2, 2) = pv_g(2, 2) + factor*(1.0_dp - 2.0_dp*pw_grid%g(2, gpt)*pw_grid%g(2, gpt)*denom)
250 pv_g(2, 3) = pv_g(2, 3) - factor*(2.0_dp*pw_grid%g(2, gpt)*pw_grid%g(3, gpt)*denom)
251 pv_g(3, 1) = pv_g(3, 1) - factor*(2.0_dp*pw_grid%g(3, gpt)*pw_grid%g(1, gpt)*denom)
252 pv_g(3, 2) = pv_g(3, 2) - factor*(2.0_dp*pw_grid%g(3, gpt)*pw_grid%g(2, gpt)*denom)
253 pv_g(3, 3) = pv_g(3, 3) + factor*(1.0_dp - 2.0_dp*pw_grid%g(3, gpt)*pw_grid%g(3, gpt)*denom)
254 END IF
255 IF (atstress) THEN
256 DO node = 1, nnodes
257 snode = conjg(exp_igr%ex(lp, node) &
258 *exp_igr%ey(mp, node) &
259 *exp_igr%ez(np, node))
260 factor = gauss*charge(node)*real(summe(gpt)*snode, kind=dp)
261 pv_coulomb(1, 1, node) = pv_coulomb(1, 1, node) + factor*(1.0_dp - 2.0_dp*pw_grid%g(1, gpt)*pw_grid%g(1, gpt)*denom)
262 pv_coulomb(1, 2, node) = pv_coulomb(1, 2, node) - factor*(2.0_dp*pw_grid%g(1, gpt)*pw_grid%g(2, gpt)*denom)
263 pv_coulomb(1, 3, node) = pv_coulomb(1, 3, node) - factor*(2.0_dp*pw_grid%g(1, gpt)*pw_grid%g(3, gpt)*denom)
264 pv_coulomb(2, 1, node) = pv_coulomb(2, 1, node) - factor*(2.0_dp*pw_grid%g(2, gpt)*pw_grid%g(1, gpt)*denom)
265 pv_coulomb(2, 2, node) = pv_coulomb(2, 2, node) + factor*(1.0_dp - 2.0_dp*pw_grid%g(2, gpt)*pw_grid%g(2, gpt)*denom)
266 pv_coulomb(2, 3, node) = pv_coulomb(2, 3, node) - factor*(2.0_dp*pw_grid%g(2, gpt)*pw_grid%g(3, gpt)*denom)
267 pv_coulomb(3, 1, node) = pv_coulomb(3, 1, node) - factor*(2.0_dp*pw_grid%g(3, gpt)*pw_grid%g(1, gpt)*denom)
268 pv_coulomb(3, 2, node) = pv_coulomb(3, 2, node) - factor*(2.0_dp*pw_grid%g(3, gpt)*pw_grid%g(2, gpt)*denom)
269 pv_coulomb(3, 3, node) = pv_coulomb(3, 3, node) + factor*(1.0_dp - 2.0_dp*pw_grid%g(3, gpt)*pw_grid%g(3, gpt)*denom)
270 END DO
271 END IF
272 END DO
273
274 vg_coulomb = vg_coulomb*pref
275 IF (use_virial) pv_g = pv_g*pref
276 IF (atenergy) e_coulomb = e_coulomb*pref
277 IF (atstress) pv_coulomb = pv_coulomb*pref
278
279 fg_coulomb = fg_coulomb*(2.0_dp*pref)
280
281 CALL structure_factor_deallocate(exp_igr)
282
283 DEALLOCATE (charge, summe)
284
285 CALL timestop(handle)
286
287 END SUBROUTINE ewald_evaluate
288
289! **************************************************************************************************
290!> \brief Computes the self interaction from g-space
291!> and the neutralizing background
292!> \param ewald_env ...
293!> \param cell ...
294!> \param atomic_kind_set ...
295!> \param local_particles ...
296!> \param e_self ...
297!> \param e_neut ...
298!> \param charges ...
299!> \par History
300!> none
301!> \author CJM
302! **************************************************************************************************
303 SUBROUTINE ewald_self(ewald_env, cell, atomic_kind_set, local_particles, e_self, &
304 e_neut, charges)
305
306 TYPE(ewald_environment_type), POINTER :: ewald_env
307 TYPE(cell_type), POINTER :: cell
308 TYPE(atomic_kind_type), POINTER :: atomic_kind_set(:)
309 TYPE(distribution_1d_type), POINTER :: local_particles
310 REAL(kind=dp), INTENT(OUT) :: e_self, e_neut
311 REAL(kind=dp), DIMENSION(:), POINTER :: charges
312
313 INTEGER :: ewald_type, iparticle_kind, &
314 nparticle_kind, nparticle_local
315 LOGICAL :: is_shell
316 REAL(kind=dp) :: alpha, mm_radius, q, q_neutg, q_self, &
317 q_sum, qcore, qshell
318 TYPE(atomic_kind_type), POINTER :: atomic_kind
319 TYPE(mp_comm_type) :: group
320 TYPE(shell_kind_type), POINTER :: shell
321
322 CALL ewald_env_get(ewald_env, ewald_type=ewald_type, &
323 alpha=alpha, group=group)
324 q_neutg = 0.0_dp
325 q_self = 0.0_dp
326 q_sum = 0.0_dp
327 nparticle_kind = SIZE(atomic_kind_set)
328 IF (ASSOCIATED(charges)) THEN
329 q_self = dot_product(charges, charges)
330 q_sum = sum(charges)
331 ! check and abort..
332 DO iparticle_kind = 1, nparticle_kind
333 atomic_kind => atomic_kind_set(iparticle_kind)
334 CALL get_atomic_kind(atomic_kind=atomic_kind, mm_radius=mm_radius)
335 IF (mm_radius > 0.0_dp) THEN
336 cpabort("Array of charges not implemented for mm_radius>0.0 !!")
337 END IF
338 END DO
339 ELSE
340 DO iparticle_kind = 1, nparticle_kind
341 atomic_kind => atomic_kind_set(iparticle_kind)
342 CALL get_atomic_kind(atomic_kind=atomic_kind, mm_radius=mm_radius, &
343 qeff=q, shell_active=is_shell, shell=shell)
344 nparticle_local = local_particles%n_el(iparticle_kind)
345 IF (is_shell) THEN
346 CALL get_shell(shell=shell, charge_core=qcore, charge_shell=qshell)
347 ! MI: the core-shell ES interaction, when core and shell belong to the same ion, is excluded
348 ! in the nonbond correction term. Therefore, here the self interaction is computed entirely
349 q_self = q_self + qcore*qcore*nparticle_local + qshell*qshell*nparticle_local
350 q_sum = q_sum + qcore*nparticle_local + qshell*nparticle_local
351 IF (mm_radius > 0) THEN
352 ! the core is always a point charge
353 q_neutg = q_neutg + 2.0_dp*qshell*mm_radius**2
354 END IF
355 ELSE
356 q_self = q_self + q*q*nparticle_local
357 q_sum = q_sum + q*nparticle_local
358 IF (mm_radius > 0) THEN
359 q_neutg = q_neutg + 2.0_dp*q*mm_radius**2
360 END IF
361 END IF
362 END DO
363
364 CALL group%sum(q_self)
365 CALL group%sum(q_sum)
366 END IF
367
368 e_neut = 0.0_dp
369 e_self = 0.0_dp
370 IF (ewald_type /= do_ewald_none) THEN
371 e_self = -q_self*alpha*oorootpi
372 e_neut = -q_sum*pi/(2.0_dp*cell%deth)*(q_sum/alpha**2 - q_neutg)
373 END IF
374
375 END SUBROUTINE ewald_self
376
377! **************************************************************************************************
378!> \brief Computes the self interaction per atom
379!> \param ewald_env ...
380!> \param atomic_kind_set ...
381!> \param local_particles ...
382!> \param e_self ...
383!> \param charges ...
384!> \par History
385!> none
386!> \author JHU from ewald_self
387! **************************************************************************************************
388 SUBROUTINE ewald_self_atom(ewald_env, atomic_kind_set, local_particles, e_self, &
389 charges)
390
391 TYPE(ewald_environment_type), POINTER :: ewald_env
392 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set(:)
393 TYPE(distribution_1d_type), POINTER :: local_particles
394 REAL(kind=dp), DIMENSION(:), INTENT(INOUT) :: e_self(:)
395 REAL(kind=dp), DIMENSION(:), POINTER :: charges
396
397 INTEGER :: ewald_type, ii, iparticle_kind, &
398 iparticle_local, nparticle_kind, &
399 nparticle_local
400 LOGICAL :: is_shell
401 REAL(kind=dp) :: alpha, fself, q, qcore, qshell
402 TYPE(atomic_kind_type), POINTER :: atomic_kind
403 TYPE(shell_kind_type), POINTER :: shell
404
405 CALL ewald_env_get(ewald_env, ewald_type=ewald_type, alpha=alpha)
406
407 fself = alpha*oorootpi
408
409 IF (ewald_type /= do_ewald_none) THEN
410 nparticle_kind = SIZE(atomic_kind_set)
411 IF (ASSOCIATED(charges)) THEN
412 cpabort("Atomic energy not implemented for charges")
413 ELSE
414 DO iparticle_kind = 1, nparticle_kind
415 atomic_kind => atomic_kind_set(iparticle_kind)
416 nparticle_local = local_particles%n_el(iparticle_kind)
417 CALL get_atomic_kind(atomic_kind=atomic_kind, qeff=q, &
418 shell_active=is_shell, shell=shell)
419 IF (is_shell) THEN
420 CALL get_shell(shell=shell, charge_core=qcore, charge_shell=qshell)
421 DO iparticle_local = 1, nparticle_local
422 ii = local_particles%list(iparticle_kind)%array(iparticle_local)
423 e_self(ii) = e_self(ii) - (qcore*qcore + qshell*qshell)*fself
424 END DO
425 ELSE
426 DO iparticle_local = 1, nparticle_local
427 ii = local_particles%list(iparticle_kind)%array(iparticle_local)
428 e_self(ii) = e_self(ii) - q*q*fself
429 END DO
430 END IF
431 END DO
432 END IF
433 END IF
434
435 END SUBROUTINE ewald_self_atom
436
437! **************************************************************************************************
438!> \brief ...
439!> \param iw ...
440!> \param pot_nonbond ...
441!> \param e_gspace ...
442!> \param e_self ...
443!> \param e_neut ...
444!> \param e_bonded ...
445!> \par History
446!> none
447!> \author CJM
448! **************************************************************************************************
449 SUBROUTINE ewald_print(iw, pot_nonbond, e_gspace, e_self, e_neut, e_bonded)
450
451 INTEGER, INTENT(IN) :: iw
452 REAL(kind=dp), INTENT(IN) :: pot_nonbond, e_gspace, e_self, e_neut, &
453 e_bonded
454
455 IF (iw > 0) THEN
456 WRITE (iw, '( A, A )') ' *********************************', &
457 '**********************************************'
458 WRITE (iw, '( A, A, T35, A, T56, E25.15 )') ' INITIAL GSPACE ENERGY', &
459 '[hartree]', '= ', e_gspace
460 WRITE (iw, '( A, A, T35, A, T56, E25.15 )') ' INITIAL NONBONDED ENERGY', &
461 '[hartree]', '= ', pot_nonbond
462 WRITE (iw, '( A, A, T35, A, T56, E25.15 )') ' SELF ENERGY CORRECTION', &
463 '[hartree]', '= ', e_self
464 WRITE (iw, '( A, A, T35, A, T56, E25.15 )') ' NEUT. BACKGROUND', &
465 '[hartree]', '= ', e_neut
466 WRITE (iw, '( A, A, T35, A, T56, E25.15 )') ' BONDED CORRECTION', &
467 '[hartree]', '= ', e_bonded
468 WRITE (iw, '( A, A )') ' *********************************', &
469 '**********************************************'
470 END IF
471 END SUBROUTINE ewald_print
472
473END MODULE ewalds
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.
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public ewald1921
Handles all functions related to the CELL.
Definition cell_types.F:15
subroutine, public dg_get(dg, dg_rho0)
Get the dg_type.
Definition dg_types.F:44
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_get(ewald_pw, pw_big_pool, pw_small_pool, rs_desc, poisson_env, dg)
get the ewald_pw environment to the correct program.
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, pv_coulomb)
computes the potential and the force from the g-space part of the 1/r potential Ref....
Definition ewalds.F:79
subroutine, public ewald_self_atom(ewald_env, atomic_kind_set, local_particles, e_self, charges)
Computes the self interaction per atom.
Definition ewalds.F:390
subroutine, public ewald_print(iw, pot_nonbond, e_gspace, e_self, e_neut, e_bonded)
...
Definition ewalds.F:450
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:305
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Definition of mathematical constants and functions.
real(kind=dp), parameter, public oorootpi
real(kind=dp), parameter, public pi
real(kind=dp), parameter, public fourpi
Interface to the message passing library MPI.
Define the data structure for the particle information.
functions related to the poisson solver on regular grids
integer, parameter, public do_ewald_none
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
elemental subroutine, public get_shell(shell, charge, charge_core, charge_shell, mass_core, mass_shell, k2_spring, k4_spring, max_dist, shell_cutoff)
...
subroutine, public structure_factor_deallocate(exp_igr)
...
subroutine, public structure_factor_allocate(bds, nparts, exp_igr, allocate_centre, allocate_shell_e, allocate_shell_centre, nshell)
...
subroutine, public structure_factor_evaluate(delta, lb, ex, ey, ez)
...
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
Definition cell_types.F:55
Type for Gaussian Densities type = type of gaussian (PME) grid = grid number gcc = Gaussian contracti...
structure to store local (to a processor) ordered lists of integers.
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...