(git:374b731)
Loading...
Searching...
No Matches
voronoi_interface.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!> \brief Interface for Voronoi Integration and output of BQB files
10!> \par History
11!> 11/2020 created [mbrehm]
12!> \author Martin Brehm
13! **************************************************************************************************
21 brehm2021, cite_reference
22 USE kinds, ONLY: dp, default_path_length
23 USE cell_types, ONLY: cell_type, pbc
24 USE pw_types, ONLY: pw_r3d_rs_type
25 USE physcon, ONLY: bohr, debye
26 USE mathconstants, ONLY: fourpi
27 USE orbital_pointers, ONLY: indco
33 USE qs_rho_types, ONLY: qs_rho_get, &
40 USE qs_kind_types, ONLY: get_qs_kind, &
43 USE qs_subsys_types, ONLY: qs_subsys_get, &
47 USE physcon, ONLY: angstrom, femtoseconds
49 USE input_constants, ONLY: &
52 USE qs_rho0_types, ONLY: rho0_atom_type, &
54 USE iso_c_binding, ONLY: c_int, c_double, c_char
55
56#if defined(__HAS_IEEE_EXCEPTIONS)
57 USE ieee_exceptions, ONLY: ieee_get_halting_mode, &
58 ieee_set_halting_mode, &
59 ieee_all
60#endif
61
62#include "./base/base_uses.f90"
63
64 IMPLICIT NONE
65 PRIVATE
66
67 ! Global parameters
68 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'voronoi_interface'
70 INTEGER :: step_count = 0
71
72#if defined(__LIBVORI)
73
74 ! The C interface to libvori
75
76 INTERFACE
77
78 INTEGER(C_INT) FUNCTION libvori_setbqbskipfirst(i) bind(C, NAME='libvori_setBQBSkipFirst')
79 USE iso_c_binding, ONLY: c_int
80 INTEGER(C_INT), VALUE :: i
81
82 END FUNCTION libvori_setbqbskipfirst
83
84 INTEGER(C_INT) FUNCTION libvori_setbqbstorestep(i) bind(C, NAME='libvori_setBQBStoreStep')
85 USE iso_c_binding, ONLY: c_int
86 INTEGER(C_INT), VALUE :: i
87
88 END FUNCTION libvori_setbqbstorestep
89
90 INTEGER(C_INT) FUNCTION libvori_setvoronoiskipfirst(i) bind(C, NAME='libvori_setVoronoiSkipFirst')
91 USE iso_c_binding, ONLY: c_int
92 INTEGER(C_INT), VALUE :: i
93
94 END FUNCTION libvori_setvoronoiskipfirst
95
96 INTEGER(C_INT) FUNCTION libvori_setbqbcheck(i) bind(C, NAME='libvori_setBQBCheck')
97 USE iso_c_binding, ONLY: c_int
98 INTEGER(C_INT), VALUE :: i
99
100 END FUNCTION libvori_setbqbcheck
101
102 INTEGER(C_INT) FUNCTION libvori_setbqbfilename(len, s) bind(C, NAME='libvori_setBQBFilename')
103 USE iso_c_binding, ONLY: c_int, c_char
104 INTEGER(C_INT), VALUE :: len
105 CHARACTER(C_CHAR) :: s(*)
106
107 END FUNCTION libvori_setbqbfilename
108
109 INTEGER(C_INT) FUNCTION libvori_setbqbparmstring(len, s) bind(C, NAME='libvori_setBQBParmString')
110 USE iso_c_binding, ONLY: c_int, c_char
111 INTEGER(C_INT), VALUE :: len
112 CHARACTER(C_CHAR) :: s(*)
113
114 END FUNCTION libvori_setbqbparmstring
115
116 INTEGER(C_INT) FUNCTION libvori_setbqbhistory(i) bind(C, NAME='libvori_setBQBHistory')
117 USE iso_c_binding, ONLY: c_int
118 INTEGER(C_INT), VALUE :: i
119
120 END FUNCTION libvori_setbqbhistory
121
122 INTEGER(C_INT) FUNCTION libvori_setbqboptimization(i) bind(C, NAME='libvori_setBQBOptimization')
123 USE iso_c_binding, ONLY: c_int
124 INTEGER(C_INT), VALUE :: i
125
126 END FUNCTION libvori_setbqboptimization
127
128 INTEGER(C_INT) FUNCTION libvori_processbqbframe(step, t) bind(C, NAME='libvori_processBQBFrame')
129 USE iso_c_binding, ONLY: c_int, c_double
130 INTEGER(C_INT), VALUE :: step
131 REAL(C_DOUBLE), VALUE :: t
132
133 END FUNCTION libvori_processbqbframe
134
135 INTEGER(C_INT) FUNCTION libvori_setprefix_voronoi() bind(C, NAME='libvori_setPrefix_Voronoi')
136 USE iso_c_binding, ONLY: c_int
137 END FUNCTION libvori_setprefix_voronoi
138
139 INTEGER(C_INT) FUNCTION libvori_setprefix_bqb() bind(C, NAME='libvori_setPrefix_BQB')
140 USE iso_c_binding, ONLY: c_int
141 END FUNCTION libvori_setprefix_bqb
142
143 INTEGER(C_INT) FUNCTION libvori_setrefinementfactor(i) bind(C, NAME='libvori_setRefinementFactor')
144 USE iso_c_binding, ONLY: c_int
145 INTEGER(C_INT), VALUE :: i
146
147 END FUNCTION libvori_setrefinementfactor
148
149 INTEGER(C_INT) FUNCTION libvori_setjitter(i) bind(C, NAME='libvori_setJitter')
150 USE iso_c_binding, ONLY: c_int
151 INTEGER(C_INT), VALUE :: i
152
153 END FUNCTION libvori_setjitter
154
155 INTEGER(C_INT) FUNCTION libvori_setjitteramplitude(amp) bind(C, NAME='libvori_setJitterAmplitude')
156 USE iso_c_binding, ONLY: c_int, c_double
157 REAL(C_DOUBLE), VALUE :: amp
158
159 END FUNCTION libvori_setjitteramplitude
160
161 INTEGER(C_INT) FUNCTION libvori_setjitterseed(seed) bind(C, NAME='libvori_setJitterSeed')
162 USE iso_c_binding, ONLY: c_int
163 INTEGER(C_INT), VALUE :: seed
164
165 END FUNCTION libvori_setjitterseed
166
167 INTEGER(C_INT) FUNCTION libvori_setempoutput(i) bind(C, NAME='libvori_setEMPOutput')
168 USE iso_c_binding, ONLY: c_int
169 INTEGER(C_INT), VALUE :: i
170
171 END FUNCTION libvori_setempoutput
172
173 INTEGER(C_INT) FUNCTION libvori_setprintlevel_verbose() bind(C, NAME='libvori_setPrintLevel_Verbose')
174 USE iso_c_binding, ONLY: c_int
175 END FUNCTION libvori_setprintlevel_verbose
176
177 INTEGER(C_INT) FUNCTION libvori_setradii_unity() bind(C, NAME='libvori_setRadii_Unity')
178 USE iso_c_binding, ONLY: c_int
179 END FUNCTION libvori_setradii_unity
180
181 INTEGER(C_INT) FUNCTION libvori_setradii_covalent() bind(C, NAME='libvori_setRadii_Covalent')
182 USE iso_c_binding, ONLY: c_int
183 END FUNCTION libvori_setradii_covalent
184
185 INTEGER(C_INT) FUNCTION libvori_setradii_user(factor, rad) bind(C, NAME='libvori_setRadii_User')
186 USE iso_c_binding, ONLY: c_int, c_double
187 REAL(C_DOUBLE), VALUE :: factor
188 REAL(C_DOUBLE) :: rad(*)
189
190 END FUNCTION libvori_setradii_user
191
192 INTEGER(C_INT) FUNCTION libvori_step(step, t) bind(C, NAME='libvori_step')
193 USE iso_c_binding, ONLY: c_int, c_double
194 INTEGER(C_INT), VALUE :: step
195 REAL(C_DOUBLE), VALUE :: t
196
197 END FUNCTION libvori_step
198
199 INTEGER(C_INT) FUNCTION libvori_sanitycheck(step, t) bind(C, NAME='libvori_sanitycheck')
200 USE iso_c_binding, ONLY: c_int, c_double
201 INTEGER(C_INT), VALUE :: step
202 REAL(C_DOUBLE), VALUE :: t
203
204 END FUNCTION libvori_sanitycheck
205
206 INTEGER(C_INT) FUNCTION libvori_setgrid(rx, ry, rz, ax, ay, az, bx, by, bz, cx, cy, cz, tax, tay, taz, tbx, tby, tbz, &
207 tcx, tcy, tcz) bind(C, NAME='libvori_setGrid')
208 USE iso_c_binding, ONLY: c_int, c_double
209 INTEGER(C_INT), VALUE :: rx, ry, rz
210 REAL(C_DOUBLE), VALUE :: ax, ay, az, bx, by, bz, cx, cy, cz, tax, &
211 tay, taz, tbx, tby, tbz, tcx, tcy, tcz
212
213 END FUNCTION libvori_setgrid
214
215 INTEGER(C_INT) FUNCTION libvori_pushatoms(n, pord, pchg, posx, posy, posz) bind(C, NAME='libvori_pushAtoms')
216 USE iso_c_binding, ONLY: c_int, c_double
217 INTEGER(C_INT), VALUE :: n
218 INTEGER(C_INT) :: pord(*)
219 REAL(C_DOUBLE) :: pchg(*), posx(*), posy(*), posz(*)
220
221 END FUNCTION libvori_pushatoms
222
223 INTEGER(C_INT) FUNCTION libvori_push_rho_zrow(ix, iy, length, buf) bind(C, NAME='libvori_push_rho_zrow')
224 USE iso_c_binding, ONLY: c_int, c_double
225 INTEGER(C_INT), VALUE :: ix, iy, length
226 REAL(C_DOUBLE) :: buf(*)
227
228 END FUNCTION libvori_push_rho_zrow
229
230 INTEGER(C_INT) FUNCTION libvori_setbqboverwrite(i) bind(C, NAME='libvori_setBQBOverwrite')
231 USE iso_c_binding, ONLY: c_int
232 INTEGER(C_INT), VALUE :: i
233
234 END FUNCTION libvori_setbqboverwrite
235
236 INTEGER(C_INT) FUNCTION libvori_setvorioverwrite(i) bind(C, NAME='libvori_setVoriOverwrite')
237 USE iso_c_binding, ONLY: c_int
238 INTEGER(C_INT), VALUE :: i
239
240 END FUNCTION libvori_setvorioverwrite
241
242 INTEGER(C_INT) FUNCTION libvori_get_radius(length, buf) bind(C, NAME='libvori_get_radius')
243 USE iso_c_binding, ONLY: c_int, c_double
244 INTEGER(C_INT), VALUE :: length
245 REAL(C_DOUBLE) :: buf(*)
246
247 END FUNCTION libvori_get_radius
248
249 INTEGER(C_INT) FUNCTION libvori_get_volume(length, buf) bind(C, NAME='libvori_get_volume')
250 USE iso_c_binding, ONLY: c_int, c_double
251 INTEGER(C_INT), VALUE :: length
252 REAL(C_DOUBLE) :: buf(*)
253
254 END FUNCTION libvori_get_volume
255
256 INTEGER(C_INT) FUNCTION libvori_get_charge(length, buf) bind(C, NAME='libvori_get_charge')
257 USE iso_c_binding, ONLY: c_int, c_double
258 INTEGER(C_INT), VALUE :: length
259 REAL(C_DOUBLE) :: buf(*)
260
261 END FUNCTION libvori_get_charge
262
263 INTEGER(C_INT) FUNCTION libvori_get_dipole(component, length, buf) bind(C, NAME='libvori_get_dipole')
264 USE iso_c_binding, ONLY: c_int, c_double
265 INTEGER(C_INT), VALUE :: component, length
266 REAL(C_DOUBLE) :: buf(*)
267
268 END FUNCTION libvori_get_dipole
269
270 INTEGER(C_INT) FUNCTION libvori_get_quadrupole(component, length, buf) bind(C, NAME='libvori_get_quadrupole')
271 USE iso_c_binding, ONLY: c_int, c_double
272 INTEGER(C_INT), VALUE :: component, length
273 REAL(C_DOUBLE) :: buf(*)
274
275 END FUNCTION libvori_get_quadrupole
276
277 INTEGER(C_INT) FUNCTION libvori_get_wrapped_pos(component, length, buf) bind(C, NAME='libvori_get_wrapped_pos')
278 USE iso_c_binding, ONLY: c_int, c_double
279 INTEGER(C_INT), VALUE :: component, length
280 REAL(C_DOUBLE) :: buf(*)
281
282 END FUNCTION libvori_get_wrapped_pos
283
284 INTEGER(C_INT) FUNCTION libvori_get_charge_center(component, length, buf) bind(C, NAME='libvori_get_charge_center')
285 USE iso_c_binding, ONLY: c_int, c_double
286 INTEGER(C_INT), VALUE :: component, length
287 REAL(C_DOUBLE) :: buf(*)
288
289 END FUNCTION libvori_get_charge_center
290
291 INTEGER(C_INT) FUNCTION libvori_finalize() bind(C, NAME='libvori_finalize')
292 USE iso_c_binding, ONLY: c_int
293 END FUNCTION libvori_finalize
294
295 END INTERFACE
296
297#endif
298
299! **************************************************************************************************
300
301CONTAINS
302
303! **************************************************************************************************
304!> \brief Does a Voronoi integration of density or stores the density to compressed BQB format
305!> \param do_voro whether a Voronoi integration shall be performed
306!> \param do_bqb whether the density shall be written to compressed BQB format
307!> \param input_voro the input section for Voronoi integration
308!> \param input_bqb the input section for the BQB compression
309!> \param unit_voro the output unit number for the Voronoi integration results
310!> \param qs_env the qs_env where to calculate the charges
311!> \param rspace_pw the grid with the real-space electron density to integrate/compress
312!> \author Martin Brehm
313! **************************************************************************************************
314 SUBROUTINE entry_voronoi_or_bqb(do_voro, do_bqb, input_voro, input_bqb, unit_voro, qs_env, rspace_pw)
315 INTEGER :: do_voro, do_bqb
316 TYPE(section_vals_type), POINTER :: input_voro, input_bqb
317 INTEGER, INTENT(IN) :: unit_voro
318 TYPE(qs_environment_type), POINTER :: qs_env
319 TYPE(pw_r3d_rs_type) :: rspace_pw
320
321#if defined(__LIBVORI)
322
323 CHARACTER(len=*), PARAMETER :: routinen = 'entry_voronoi_or_bqb'
324 INTEGER :: handle, iounit, &
325 ret, i, tag, &
326 nkind, natom, ikind, iat, ord, source, dest, &
327 ip, i1, i2, reffac, radius_type, bqb_optimize, &
328 bqb_history, nspins, jitter_seed
329 LOGICAL :: outemp, bqb_skip_first, voro_skip_first, &
330 bqb_store_step, bqb_check, voro_sanity, &
331 bqb_overwrite, vori_overwrite, molprop, &
332 gapw, jitter
333 REAL(kind=dp) :: zeff, qa, fn0, fn1, jitter_amplitude
334 TYPE(qs_rho_type), POINTER :: rho
335 TYPE(cp_logger_type), POINTER :: logger
336 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: buf
337 INTEGER, ALLOCATABLE, DIMENSION(:) :: particles_z
338 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: particles_r
339 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: particles_c
340 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: particles_radius
341 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
342 TYPE(atomic_kind_type), POINTER :: atomic_kind
343 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
344 TYPE(mp_para_env_type), POINTER :: para_env
345 TYPE(particle_list_type), POINTER :: particles
346 REAL(kind=dp) :: r
347 TYPE(qs_subsys_type), POINTER :: subsys
348 INTEGER, DIMENSION(:), POINTER :: atom_list
349 TYPE(dft_control_type), POINTER :: dft_control
350 TYPE(cell_type), POINTER :: cell
351 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: voro_radii
352 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: voro_charge
353 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: voro_volume
354 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: voro_dipole
355 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: voro_quadrupole
356 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: voro_buffer
357 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: voro_wrapped_pos
358 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: voro_charge_center
359 REAL(kind=dp), DIMENSION(:), POINTER :: user_radii
360 CHARACTER(len=default_path_length) :: bqb_file_name, mp_file_name
361 CHARACTER(len=128) :: bqb_parm_string
362 TYPE(rho0_mpole_type), POINTER :: rho0_mpole
363#if defined(__HAS_IEEE_EXCEPTIONS)
364 LOGICAL, DIMENSION(5) :: halt
365#endif
366
367 CALL timeset(routinen, handle)
368 NULLIFY (logger)
369 logger => cp_get_default_logger()
370 iounit = cp_logger_get_default_io_unit(logger)
371
372 CALL get_qs_env(qs_env=qs_env, rho=rho, qs_kind_set=qs_kind_set, &
373 atomic_kind_set=atomic_kind_set, para_env=para_env, &
374 nkind=nkind, natom=natom, subsys=subsys, dft_control=dft_control, &
375 cell=cell)
376
377 tag = 1
378
379 IF (do_voro /= 0) THEN
380 CALL section_vals_val_get(input_voro, "REFINEMENT_FACTOR", i_val=reffac)
381 CALL section_vals_val_get(input_voro, "OUTPUT_EMP", l_val=outemp)
382 CALL section_vals_val_get(input_voro, "JITTER", l_val=jitter)
383 CALL section_vals_val_get(input_voro, "JITTER_AMPLITUDE", r_val=jitter_amplitude)
384 CALL section_vals_val_get(input_voro, "JITTER_SEED", i_val=jitter_seed)
385 CALL section_vals_val_get(input_voro, "VORONOI_RADII", i_val=radius_type)
386 CALL section_vals_val_get(input_voro, "SKIP_FIRST", l_val=voro_skip_first)
387 CALL section_vals_val_get(input_voro, "SANITY_CHECK", l_val=voro_sanity)
388 CALL section_vals_val_get(input_voro, "OVERWRITE", l_val=vori_overwrite)
389 IF (radius_type == voro_radii_user) THEN
390 CALL section_vals_val_get(input_voro, "USER_RADII", r_vals=user_radii)
391 END IF
392 IF (qs_env%single_point_run) THEN
393 voro_skip_first = .false.
394 END IF
395 CALL cite_reference(rycroft2009)
396 CALL cite_reference(thomas2015)
397 CALL cite_reference(brehm2018)
398 CALL cite_reference(brehm2020)
399 CALL cite_reference(brehm2021)
400 !
401 CALL section_vals_val_get(input_voro, "MOLECULAR_PROPERTIES", l_val=molprop)
402 CALL section_vals_val_get(input_voro, "MOLPROP_FILE_NAME", c_val=mp_file_name)
403 END IF
404
405 IF (do_bqb /= 0) THEN
406 CALL section_vals_val_get(input_bqb, "HISTORY", i_val=bqb_history)
407 CALL section_vals_val_get(input_bqb, "OPTIMIZE", i_val=bqb_optimize)
408 CALL section_vals_val_get(input_bqb, "FILENAME", c_val=bqb_file_name)
409 CALL section_vals_val_get(input_bqb, "SKIP_FIRST", l_val=bqb_skip_first)
410 CALL section_vals_val_get(input_bqb, "STORE_STEP_NUMBER", l_val=bqb_store_step)
411 CALL section_vals_val_get(input_bqb, "CHECK", l_val=bqb_check)
412 CALL section_vals_val_get(input_bqb, "OVERWRITE", l_val=bqb_overwrite)
413 CALL section_vals_val_get(input_bqb, "PARAMETER_KEY", c_val=bqb_parm_string)
414 IF (qs_env%single_point_run) THEN
415 bqb_skip_first = .false.
416 bqb_history = 1
417 END IF
418 IF (bqb_history < 1) THEN
419 bqb_history = 1
420 END IF
421 CALL cite_reference(brehm2018)
422 END IF
423
424 CALL qs_subsys_get(subsys, particles=particles)
425
426 ! Temporarily disable floating point traps because libvori raise IEEE754 exceptions.
427#if defined(__HAS_IEEE_EXCEPTIONS)
428 CALL ieee_get_halting_mode(ieee_all, halt)
429 CALL ieee_set_halting_mode(ieee_all, .false.)
430#endif
431
432 associate(ionode => para_env%is_source(), my_rank => para_env%mepos, &
433 num_pe => para_env%num_pe, &
434 sim_step => qs_env%sim_step, sim_time => qs_env%sim_time, &
435 l1 => rspace_pw%pw_grid%bounds(1, 1), l2 => rspace_pw%pw_grid%bounds(1, 2), &
436 l3 => rspace_pw%pw_grid%bounds(1, 3), u1 => rspace_pw%pw_grid%bounds(2, 1), &
437 u2 => rspace_pw%pw_grid%bounds(2, 2), u3 => rspace_pw%pw_grid%bounds(2, 3))
438 IF (ionode) THEN
439
440 IF (iounit > 0) THEN
441 WRITE (iounit, *) ""
442 END IF
443
444 IF (do_voro /= 0) THEN
445 ret = libvori_setprefix_voronoi()
446 ret = libvori_setrefinementfactor(reffac)
447 ret = libvori_setjitter(merge(1, 0, jitter))
448 ret = libvori_setjitteramplitude(jitter_amplitude*angstrom)
449 ret = libvori_setjitterseed(jitter_seed)
450 ret = libvori_setvoronoiskipfirst(merge(1, 0, voro_skip_first))
451 ret = libvori_setvorioverwrite(merge(1, 0, vori_overwrite))
452 ret = libvori_setempoutput(merge(1, 0, outemp))
453 ELSE
454 ret = libvori_setprefix_bqb()
455 END IF
456
457 IF (do_bqb /= 0) THEN
458 ret = libvori_setbqbfilename(default_path_length, bqb_file_name)
459 ret = libvori_setbqbparmstring(128, bqb_parm_string)
460 SELECT CASE (bqb_optimize)
461 CASE (bqb_opt_off)
462 bqb_optimize = 0
463 CASE (bqb_opt_quick)
464 bqb_optimize = 1
465 CASE (bqb_opt_normal)
466 bqb_optimize = 2
467 CASE (bqb_opt_patient)
468 bqb_optimize = 3
469 CASE (bqb_opt_exhaustive)
470 bqb_optimize = 4
471 END SELECT
472 ret = libvori_setbqboptimization(bqb_optimize)
473 ret = libvori_setbqbhistory(bqb_history)
474 ret = libvori_setbqbskipfirst(merge(1, 0, bqb_skip_first))
475 ret = libvori_setbqbcheck(merge(1, 0, bqb_check))
476 ret = libvori_setbqboverwrite(merge(1, 0, bqb_overwrite))
477 ret = libvori_setbqbstorestep(merge(1, 0, bqb_store_step))
478 END IF
479
480 ret = libvori_setgrid( &
481 u1 - l1 + 1, &
482 u2 - l2 + 1, &
483 u3 - l3 + 1, &
484 rspace_pw%pw_grid%dh(1, 1)*(u1 - l1 + 1), &
485 rspace_pw%pw_grid%dh(2, 1)*(u1 - l1 + 1), &
486 rspace_pw%pw_grid%dh(3, 1)*(u1 - l1 + 1), &
487 rspace_pw%pw_grid%dh(1, 2)*(u2 - l2 + 1), &
488 rspace_pw%pw_grid%dh(2, 2)*(u2 - l2 + 1), &
489 rspace_pw%pw_grid%dh(3, 2)*(u2 - l2 + 1), &
490 rspace_pw%pw_grid%dh(1, 3)*(u3 - l3 + 1), &
491 rspace_pw%pw_grid%dh(2, 3)*(u3 - l3 + 1), &
492 rspace_pw%pw_grid%dh(3, 3)*(u3 - l3 + 1), &
493 cell%hmat(1, 1), &
494 cell%hmat(2, 1), &
495 cell%hmat(3, 1), &
496 cell%hmat(1, 2), &
497 cell%hmat(2, 2), &
498 cell%hmat(3, 2), &
499 cell%hmat(1, 3), &
500 cell%hmat(2, 3), &
501 cell%hmat(3, 3) &
502 )
503
504 IF (ret /= 0) THEN
505 cpabort("The library returned an error. Aborting.")
506 END IF
507
508 ALLOCATE (particles_z(natom))
509 ALLOCATE (particles_c(natom))
510 ALLOCATE (particles_r(3, natom))
511 ALLOCATE (particles_radius(natom))
512
513 DO ikind = 1, nkind
514 CALL get_qs_kind(qs_kind_set(ikind), zeff=zeff, vdw_radius=r)
515 r = r*angstrom
516 atomic_kind => atomic_kind_set(ikind)
517 CALL get_atomic_kind(atomic_kind, atom_list=atom_list, z=ord)
518 DO iat = 1, SIZE(atom_list)
519 i = atom_list(iat)
520 particles_c(i) = zeff
521 particles_z(i) = ord
522 particles_r(:, i) = particles%els(i)%r(:)
523 particles_radius(i) = r
524 END DO
525 END DO
526
527 ret = libvori_pushatoms(natom, particles_z, particles_c, particles_r(1, :), particles_r(2, :), particles_r(3, :))
528
529 IF (ret /= 0) THEN
530 cpabort("The library returned an error. Aborting.")
531 END IF
532
533 END IF
534
535 IF (iounit > 0) THEN
536 IF (do_voro /= 0) THEN
537 WRITE (iounit, *) "VORONOI| Collecting electron density from MPI ranks and sending to library..."
538 ELSE
539 WRITE (iounit, *) "BQB| Collecting electron density from MPI ranks and sending to library..."
540 END IF
541 END IF
542
543 ALLOCATE (buf(l3:u3))
544
545 dest = 0
546
547 DO i1 = l1, u1
548 DO i2 = l2, u2
549
550 ! cycling through the CPUs, check if the current ray (I1,I2) is local to that CPU
551 IF (rspace_pw%pw_grid%para%mode .NE. pw_mode_local) THEN
552 DO ip = 0, num_pe - 1
553 IF (rspace_pw%pw_grid%para%bo(1, 1, ip, 1) <= i1 - l1 + 1 &
554 .AND. rspace_pw%pw_grid%para%bo(2, 1, ip, 1) >= i1 - l1 + 1 .AND. &
555 rspace_pw%pw_grid%para%bo(1, 2, ip, 1) <= i2 - l2 + 1 &
556 .AND. rspace_pw%pw_grid%para%bo(2, 2, ip, 1) >= i2 - l2 + 1) THEN
557 source = ip
558 END IF
559 END DO
560 ELSE
561 source = dest
562 END IF
563
564 IF (source == dest) THEN
565 IF (my_rank == source) THEN
566 buf(:) = rspace_pw%array(i1, i2, :)
567 END IF
568 ELSE
569 IF (my_rank == source) THEN
570 buf(:) = rspace_pw%array(i1, i2, :)
571 CALL para_env%send(buf, dest, tag)
572 END IF
573 IF (my_rank == dest) THEN
574 CALL para_env%recv(buf, source, tag)
575 END IF
576 END IF
577
578 IF (my_rank == dest) THEN
579 ret = libvori_push_rho_zrow(i1 - l1, i2 - l2, u3 - l3 + 1, buf)
580 IF (ret /= 0) THEN
581 cpabort("The library returned an error. Aborting.")
582 END IF
583 END IF
584
585 ! this double loop generates so many messages that it can overload
586 ! the message passing system, e.g. on XT3
587 ! we therefore put a barrier here that limits the amount of message
588 ! that flies around at any given time.
589 ! if ever this routine becomes a bottleneck, we should go for a
590 ! more complicated rewrite
591 CALL para_env%sync()
592
593 END DO
594 END DO
595
596 DEALLOCATE (buf)
597
598 IF (ionode) THEN
599
600 gapw = .false.
601 IF (dft_control%qs_control%method_id == do_method_gapw) gapw = .true.
602
603 IF (do_voro /= 0) THEN
604
605 IF (radius_type == voro_radii_unity) THEN
606 ret = libvori_setradii_unity()
607 ELSE IF (radius_type == voro_radii_cov) THEN
608 ! Use the covalent radii from LIBVORI
609 ret = libvori_setradii_covalent()
610 ELSE IF (radius_type == voro_radii_vdw) THEN
611 ! Use the van der Waals radii from CP2K
612 ret = libvori_setradii_user(100.0_dp, particles_radius)
613 ELSE IF (radius_type == voro_radii_user) THEN
614 ! Use the user defined atomic radii
615 IF (natom /= SIZE(user_radii)) THEN
616 CALL cp_abort(__location__, &
617 "Length of keyword VORONOI\USER_RADII does not "// &
618 "match number of atoms in the input coordinate file.")
619 END IF
620 ret = libvori_setradii_user(100.0_dp, user_radii)
621 ELSE
622 cpabort("No valid radius type was specified for VORONOI")
623 END IF
624
625 IF (voro_sanity) THEN
626
627 ret = libvori_sanitycheck(sim_step, sim_time)
628
629 IF (ret /= 0) THEN
630 cpabort("The library returned an error. Aborting.")
631 END IF
632
633 END IF
634
635 ret = libvori_step(sim_step, sim_time)
636
637 step_count = step_count + 1
638
639 IF (ret /= 0) THEN
640 cpabort("The library returned an error. Aborting.")
641 END IF
642
643 IF ((step_count > 1) .OR. (.NOT. voro_skip_first)) THEN
644
645 ALLOCATE (voro_radii(natom))
646 ALLOCATE (voro_charge(natom))
647 ALLOCATE (voro_volume(natom))
648 ALLOCATE (voro_dipole(natom, 3))
649 ALLOCATE (voro_quadrupole(natom, 9))
650 ALLOCATE (voro_buffer(natom))
651 ALLOCATE (voro_wrapped_pos(natom, 3))
652 ALLOCATE (voro_charge_center(natom, 3))
653
654 ret = libvori_get_radius(natom, voro_radii)
655
656 ret = libvori_get_charge(natom, voro_charge)
657
658 ret = libvori_get_volume(natom, voro_volume)
659
660 DO i1 = 1, 3
661 ret = libvori_get_dipole(i1, natom, voro_buffer)
662 voro_dipole(:, i1) = voro_buffer(:)
663 END DO
664
665 DO i1 = 1, 9
666 ret = libvori_get_quadrupole(i1, natom, voro_buffer)
667 voro_quadrupole(:, i1) = voro_buffer(:)
668 END DO
669
670 DO i1 = 1, 3
671 ret = libvori_get_wrapped_pos(i1, natom, voro_buffer)
672 voro_wrapped_pos(:, i1) = voro_buffer(:)
673 END DO
674
675 DO i1 = 1, 3
676 ret = libvori_get_charge_center(i1, natom, voro_buffer)
677 voro_charge_center(:, i1) = voro_buffer(:)
678 END DO
679
680 IF (gapw) THEN
681 CALL get_qs_env(qs_env=qs_env, rho0_mpole=rho0_mpole)
682 nspins = dft_control%nspins
683 DO i1 = 1, natom
684 voro_charge(i1) = voro_charge(i1) - sum(rho0_mpole%mp_rho(i1)%Q0(1:nspins))
685 fn0 = rho0_mpole%norm_g0l_h(1)/bohr*100._dp
686 voro_dipole(i1, 1:3) = voro_dipole(i1, 1:3) + rho0_mpole%mp_rho(i1)%Qlm_car(2:4)/fn0
687 qa = voro_charge(i1) - particles_c(i1)
688 voro_charge_center(i1, 1:3) = voro_dipole(i1, 1:3)/qa
689 fn1 = rho0_mpole%norm_g0l_h(2)/bohr/bohr*10000._dp
690 voro_quadrupole(i1, 1) = voro_quadrupole(i1, 1) + rho0_mpole%mp_rho(i1)%Qlm_car(5)/fn1
691 voro_quadrupole(i1, 2) = voro_quadrupole(i1, 2) + rho0_mpole%mp_rho(i1)%Qlm_car(6)/fn1
692 voro_quadrupole(i1, 3) = voro_quadrupole(i1, 3) + rho0_mpole%mp_rho(i1)%Qlm_car(7)/fn1
693 voro_quadrupole(i1, 4) = voro_quadrupole(i1, 4) + rho0_mpole%mp_rho(i1)%Qlm_car(6)/fn1
694 voro_quadrupole(i1, 5) = voro_quadrupole(i1, 5) + rho0_mpole%mp_rho(i1)%Qlm_car(8)/fn1
695 voro_quadrupole(i1, 6) = voro_quadrupole(i1, 6) + rho0_mpole%mp_rho(i1)%Qlm_car(9)/fn1
696 voro_quadrupole(i1, 7) = voro_quadrupole(i1, 7) + rho0_mpole%mp_rho(i1)%Qlm_car(7)/fn1
697 voro_quadrupole(i1, 8) = voro_quadrupole(i1, 8) + rho0_mpole%mp_rho(i1)%Qlm_car(9)/fn1
698 voro_quadrupole(i1, 9) = voro_quadrupole(i1, 9) + rho0_mpole%mp_rho(i1)%Qlm_car(10)/fn1
699 END DO
700 END IF
701
702 IF (unit_voro > 0) THEN
703 WRITE (unit_voro, fmt="(T2,I0)") natom
704 WRITE (unit_voro, fmt="(A,I8,A,F12.4,A)") "# Step ", sim_step, ", Time ", &
705 sim_time*femtoseconds, " fs"
706 WRITE (unit_voro, fmt="(A,9F20.10)") "# Cell ", &
707 cell%hmat(1, 1)*angstrom, cell%hmat(2, 1)*angstrom, cell%hmat(3, 1)*angstrom, &
708 cell%hmat(1, 2)*angstrom, cell%hmat(2, 2)*angstrom, cell%hmat(3, 2)*angstrom, &
709 cell%hmat(1, 3)*angstrom, cell%hmat(2, 3)*angstrom, cell%hmat(3, 3)*angstrom
710 WRITE (unit_voro, fmt="(A,22A20)") "# Atom Z", &
711 "Radius", "Position(X)", "Position(Y)", "Position(Z)", &
712 "Voronoi_Volume", "Z(eff)", "Charge", "Dipole(X)", "Dipole(Y)", "Dipole(Z)", &
713 "ChargeCenter(X)", "ChargeCenter(Y)", "ChargeCenter(Z)", &
714 "Quadrupole(XX)", "Quadrupole(XY)", "Quadrupole(XZ)", &
715 "Quadrupole(YX)", "Quadrupole(YY)", "Quadrupole(YZ)", &
716 "Quadrupole(ZX)", "Quadrupole(ZY)", "Quadrupole(ZZ)"
717 DO i1 = 1, natom
718 WRITE (unit_voro, fmt="(2I6,22F20.10)") &
719 i1, &
720 particles_z(i1), &
721 voro_radii(i1)/100.0_dp, &
722 particles_r(1:3, i1)*angstrom, &
723 voro_volume(i1)/1000000.0_dp, &
724 particles_c(i1), &
725 voro_charge(i1), &
726 voro_dipole(i1, 1:3), &
727 voro_charge_center(i1, 1:3)/100.0_dp, &
728 voro_quadrupole(i1, 1:9)
729 END DO
730 END IF
731
732 IF (molprop) THEN
733 CALL molecular_properties(subsys, cell, sim_step, sim_time, iounit, &
734 particles_r, particles_c, &
735 voro_charge, voro_charge_center, mp_file_name)
736 END IF
737
738 DEALLOCATE (voro_radii)
739 DEALLOCATE (voro_charge)
740 DEALLOCATE (voro_volume)
741 DEALLOCATE (voro_dipole)
742 DEALLOCATE (voro_quadrupole)
743 DEALLOCATE (voro_buffer)
744 DEALLOCATE (voro_wrapped_pos)
745 DEALLOCATE (voro_charge_center)
746
747 END IF ! not skip_first
748
749 IF (iounit > 0) THEN
750 WRITE (iounit, *) "VORONOI| Voronoi integration finished."
751 END IF
752
753 END IF ! do_voro
754
755 IF (do_bqb /= 0) THEN
756
757 ret = libvori_processbqbframe(sim_step, sim_time*femtoseconds)
758
759 IF (ret /= 0) THEN
760 cpabort("The library returned an error. Aborting.")
761 END IF
762
763 IF (do_voro /= 0) THEN
764 IF (iounit > 0) THEN
765 WRITE (iounit, *) "VORONOI| BQB compression finished."
766 END IF
767 ELSE
768 IF (iounit > 0) THEN
769 WRITE (iounit, *) "BQB| BQB compression finished."
770 END IF
771 END IF
772
773 END IF ! do_bqb
774
775 END IF
776
777 IF (ionode) THEN
778 DEALLOCATE (particles_z)
779 DEALLOCATE (particles_c)
780 DEALLOCATE (particles_r)
781 DEALLOCATE (particles_radius)
782 END IF
783 END associate
784
785#if defined(__HAS_IEEE_EXCEPTIONS)
786 CALL ieee_set_halting_mode(ieee_all, halt)
787#endif
788
789 CALL timestop(handle)
790
791#else
792
793 mark_used(do_voro)
794 mark_used(do_bqb)
795 mark_used(input_voro)
796 mark_used(input_bqb)
797 mark_used(unit_voro)
798 mark_used(qs_env)
799 mark_used(rspace_pw)
800
801 CALL cp_warn(__location__, &
802 "Voronoi integration and BQB output require CP2k to be compiled"// &
803 " with the -D__LIBVORI preprocessor option.")
804
805#endif
806
807 END SUBROUTINE entry_voronoi_or_bqb
808
809! **************************************************************************************************
810!> \brief Call libvori's finalize if support is compiled in
811! **************************************************************************************************
812 SUBROUTINE finalize_libvori()
813#if defined(__LIBVORI)
814 INTEGER(KIND=C_INT) :: ret
815 ret = libvori_finalize()
816#endif
817 END SUBROUTINE
818
819! **************************************************************************************************
820!> \brief ...
821!> \param subsys ...
822!> \param cell ...
823!> \param sim_step ...
824!> \param sim_time ...
825!> \param iounit ...
826!> \param particles_r ...
827!> \param particles_c ...
828!> \param voro_charge ...
829!> \param voro_charge_center ...
830!> \param mp_file_name ...
831! **************************************************************************************************
832 SUBROUTINE molecular_properties(subsys, cell, sim_step, sim_time, iounit, &
833 particles_r, particles_c, voro_charge, &
834 voro_charge_center, mp_file_name)
835 TYPE(qs_subsys_type), POINTER :: subsys
836 TYPE(cell_type), POINTER :: cell
837 INTEGER, INTENT(IN) :: sim_step
838 REAL(kind=dp), INTENT(IN) :: sim_time
839 INTEGER, INTENT(IN) :: iounit
840 REAL(kind=dp), DIMENSION(:, :) :: particles_r
841 REAL(kind=dp), DIMENSION(:) :: particles_c, voro_charge
842 REAL(kind=dp), DIMENSION(:, :) :: voro_charge_center
843 CHARACTER(len=default_path_length) :: mp_file_name
844
845 CHARACTER(len=3) :: fstatus
846 CHARACTER(len=default_path_length) :: fname
847 INTEGER :: ia, imol, mk, mpunit, na, na1, na2, &
848 nmolecule
849 REAL(kind=dp) :: cm, ddip
850 REAL(kind=dp), DIMENSION(3) :: dipm, posa, posc, ref
851 TYPE(molecule_kind_type), POINTER :: molecule_kind
852 TYPE(molecule_type), DIMENSION(:), POINTER :: molecule_set
853
854 IF (iounit > 0) THEN
855 WRITE (iounit, *) "VORONOI| Start Calculation of Molecular Properties from Voronoi Integration"
856 END IF
857 CALL qs_subsys_get(subsys, molecule_set=molecule_set)
858
859 IF (index(mp_file_name, "__STD_OUT__") /= 0) THEN
860 mpunit = iounit
861 ELSE
862 fname = adjustl(mp_file_name)
863 IF (fname(1:2) /= "./") THEN
864 fname = trim(fname)//".molprop"
865 END IF
866 IF (file_exists(fname)) THEN
867 fstatus = "old"
868 ELSE
869 fstatus = "new"
870 END IF
871 CALL open_file(file_name=fname, file_status=fstatus, file_action="write", &
872 file_position="append", unit_number=mpunit)
873 END IF
874 nmolecule = SIZE(molecule_set)
875 WRITE (mpunit, fmt="(T2,I0)") nmolecule
876 WRITE (mpunit, fmt="(A,I8,A,F12.4,A)") " # Step ", sim_step, ", Time ", &
877 sim_time*femtoseconds, " fs"
878 WRITE (mpunit, fmt="(A,T25,A)") " # Mol Type Charge", &
879 " Dipole[Debye] Total Dipole[Debye]"
880 DO imol = 1, nmolecule
881 molecule_kind => molecule_set(imol)%molecule_kind
882 mk = molecule_kind%kind_number
883 na1 = molecule_set(imol)%first_atom
884 na2 = molecule_set(imol)%last_atom
885 na = na2 - na1 + 1
886 ref(1:3) = 0.0_dp
887 DO ia = na1, na2
888 ref(1:3) = ref(1:3) + pbc(particles_r(1:3, ia), cell)
889 END DO
890 ref(1:3) = ref(1:3)/real(na, kind=dp)
891 dipm = 0.0_dp
892 DO ia = na1, na2
893 posa(1:3) = particles_r(1:3, ia) - ref(1:3)
894 posa(1:3) = pbc(posa, cell)
895 posc(1:3) = posa(1:3) + bohr*voro_charge_center(ia, 1:3)/100.0_dp
896 posc(1:3) = pbc(posc, cell)
897 cm = -particles_c(ia) + voro_charge(ia)
898 dipm(1:3) = dipm(1:3) + posa(1:3)*particles_c(ia) + posc(1:3)*cm
899 END DO
900 dipm(1:3) = dipm(1:3)*debye
901 ddip = sqrt(sum(dipm**2))
902 cm = sum(voro_charge(na1:na2))
903 WRITE (mpunit, fmt="(I8,I6,F12.4,T25,3F12.4,8X,F12.4)") imol, mk, cm, dipm(1:3), ddip
904 END DO
905 IF (mpunit /= iounit) THEN
906 CALL close_file(mpunit)
907 END IF
908
909 END SUBROUTINE molecular_properties
910
911END MODULE voronoi_interface
912
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 brehm2021
integer, save, public brehm2020
integer, save, public thomas2015
integer, save, public brehm2018
integer, save, public rycroft2009
Handles all functions related to the CELL.
Definition cell_types.F:15
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
Utility routines to open and close files. Tracking of preconnections.
Definition cp_files.F:16
subroutine, public open_file(file_name, file_status, file_form, file_action, file_position, file_pad, unit_number, debug, skip_get_unit_number, file_access)
Opens the requested file using a free unit number.
Definition cp_files.F:308
subroutine, public close_file(unit_number, file_status, keep_preconnection)
Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected.
Definition cp_files.F:119
logical function, public file_exists(file_name)
Checks if file exists, considering also the file discovery mechanism.
Definition cp_files.F:494
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public bqb_opt_quick
integer, parameter, public voro_radii_user
integer, parameter, public bqb_opt_normal
integer, parameter, public bqb_opt_off
integer, parameter, public voro_radii_vdw
integer, parameter, public bqb_opt_exhaustive
integer, parameter, public do_method_gapw
integer, parameter, public voro_radii_unity
integer, parameter, public bqb_opt_patient
integer, parameter, public voro_radii_cov
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_path_length
Definition kinds.F:58
Definition of mathematical constants and functions.
real(kind=dp), parameter, public fourpi
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.
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:, :), allocatable, public indco
represent a simple array based list of the given type
Define the data structure for the particle information.
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public femtoseconds
Definition physcon.F:153
real(kind=dp), parameter, public angstrom
Definition physcon.F:144
real(kind=dp), parameter, public bohr
Definition physcon.F:147
real(kind=dp), parameter, public debye
Definition physcon.F:201
integer, parameter, public pw_mode_local
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, ecoul_1c, rho0_s_rs, rho0_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, rhs)
Get the QUICKSTEP environment.
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_r3d_rs_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, init_u_ramping_each_scf, reltmat, ghost, floating, name, element_symbol, pao_basis_size, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
superstucture that hold various representations of the density and keeps track of which ones are vali...
subroutine, public qs_rho_get(rho_struct, rho_ao, rho_ao_im, rho_ao_kp, rho_ao_im_kp, rho_r, drho_r, rho_g, drho_g, tau_r, tau_g, rho_r_valid, drho_r_valid, rho_g_valid, drho_g_valid, tau_r_valid, tau_g_valid, tot_rho_r, tot_rho_g, rho_r_sccs, soft_valid, complex_rho_ao)
returns info about the density described by this object. If some representation is not available an e...
types that represent a quickstep subsys
subroutine, public qs_subsys_get(subsys, 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, cell_ref, use_ref_cell, energy, force, qs_kind_set, cp_subsys, nelectron_total, nelectron_spin)
...
Interface for Voronoi Integration and output of BQB files.
subroutine, public finalize_libvori()
Call libvori's finalize if support is compiled in.
subroutine, public entry_voronoi_or_bqb(do_voro, do_bqb, input_voro, input_bqb, unit_voro, qs_env, rspace_pw)
Does a Voronoi integration of density or stores the density to compressed BQB format.
Provides all information about an atomic kind.
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...
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.
keeps the density in various representations, keeping track of which ones are valid.