75#include "./base/base_uses.f90"
80 LOGICAL,
PARAMETER,
PRIVATE :: debug_this_module = .false.
81 REAL(KIND=
dp),
PARAMETER,
PRIVATE :: dx = 0.01_dp
82 REAL(KIND=
dp),
PARAMETER,
PRIVATE :: maxerr = 10.0_dp
83 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qmmm_gpw_forces'
100 SUBROUTINE qmmm_forces(qs_env, qmmm_env, mm_particles, calc_force, mm_cell)
104 LOGICAL,
INTENT(in),
OPTIONAL :: calc_force
107 CHARACTER(len=*),
PARAMETER :: routinen =
'qmmm_forces'
109 INTEGER :: handle, iatom, image_indmm, imm, indmm, &
111 LOGICAL :: gapw, need_f, periodic
112 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: forces, forces_added_charges, &
117 TYPE(
pw_c1d_gs_type),
POINTER :: rho0_s_gs, rho_core, rhoz_cneo_s_gs
129 CALL timeset(routinen, handle)
131 periodic = qmmm_env%periodic
132 IF (
PRESENT(calc_force)) need_f = calc_force
133 NULLIFY (dft_control, ks_qmmm_env_loc, rho, pw_env, energy, forces, &
134 forces_added_charges, input_section, rho0_s_gs, rhoz_cneo_s_gs, rho_r)
141 input=input_section, &
142 rho0_s_gs=rho0_s_gs, &
143 rhoz_cneo_s_gs=rhoz_cneo_s_gs, &
144 dft_control=dft_control)
149 ks_qmmm_env_loc => qs_env%ks_qmmm_env
153 extension=
".qmmmLog")
154 gapw = dft_control%qs_control%gapw
157 ALLOCATE (forces(3, qmmm_env%num_mm_atoms))
158 ALLOCATE (forces_added_charges(3, qmmm_env%added_charges%num_mm_atoms))
159 ALLOCATE (forces_added_shells(3, qmmm_env%added_shells%num_mm_atoms))
160 forces(:, :) = 0.0_dp
161 forces_added_charges(:, :) = 0.0_dp
162 forces_added_shells(:, :) = 0.0_dp
164 IF (dft_control%qs_control%semi_empirical)
THEN
166 SELECT CASE (qmmm_env%qmmm_coupl_type)
169 need_f, forces, forces_added_charges)
171 cpabort(
"Point Charge QM/MM electrostatic coupling not yet implemented for SE.")
173 cpabort(
"GAUSS or SWAVE QM/MM electrostatic coupling not yet implemented for SE.")
175 IF (iw > 0)
WRITE (iw,
'(T2,"QMMM|",1X,A)') &
176 "- No QM/MM Electrostatic coupling. Just Mechanical Coupling!"
178 cpabort(
"Unknown QM/MM coupling")
180 ELSE IF (dft_control%qs_control%dftb .OR. dft_control%qs_control%xtb)
THEN
182 SELECT CASE (qmmm_env%qmmm_coupl_type)
184 IF (iw > 0)
WRITE (iw,
'(T2,"QMMM|",1X,A)') &
185 "- No QM/MM Electrostatic coupling. Just Mechanical Coupling!"
188 need_f, forces, forces_added_charges)
191 need_f, forces, forces_added_charges)
194 need_f, forces, forces_added_charges)
196 cpabort(
"SWAVE QM/MM electrostatic coupling not implemented for tight-binding methods.")
198 cpabort(
"Unknown QM/MM coupling")
201 forces(:, :) = forces(:, :)/real(para_env%num_pe, kind=
dp)
202 forces_added_charges(:, :) = forces_added_charges(:, :)/real(para_env%num_pe, kind=
dp)
208 auxbas_pw_pool=auxbas_pool)
209 CALL auxbas_pool%create_pw(rho_tot_r)
212 IF (dft_control%qs_control%gapw_control%nopaw_as_gpw)
THEN
214 energy%qmmm_nu =
pw_integral_ab(rho_tot_r, ks_qmmm_env_loc%v_qmmm_rspace)
215 CALL auxbas_pool%create_pw(rho_tot_r2)
217 CALL pw_axpy(rho_tot_r2, rho_tot_r)
218 IF (
ASSOCIATED(rhoz_cneo_s_gs))
THEN
219 CALL auxbas_pool%create_pw(rho_tot_r3)
221 CALL pw_axpy(rho_tot_r3, rho_tot_r)
222 CALL auxbas_pool%give_back_pw(rho_tot_r3)
224 CALL auxbas_pool%give_back_pw(rho_tot_r2)
227 IF (
ASSOCIATED(rhoz_cneo_s_gs))
THEN
228 CALL auxbas_pool%create_pw(rho_tot_r3)
230 CALL pw_axpy(rho_tot_r3, rho_tot_r)
231 CALL auxbas_pool%give_back_pw(rho_tot_r3)
236 energy%qmmm_nu = 0.0_dp
243 energy%qmmm_nu =
pw_integral_ab(rho_tot_r, ks_qmmm_env_loc%v_qmmm_rspace)
247 DO ispin = 1,
SIZE(rho_r)
248 CALL pw_axpy(rho_r(ispin), rho_tot_r)
250 IF (iw > 0)
WRITE (iw,
'(T2,"QMMM|",1X,A)')
"Evaluating forces on MM atoms due to the:"
252 SELECT CASE (qmmm_env%qmmm_coupl_type)
254 cpabort(
"Coulomb QM/MM electrostatic coupling not implemented for GPW/GAPW.")
256 cpabort(
"Point Charge QM/MM electrostatic coupling not yet implemented for GPW/GAPW.")
258 IF (iw > 0)
WRITE (iw,
'(T2,"QMMM|",1X,A)') &
259 "- QM/MM Coupling computed collocating the Gaussian Potential Functions."
260 CALL qmmm_forces_with_gaussian(rho=rho_tot_r, &
262 mm_particles=mm_particles, &
263 aug_pools=qmmm_env%aug_pools, &
264 auxbas_grid=qmmm_env%gridlevel_info%auxbas_grid, &
265 coarser_grid=qmmm_env%gridlevel_info%coarser_grid, &
268 eps_mm_rspace=qmmm_env%eps_mm_rspace, &
269 cube_info=ks_qmmm_env_loc%cube_info, &
271 forces_added_charges=forces_added_charges, &
272 forces_added_shells=forces_added_shells, &
273 interp_section=interp_section, &
277 IF (iw > 0)
WRITE (iw,
'(T2,"QMMM|",1X,A)') &
278 "- No QM/MM Electrostatic coupling. Just Mechanical Coupling!"
280 cpabort(
"Unknown QM/MM coupling")
285 energy%total = energy%total + energy%qmmm_nu
290 IF (qmmm_env%num_mm_atoms /= 0)
CALL para_env%sum(forces)
291 IF (qmmm_env%added_charges%num_mm_atoms /= 0)
CALL para_env%sum(forces_added_charges)
292 IF (qmmm_env%added_shells%num_mm_atoms /= 0)
CALL para_env%sum(forces_added_shells)
294 IF (debug_this_module)
THEN
295 IF (dft_control%qs_control%semi_empirical .OR. &
296 dft_control%qs_control%dftb .OR. dft_control%qs_control%xtb)
THEN
297 WRITE (iw, *)
"NO DEBUG AVAILABLE in module"//trim(routinen)
301 DO imm = 1,
SIZE(qmmm_env%mm_atom_index)
302 WRITE (iw, *)
"ANALYTICAL FORCES:"
303 indmm = qmmm_env%mm_atom_index(imm)
304 WRITE (iw,
'(I6,3F15.9)') indmm, forces(:, imm)
307 CALL qmmm_debug_forces(rho=rho_tot_r, &
310 analytical_forces=forces, &
311 mm_particles=mm_particles, &
312 mm_atom_index=qmmm_env%mm_atom_index, &
313 num_mm_atoms=qmmm_env%num_mm_atoms, &
314 interp_section=interp_section, &
320 IF ((.NOT. dft_control%qs_control%semi_empirical) .AND. &
321 (.NOT. dft_control%qs_control%dftb) .AND. (.NOT. dft_control%qs_control%xtb))
THEN
322 CALL auxbas_pool%give_back_pw(rho_tot_r)
325 IF (.NOT. gapw)
WRITE (iw,
'(T2,"QMMM|",1X,A,T66,F15.9)') &
326 "QM/MM Nuclear Electrostatic Potential :", energy%qmmm_nu
327 WRITE (iw,
'(T2,"QMMM|",1X,A,T66,F15.9)') &
328 "QMMM Total Energy (QM + QMMM electronic + QMMM nuclear):", energy%total
329 WRITE (iw,
'(T2,"QMMM|",1X,A)')
"MM energy NOT included in the above term!"// &
330 " Check for: FORCE_EVAL ( QMMM )"
331 WRITE (iw,
'(T2,"QMMM|",1X,A)')
"that includes both QM, QMMM and MM energy terms!"
335 DO imm = 1, qmmm_env%num_mm_atoms
336 indmm = qmmm_env%mm_atom_index(imm)
339 IF (qmmm_env%image_charge)
THEN
340 DO iatom = 1, qmmm_env%num_image_mm_atoms
341 image_indmm = qmmm_env%image_charge_pot%image_mm_list(iatom)
342 IF (image_indmm == indmm)
THEN
343 forces(:, imm) = forces(:, imm) &
344 + qmmm_env%image_charge_pot%image_forcesMM(:, iatom)
351 mm_particles(indmm)%f(:) = -forces(:, imm) + mm_particles(indmm)%f(:)
354 IF (qmmm_env%move_mm_charges .OR. qmmm_env%add_mm_charges)
THEN
355 DO imm = 1, qmmm_env%added_charges%num_mm_atoms
356 indmm = qmmm_env%added_charges%mm_atom_index(imm)
359 qmmm_env%added_charges%added_particles(indmm)%f(:) = -forces_added_charges(:, imm)
362 DEALLOCATE (forces_added_charges)
363 IF (qmmm_env%added_shells%num_mm_atoms > 0)
THEN
364 DO imm = 1, qmmm_env%added_shells%num_mm_atoms
365 indmm = qmmm_env%added_shells%mm_core_index(imm)
368 qmmm_env%added_shells%added_particles(imm)%f(:) = qmmm_env%added_shells%added_particles(imm)%f(:) - &
369 forces_added_shells(:, imm)
373 DEALLOCATE (forces_added_shells)
376 CALL timestop(handle)
404 SUBROUTINE qmmm_forces_with_gaussian(rho, qmmm_env, mm_particles, &
405 aug_pools, auxbas_grid, coarser_grid, cube_info, para_env, &
406 eps_mm_rspace, pw_pools, Forces, Forces_added_charges, Forces_added_shells, &
407 interp_section, iw, mm_cell)
412 INTEGER,
INTENT(IN) :: auxbas_grid, coarser_grid
415 REAL(kind=
dp),
INTENT(IN) :: eps_mm_rspace
417 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: forces, forces_added_charges, &
420 INTEGER,
INTENT(IN) :: iw
423 CHARACTER(len=*),
PARAMETER :: routinen =
'qmmm_forces_with_gaussian'
425 INTEGER :: handle, i, igrid, j, k, kind_interp, me, &
427 INTEGER,
DIMENSION(3) :: glb, gub, lb, ub
428 INTEGER,
DIMENSION(:),
POINTER :: pos_of_x
430 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: tmp
437 CALL timeset(routinen, handle)
439 cpassert(
ASSOCIATED(mm_particles))
440 cpassert(
ASSOCIATED(qmmm_env%mm_atom_chrg))
441 cpassert(
ASSOCIATED(qmmm_env%mm_atom_index))
442 cpassert(
ASSOCIATED(forces))
444 ngrids =
SIZE(pw_pools)
450 lb = rho%pw_grid%bounds_local(1, :)
451 ub = rho%pw_grid%bounds_local(2, :)
452 grids(auxbas_grid)%array(lb(1):ub(1), &
454 lb(3):ub(3)) = rho%array
457 grids(auxbas_grid)%array(i, ub(2) + 1, ub(3) + 1) = rho%array(i, lb(2), lb(3))
461 grids(auxbas_grid)%array(i, ub(2) + 1, k) = rho%array(i, lb(2), k)
466 grids(auxbas_grid)%array(i, j, ub(3) + 1) = rho%array(i, j, lb(3))
469 pos_of_x => grids(auxbas_grid)%pw_grid%para%pos_of_x
470 group = grids(auxbas_grid)%pw_grid%para%group
471 me = grids(auxbas_grid)%pw_grid%para%group%mepos
472 glb = rho%pw_grid%bounds(1, :)
473 gub = rho%pw_grid%bounds(2, :)
474 IF ((pos_of_x(glb(1)) == me) .AND. (pos_of_x(gub(1)) == me))
THEN
477 grids(auxbas_grid)%array(ub(1) + 1, j, k) = rho%array(lb(1), j, k)
479 grids(auxbas_grid)%array(ub(1) + 1, ub(2) + 1, k) = rho%array(lb(1), lb(2), k)
482 grids(auxbas_grid)%array(ub(1) + 1, j, ub(3) + 1) = rho%array(lb(1), j, lb(3))
484 grids(auxbas_grid)%array(ub(1) + 1, ub(2) + 1, ub(3) + 1) = rho%array(lb(1), lb(2), lb(3))
485 ELSE IF (pos_of_x(glb(1)) == me)
THEN
486 ALLOCATE (tmp(rho%pw_grid%bounds_local(1, 2):rho%pw_grid%bounds_local(2, 2), &
487 rho%pw_grid%bounds_local(1, 3):rho%pw_grid%bounds_local(2, 3)))
488 tmp = rho%array(lb(1), :, :)
489 CALL group%isend(msgin=tmp, dest=pos_of_x(rho%pw_grid%bounds(2, 1)), &
490 request=request, tag=112)
492 ELSE IF (pos_of_x(gub(1)) == me)
THEN
493 ALLOCATE (tmp(rho%pw_grid%bounds_local(1, 2):rho%pw_grid%bounds_local(2, 2), &
494 rho%pw_grid%bounds_local(1, 3):rho%pw_grid%bounds_local(2, 3)))
495 CALL group%irecv(msgout=tmp, source=pos_of_x(rho%pw_grid%bounds(1, 1)), &
496 request=request, tag=112)
501 grids(auxbas_grid)%array(ub(1) + 1, j, k) = tmp(j, k)
503 grids(auxbas_grid)%array(ub(1) + 1, ub(2) + 1, k) = tmp(lb(2), k)
506 grids(auxbas_grid)%array(ub(1) + 1, j, ub(3) + 1) = tmp(j, lb(3))
508 grids(auxbas_grid)%array(ub(1) + 1, ub(2) + 1, ub(3) + 1) = tmp(lb(2), lb(3))
510 IF (
ASSOCIATED(tmp))
THEN
515 CALL para_env%sum(grids(auxbas_grid)%array)
519 SELECT CASE (kind_interp)
522 DO igrid = auxbas_grid,
SIZE(grids) - 1
525 aug_pools(igrid + 1)%pool, &
526 param_section=interp_section)
529 cpabort(
"Unknown interpolation method")
533 CALL qmmm_force_with_gaussian_low(grids, mm_particles, &
534 qmmm_env%mm_atom_chrg, qmmm_env%mm_atom_index, &
535 qmmm_env%num_mm_atoms, cube_info, para_env, eps_mm_rspace, auxbas_grid, &
536 coarser_grid, qmmm_env%pgfs, qmmm_env%potentials, forces, aug_pools, &
537 mm_cell, qmmm_env%dOmmOqm, qmmm_env%periodic, qmmm_env%per_potentials, &
538 iw, qmmm_env%par_scheme, qmmm_env%spherical_cutoff, shells)
540 IF (qmmm_env%move_mm_charges .OR. qmmm_env%add_mm_charges)
THEN
541 CALL qmmm_force_with_gaussian_low(grids, qmmm_env%added_charges%added_particles, &
542 qmmm_env%added_charges%mm_atom_chrg, &
543 qmmm_env%added_charges%mm_atom_index, qmmm_env%added_charges%num_mm_atoms, &
544 cube_info, para_env, eps_mm_rspace, auxbas_grid, coarser_grid, qmmm_env%added_charges%pgfs, &
545 qmmm_env%added_charges%potentials, forces_added_charges, aug_pools, mm_cell, &
546 qmmm_env%dOmmOqm, qmmm_env%periodic, qmmm_env%added_charges%per_potentials, iw, qmmm_env%par_scheme, &
547 qmmm_env%spherical_cutoff, shells)
550 IF (qmmm_env%added_shells%num_mm_atoms > 0)
THEN
552 CALL qmmm_force_with_gaussian_low(grids, qmmm_env%added_shells%added_particles, &
553 qmmm_env%added_shells%mm_core_chrg, &
554 qmmm_env%added_shells%mm_core_index, qmmm_env%added_shells%num_mm_atoms, &
555 cube_info, para_env, eps_mm_rspace, auxbas_grid, coarser_grid, qmmm_env%added_shells%pgfs, &
556 qmmm_env%added_shells%potentials, forces_added_shells, aug_pools, mm_cell, &
557 qmmm_env%dOmmOqm, qmmm_env%periodic, qmmm_env%added_shells%per_potentials, iw, qmmm_env%par_scheme, &
558 qmmm_env%spherical_cutoff, shells)
562 CALL timestop(handle)
564 END SUBROUTINE qmmm_forces_with_gaussian
596 SUBROUTINE qmmm_force_with_gaussian_low(grids, mm_particles, mm_charges, &
597 mm_atom_index, num_mm_atoms, cube_info, para_env, &
598 eps_mm_rspace, auxbas_grid, coarser_grid, pgfs, potentials, Forces, &
599 aug_pools, mm_cell, dOmmOqm, periodic, per_potentials, iw, par_scheme, &
600 qmmm_spherical_cutoff, shells)
603 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mm_charges
604 INTEGER,
DIMENSION(:),
POINTER :: mm_atom_index
605 INTEGER,
INTENT(IN) :: num_mm_atoms
608 REAL(kind=
dp),
INTENT(IN) :: eps_mm_rspace
609 INTEGER,
INTENT(IN) :: auxbas_grid, coarser_grid
612 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: forces
615 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: dommoqm
616 LOGICAL,
INTENT(in) :: periodic
618 INTEGER,
INTENT(IN) :: iw, par_scheme
619 REAL(kind=
dp),
INTENT(IN) :: qmmm_spherical_cutoff(2)
620 LOGICAL,
INTENT(in) :: shells
622 CHARACTER(len=*),
PARAMETER :: routinen =
'qmmm_force_with_gaussian_low', &
623 routinenb =
'qmmm_forces_gaussian_low'
625 INTEGER :: handle, handle2, igauss, ilevel, imm, &
626 indmm, iradtyp, lindmm, myind, &
628 INTEGER,
DIMENSION(2, 3) :: bo
629 REAL(kind=
dp) :: alpha, dvol, height, sph_chrg_factor, w
630 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: xdat, ydat, zdat
631 REAL(kind=
dp),
DIMENSION(3) :: force, ra
636 CALL timeset(routinen, handle)
637 CALL timeset(routinenb//
"_G", handle2)
638 NULLIFY (pgf, pot, per_pot)
640 radius:
DO iradtyp = 1,
SIZE(pgfs)
641 pgf => pgfs(iradtyp)%pgf
642 pot => potentials(iradtyp)%pot
645 per_pot => per_potentials(iradtyp)%pot
646 n_rep_real = per_pot%n_rep_real
648 gaussian:
DO igauss = 1, pgf%Number_of_Gaussians
649 alpha = 1.0_dp/pgf%Gk(igauss)
651 height = pgf%Ak(igauss)
652 ilevel = pgf%grid_level(igauss)
653 dvol = grids(ilevel)%pw_grid%dvol
654 bo = grids(ilevel)%pw_grid%bounds_local
655 ALLOCATE (xdat(2, bo(1, 1):bo(2, 1)))
656 ALLOCATE (ydat(2, bo(1, 2):bo(2, 2)))
657 ALLOCATE (zdat(2, bo(1, 3):bo(2, 3)))
665 atoms:
DO imm = 1,
SIZE(pot%mm_atom_index)
667 myind = imm + (igauss - 1)*
SIZE(pot%mm_atom_index) + (iradtyp - 1)*pgf%Number_of_Gaussians
668 IF (mod(myind, para_env%num_pe) /= para_env%mepos) cycle atoms
670 lindmm = pot%mm_atom_index(imm)
671 indmm = mm_atom_index(lindmm)
673 ra(:) =
pbc(mm_particles(imm)%r - dommoqm, mm_cell) + dommoqm
675 ra(:) =
pbc(mm_particles(indmm)%r - dommoqm, mm_cell) + dommoqm
677 w = mm_charges(lindmm)*height
680 IF (qmmm_spherical_cutoff(1) > 0.0_dp)
THEN
682 w = w*sph_chrg_factor
684 IF (abs(w) <= epsilon(0.0_dp)) cycle atoms
689 pwgrid=grids(ilevel), &
690 cube_info=cube_info(ilevel), &
691 eps_mm_rspace=eps_mm_rspace, &
697 n_rep_real=n_rep_real, &
700 forces(:, lindmm) = forces(:, lindmm) + force(:)
704 IF (debug_this_module)
THEN
705 CALL debug_integrate_gf_rspace_nopbc(ilevel=ilevel, &
709 pwgrid=grids(ilevel), &
710 cube_info=cube_info(ilevel), &
711 eps_mm_rspace=eps_mm_rspace, &
712 aug_pools=aug_pools, &
715 auxbas_grid=auxbas_grid, &
716 n_rep_real=n_rep_real, &
726 CALL timestop(handle2)
727 CALL timeset(routinenb//
"_R", handle2)
729 CALL qmmm_forces_with_gaussian_lg(pgfs=pgfs, &
730 cgrid=grids(coarser_grid), &
731 num_mm_atoms=num_mm_atoms, &
732 mm_charges=mm_charges, &
733 mm_atom_index=mm_atom_index, &
734 mm_particles=mm_particles, &
736 coarser_grid_level=coarser_grid, &
738 per_potentials=per_potentials, &
739 aug_pools=aug_pools, &
743 par_scheme=par_scheme, &
744 qmmm_spherical_cutoff=qmmm_spherical_cutoff, &
747 CALL qmmm_forces_with_gaussian_lr(pgfs=pgfs, &
748 cgrid=grids(coarser_grid), &
749 num_mm_atoms=num_mm_atoms, &
750 mm_charges=mm_charges, &
751 mm_atom_index=mm_atom_index, &
752 mm_particles=mm_particles, &
754 coarser_grid_level=coarser_grid, &
756 potentials=potentials, &
757 aug_pools=aug_pools, &
761 par_scheme=par_scheme, &
762 qmmm_spherical_cutoff=qmmm_spherical_cutoff, &
765 CALL timestop(handle2)
766 CALL timestop(handle)
767 END SUBROUTINE qmmm_force_with_gaussian_low
794 SUBROUTINE qmmm_forces_with_gaussian_lg(pgfs, cgrid, num_mm_atoms, mm_charges, mm_atom_index, &
795 mm_particles, para_env, coarser_grid_level, Forces, per_potentials, &
796 aug_pools, mm_cell, dOmmOqm, iw, par_scheme, qmmm_spherical_cutoff, shells)
799 INTEGER,
INTENT(IN) :: num_mm_atoms
800 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mm_charges
801 INTEGER,
DIMENSION(:),
POINTER :: mm_atom_index
804 INTEGER,
INTENT(IN) :: coarser_grid_level
805 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: forces
809 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: dommoqm
810 INTEGER,
INTENT(IN) :: iw, par_scheme
811 REAL(kind=
dp),
DIMENSION(2),
INTENT(IN) :: qmmm_spherical_cutoff
814 CHARACTER(len=*),
PARAMETER :: routinen =
'qmmm_forces_with_gaussian_LG'
816 INTEGER :: handle, i, ii1, ii2, ii3, ii4, ij1, ij2, ij3, ij4, ik1, ik2, ik3, ik4, imm, &
817 indmm, iradtyp, ivec(3), j, k, lindmm, my_i, my_j, my_k, myind, npts(3)
818 INTEGER,
DIMENSION(2, 3) :: bo, gbo
819 REAL(kind=
dp) :: a1, a2, a3, abc_x(4, 4), abc_x_y(4), b1, b2, b3, c1, c2, c3, d1, d2, d3, &
820 dr1, dr1c, dr1i, dr2, dr2c, dr2i, dr3, dr3c, dr3i, dvol, e1, e2, e3, f1, f2, f3,
fac, &
821 ft1, ft2, ft3, g1, g2, g3, h1, h2, h3, p1, p2, p3, q1, q2, q3, qt, r1, r2, r3, rt1, rt2, &
822 rt3, rv1, rv2, rv3, s1, s1d, s1o, s2, s2d, s2o, s3, s3d, s3o, s4, s4d, s4o, &
823 sph_chrg_factor, t1, t1d, t1o, t2, t2d, t2o, t3, t3d, t3o, t4, t4d, t4o, u1, u2, u3, v1, &
824 v1d, v1o, v2, v2d, v2o, v3, v3d, v3o, v4, v4d, v4o, xd1, xd2, xd3, xs1, xs2, xs3
825 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: lforces
826 REAL(kind=
dp),
DIMENSION(3) :: ra, val, vec
827 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: grid, grid2
831 CALL timeset(routinen, handle)
833 ALLOCATE (lforces(3, num_mm_atoms))
835 dr1c = cgrid%pw_grid%dr(1)
836 dr2c = cgrid%pw_grid%dr(2)
837 dr3c = cgrid%pw_grid%dr(3)
838 dvol = cgrid%pw_grid%dvol
839 gbo = cgrid%pw_grid%bounds
840 bo = cgrid%pw_grid%bounds_local
843 radius:
DO iradtyp = 1,
SIZE(pgfs)
844 per_pot => per_potentials(iradtyp)%pot
846 grid2 => pw%array(:, :, :)
847 npts = pw%pw_grid%npts
848 dr1 = pw%pw_grid%dr(1)
849 dr2 = pw%pw_grid%dr(2)
850 dr3 = pw%pw_grid%dr(3)
869 atoms:
DO imm = 1,
SIZE(per_pot%mm_atom_index)
871 myind = imm + (iradtyp - 1)*
SIZE(per_pot%mm_atom_index)
872 IF (mod(myind, para_env%num_pe) /= para_env%mepos) cycle atoms
874 lindmm = per_pot%mm_atom_index(imm)
875 indmm = mm_atom_index(lindmm)
877 ra(:) =
pbc(mm_particles(lindmm)%r - dommoqm, mm_cell) + dommoqm
879 ra(:) =
pbc(mm_particles(indmm)%r - dommoqm, mm_cell) + dommoqm
881 qt = mm_charges(lindmm)
883 IF (qmmm_spherical_cutoff(1) > 0.0_dp)
THEN
885 qt = qt*sph_chrg_factor
887 IF (abs(qt) <= epsilon(0.0_dp)) cycle atoms
894 loopongrid:
DO k = bo(1, 3), bo(2, 3)
896 xs3 = real(my_k,
dp)*dr3c
897 my_j = bo(1, 2) - gbo(1, 2)
898 xs2 = real(my_j,
dp)*dr2c
901 ivec(3) = floor(vec(3)/pw%pw_grid%dr(3))
902 ik1 =
modulo(ivec(3) - 1, npts(3)) + 1
903 ik2 =
modulo(ivec(3), npts(3)) + 1
904 ik3 =
modulo(ivec(3) + 1, npts(3)) + 1
905 ik4 =
modulo(ivec(3) + 2, npts(3)) + 1
906 xd3 = (vec(3)/dr3) - real(ivec(3), kind=
dp)
919 v1o = 1.0_dp/6.0_dp*(64.0_dp - 48.0_dp*p1 + 12.0_dp*p2 - p3)
920 v2o = -22.0_dp/3.0_dp + 10.0_dp*q1 - 4.0_dp*q2 + 0.5_dp*q3
921 v3o = 2.0_dp/3.0_dp - 2.0_dp*r1 + 2.0_dp*r2 - 0.5_dp*r3
922 v4o = 1.0_dp/6.0_dp*u3
923 v1d = -8.0_dp + 4.0_dp*p1 - 0.5_dp*p2
924 v2d = 10.0_dp - 8.0_dp*q1 + 1.5_dp*q2
925 v3d = -2.0_dp + 4.0_dp*r1 - 1.5_dp*r2
927 DO j = bo(1, 2), bo(2, 2)
928 my_i = bo(1, 1) - gbo(1, 1)
929 xs1 = real(my_i,
dp)*dr1c
932 ivec(2) = floor(vec(2)/pw%pw_grid%dr(2))
933 ij1 =
modulo(ivec(2) - 1, npts(2)) + 1
934 ij2 =
modulo(ivec(2), npts(2)) + 1
935 ij3 =
modulo(ivec(2) + 1, npts(2)) + 1
936 ij4 =
modulo(ivec(2) + 2, npts(2)) + 1
937 xd2 = (vec(2)/dr2) - real(ivec(2), kind=
dp)
950 s1o = 1.0_dp/6.0_dp*(64.0_dp - 48.0_dp*e1 + 12.0_dp*e2 - e3)
951 s2o = -22.0_dp/3.0_dp + 10.0_dp*f1 - 4.0_dp*f2 + 0.5_dp*f3
952 s3o = 2.0_dp/3.0_dp - 2.0_dp*g1 + 2.0_dp*g2 - 0.5_dp*g3
953 s4o = 1.0_dp/6.0_dp*h3
954 s1d = -8.0_dp + 4.0_dp*e1 - 0.5_dp*e2
955 s2d = 10.0_dp - 8.0_dp*f1 + 1.5_dp*f2
956 s3d = -2.0_dp + 4.0_dp*g1 - 1.5_dp*g2
958 DO i = bo(1, 1), bo(2, 1)
961 ivec(1) = floor(vec(1)/pw%pw_grid%dr(1))
962 ii1 =
modulo(ivec(1) - 1, npts(1)) + 1
963 ii2 =
modulo(ivec(1), npts(1)) + 1
964 ii3 =
modulo(ivec(1) + 1, npts(1)) + 1
965 ii4 =
modulo(ivec(1) + 2, npts(1)) + 1
966 xd1 = (vec(1)/dr1) - real(ivec(1), kind=
dp)
979 t1o = 1.0_dp/6.0_dp*(64.0_dp - 48.0_dp*a1 + 12.0_dp*a2 - a3)
980 t2o = -22.0_dp/3.0_dp + 10.0_dp*b1 - 4.0_dp*b2 + 0.5_dp*b3
981 t3o = 2.0_dp/3.0_dp - 2.0_dp*c1 + 2.0_dp*c2 - 0.5_dp*c3
982 t4o = 1.0_dp/6.0_dp*d3
983 t1d = -8.0_dp + 4.0_dp*a1 - 0.5_dp*a2
984 t2d = 10.0_dp - 8.0_dp*b1 + 1.5_dp*b2
985 t3d = -2.0_dp + 4.0_dp*c1 - 1.5_dp*c2
1001 abc_x(1, 1) = grid2(ii1, ij1, ik1)*v1 + grid2(ii1, ij1, ik2)*v2 + grid2(ii1, ij1, ik3)*v3 + grid2(ii1, ij1, ik4)*v4
1002 abc_x(2, 1) = grid2(ii2, ij1, ik1)*v1 + grid2(ii2, ij1, ik2)*v2 + grid2(ii2, ij1, ik3)*v3 + grid2(ii2, ij1, ik4)*v4
1003 abc_x(3, 1) = grid2(ii3, ij1, ik1)*v1 + grid2(ii3, ij1, ik2)*v2 + grid2(ii3, ij1, ik3)*v3 + grid2(ii3, ij1, ik4)*v4
1004 abc_x(4, 1) = grid2(ii4, ij1, ik1)*v1 + grid2(ii4, ij1, ik2)*v2 + grid2(ii4, ij1, ik3)*v3 + grid2(ii4, ij1, ik4)*v4
1005 abc_x_y(1) = abc_x(1, 1)*t1 + abc_x(2, 1)*t2 + abc_x(3, 1)*t3 + abc_x(4, 1)*t4
1007 abc_x(1, 2) = grid2(ii1, ij2, ik1)*v1 + grid2(ii1, ij2, ik2)*v2 + grid2(ii1, ij2, ik3)*v3 + grid2(ii1, ij2, ik4)*v4
1008 abc_x(2, 2) = grid2(ii2, ij2, ik1)*v1 + grid2(ii2, ij2, ik2)*v2 + grid2(ii2, ij2, ik3)*v3 + grid2(ii2, ij2, ik4)*v4
1009 abc_x(3, 2) = grid2(ii3, ij2, ik1)*v1 + grid2(ii3, ij2, ik2)*v2 + grid2(ii3, ij2, ik3)*v3 + grid2(ii3, ij2, ik4)*v4
1010 abc_x(4, 2) = grid2(ii4, ij2, ik1)*v1 + grid2(ii4, ij2, ik2)*v2 + grid2(ii4, ij2, ik3)*v3 + grid2(ii4, ij2, ik4)*v4
1011 abc_x_y(2) = abc_x(1, 2)*t1 + abc_x(2, 2)*t2 + abc_x(3, 2)*t3 + abc_x(4, 2)*t4
1013 abc_x(1, 3) = grid2(ii1, ij3, ik1)*v1 + grid2(ii1, ij3, ik2)*v2 + grid2(ii1, ij3, ik3)*v3 + grid2(ii1, ij3, ik4)*v4
1014 abc_x(2, 3) = grid2(ii2, ij3, ik1)*v1 + grid2(ii2, ij3, ik2)*v2 + grid2(ii2, ij3, ik3)*v3 + grid2(ii2, ij3, ik4)*v4
1015 abc_x(3, 3) = grid2(ii3, ij3, ik1)*v1 + grid2(ii3, ij3, ik2)*v2 + grid2(ii3, ij3, ik3)*v3 + grid2(ii3, ij3, ik4)*v4
1016 abc_x(4, 3) = grid2(ii4, ij3, ik1)*v1 + grid2(ii4, ij3, ik2)*v2 + grid2(ii4, ij3, ik3)*v3 + grid2(ii4, ij3, ik4)*v4
1017 abc_x_y(3) = abc_x(1, 3)*t1 + abc_x(2, 3)*t2 + abc_x(3, 3)*t3 + abc_x(4, 3)*t4
1019 abc_x(1, 4) = grid2(ii1, ij4, ik1)*v1 + grid2(ii1, ij4, ik2)*v2 + grid2(ii1, ij4, ik3)*v3 + grid2(ii1, ij4, ik4)*v4
1020 abc_x(2, 4) = grid2(ii2, ij4, ik1)*v1 + grid2(ii2, ij4, ik2)*v2 + grid2(ii2, ij4, ik3)*v3 + grid2(ii2, ij4, ik4)*v4
1021 abc_x(3, 4) = grid2(ii3, ij4, ik1)*v1 + grid2(ii3, ij4, ik2)*v2 + grid2(ii3, ij4, ik3)*v3 + grid2(ii3, ij4, ik4)*v4
1022 abc_x(4, 4) = grid2(ii4, ij4, ik1)*v1 + grid2(ii4, ij4, ik2)*v2 + grid2(ii4, ij4, ik3)*v3 + grid2(ii4, ij4, ik4)*v4
1023 abc_x_y(4) = abc_x(1, 4)*t1 + abc_x(2, 4)*t2 + abc_x(3, 4)*t3 + abc_x(4, 4)*t4
1025 val(1) = abc_x_y(1)*s1 + abc_x_y(2)*s2 + abc_x_y(3)*s3 + abc_x_y(4)*s4
1036 abc_x_y(1) = abc_x(1, 1)*t1 + abc_x(2, 1)*t2 + abc_x(3, 1)*t3 + abc_x(4, 1)*t4
1037 abc_x_y(2) = abc_x(1, 2)*t1 + abc_x(2, 2)*t2 + abc_x(3, 2)*t3 + abc_x(4, 2)*t4
1038 abc_x_y(3) = abc_x(1, 3)*t1 + abc_x(2, 3)*t2 + abc_x(3, 3)*t3 + abc_x(4, 3)*t4
1039 abc_x_y(4) = abc_x(1, 4)*t1 + abc_x(2, 4)*t2 + abc_x(3, 4)*t3 + abc_x(4, 4)*t4
1041 val(2) = abc_x_y(1)*s1 + abc_x_y(2)*s2 + abc_x_y(3)*s3 + abc_x_y(4)*s4
1056 abc_x(1, 1) = grid2(ii1, ij1, ik1)*v1 + grid2(ii1, ij1, ik2)*v2 + grid2(ii1, ij1, ik3)*v3 + grid2(ii1, ij1, ik4)*v4
1057 abc_x(2, 1) = grid2(ii2, ij1, ik1)*v1 + grid2(ii2, ij1, ik2)*v2 + grid2(ii2, ij1, ik3)*v3 + grid2(ii2, ij1, ik4)*v4
1058 abc_x(3, 1) = grid2(ii3, ij1, ik1)*v1 + grid2(ii3, ij1, ik2)*v2 + grid2(ii3, ij1, ik3)*v3 + grid2(ii3, ij1, ik4)*v4
1059 abc_x(4, 1) = grid2(ii4, ij1, ik1)*v1 + grid2(ii4, ij1, ik2)*v2 + grid2(ii4, ij1, ik3)*v3 + grid2(ii4, ij1, ik4)*v4
1060 abc_x_y(1) = abc_x(1, 1)*t1 + abc_x(2, 1)*t2 + abc_x(3, 1)*t3 + abc_x(4, 1)*t4
1061 abc_x(1, 2) = grid2(ii1, ij2, ik1)*v1 + grid2(ii1, ij2, ik2)*v2 + grid2(ii1, ij2, ik3)*v3 + grid2(ii1, ij2, ik4)*v4
1062 abc_x(2, 2) = grid2(ii2, ij2, ik1)*v1 + grid2(ii2, ij2, ik2)*v2 + grid2(ii2, ij2, ik3)*v3 + grid2(ii2, ij2, ik4)*v4
1063 abc_x(3, 2) = grid2(ii3, ij2, ik1)*v1 + grid2(ii3, ij2, ik2)*v2 + grid2(ii3, ij2, ik3)*v3 + grid2(ii3, ij2, ik4)*v4
1064 abc_x(4, 2) = grid2(ii4, ij2, ik1)*v1 + grid2(ii4, ij2, ik2)*v2 + grid2(ii4, ij2, ik3)*v3 + grid2(ii4, ij2, ik4)*v4
1065 abc_x_y(2) = abc_x(1, 2)*t1 + abc_x(2, 2)*t2 + abc_x(3, 2)*t3 + abc_x(4, 2)*t4
1066 abc_x(1, 3) = grid2(ii1, ij3, ik1)*v1 + grid2(ii1, ij3, ik2)*v2 + grid2(ii1, ij3, ik3)*v3 + grid2(ii1, ij3, ik4)*v4
1067 abc_x(2, 3) = grid2(ii2, ij3, ik1)*v1 + grid2(ii2, ij3, ik2)*v2 + grid2(ii2, ij3, ik3)*v3 + grid2(ii2, ij3, ik4)*v4
1068 abc_x(3, 3) = grid2(ii3, ij3, ik1)*v1 + grid2(ii3, ij3, ik2)*v2 + grid2(ii3, ij3, ik3)*v3 + grid2(ii3, ij3, ik4)*v4
1069 abc_x(4, 3) = grid2(ii4, ij3, ik1)*v1 + grid2(ii4, ij3, ik2)*v2 + grid2(ii4, ij3, ik3)*v3 + grid2(ii4, ij3, ik4)*v4
1070 abc_x_y(3) = abc_x(1, 3)*t1 + abc_x(2, 3)*t2 + abc_x(3, 3)*t3 + abc_x(4, 3)*t4
1071 abc_x(1, 4) = grid2(ii1, ij4, ik1)*v1 + grid2(ii1, ij4, ik2)*v2 + grid2(ii1, ij4, ik3)*v3 + grid2(ii1, ij4, ik4)*v4
1072 abc_x(2, 4) = grid2(ii2, ij4, ik1)*v1 + grid2(ii2, ij4, ik2)*v2 + grid2(ii2, ij4, ik3)*v3 + grid2(ii2, ij4, ik4)*v4
1073 abc_x(3, 4) = grid2(ii3, ij4, ik1)*v1 + grid2(ii3, ij4, ik2)*v2 + grid2(ii3, ij4, ik3)*v3 + grid2(ii3, ij4, ik4)*v4
1074 abc_x(4, 4) = grid2(ii4, ij4, ik1)*v1 + grid2(ii4, ij4, ik2)*v2 + grid2(ii4, ij4, ik3)*v3 + grid2(ii4, ij4, ik4)*v4
1075 abc_x_y(4) = abc_x(1, 4)*t1 + abc_x(2, 4)*t2 + abc_x(3, 4)*t3 + abc_x(4, 4)*t4
1077 val(3) = abc_x_y(1)*s1 + abc_x_y(2)*s2 + abc_x_y(3)*s3 + abc_x_y(4)*s4
1080 ft1 = ft1 + val(1)*
fac
1081 ft2 = ft2 + val(2)*
fac
1082 ft3 = ft3 + val(3)*
fac
1089 lforces(1, lindmm) = ft1*qt
1090 lforces(2, lindmm) = ft2*qt
1091 lforces(3, lindmm) = ft3*qt
1093 forces(1, lindmm) = forces(1, lindmm) + lforces(1, lindmm)
1094 forces(2, lindmm) = forces(2, lindmm) + lforces(2, lindmm)
1095 forces(3, lindmm) = forces(3, lindmm) + lforces(3, lindmm)
1102 IF (debug_this_module)
THEN
1103 CALL debug_qmmm_forces_with_gauss_lg(pgfs=pgfs, &
1104 aug_pools=aug_pools, &
1106 num_mm_atoms=num_mm_atoms, &
1107 mm_charges=mm_charges, &
1108 mm_atom_index=mm_atom_index, &
1109 mm_particles=mm_particles, &
1110 coarser_grid_level=coarser_grid_level, &
1111 debug_force=lforces, &
1112 per_potentials=per_potentials, &
1113 para_env=para_env, &
1117 par_scheme=par_scheme, &
1118 qmmm_spherical_cutoff=qmmm_spherical_cutoff, &
1121 DEALLOCATE (lforces)
1122 CALL timestop(handle)
1123 END SUBROUTINE qmmm_forces_with_gaussian_lg
1150 SUBROUTINE qmmm_forces_with_gaussian_lr(pgfs, cgrid, num_mm_atoms, mm_charges, mm_atom_index, &
1151 mm_particles, para_env, coarser_grid_level, Forces, potentials, &
1152 aug_pools, mm_cell, dOmmOqm, iw, par_scheme, qmmm_spherical_cutoff, shells)
1155 INTEGER,
INTENT(IN) :: num_mm_atoms
1156 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mm_charges
1157 INTEGER,
DIMENSION(:),
POINTER :: mm_atom_index
1160 INTEGER,
INTENT(IN) :: coarser_grid_level
1161 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: forces
1165 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: dommoqm
1166 INTEGER,
INTENT(IN) :: iw, par_scheme
1167 REAL(kind=
dp),
DIMENSION(2),
INTENT(IN) :: qmmm_spherical_cutoff
1170 CHARACTER(len=*),
PARAMETER :: routinen =
'qmmm_forces_with_gaussian_LR'
1172 INTEGER :: handle, i, imm, indmm, iradtyp, ix, j, &
1173 k, lindmm, my_i, my_j, my_k, myind, &
1175 INTEGER,
DIMENSION(2, 3) :: bo, gbo
1176 REAL(kind=
dp) :: dr1, dr2, dr3, dvol, dx,
fac, ft1, ft2, &
1177 ft3, qt, r, r2, rd1, rd2, rd3, rt1, &
1178 rt2, rt3, rv1, rv2, rv3, rx, rx2, &
1179 sph_chrg_factor, term, xs1, xs2, xs3
1180 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: lforces
1181 REAL(kind=
dp),
DIMENSION(3) :: ra
1182 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: pot0_2
1183 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: grid
1186 CALL timeset(routinen, handle)
1187 ALLOCATE (lforces(3, num_mm_atoms))
1189 n1 = cgrid%pw_grid%npts(1)
1190 n2 = cgrid%pw_grid%npts(2)
1191 n3 = cgrid%pw_grid%npts(3)
1192 dr1 = cgrid%pw_grid%dr(1)
1193 dr2 = cgrid%pw_grid%dr(2)
1194 dr3 = cgrid%pw_grid%dr(3)
1195 dvol = cgrid%pw_grid%dvol
1196 gbo = cgrid%pw_grid%bounds
1197 bo = cgrid%pw_grid%bounds_local
1200 radius:
DO iradtyp = 1,
SIZE(pgfs)
1201 pot => potentials(iradtyp)%pot
1203 pot0_2 => pot%pot0_2
1211 atoms:
DO imm = 1,
SIZE(pot%mm_atom_index)
1213 myind = imm + (iradtyp - 1)*
SIZE(pot%mm_atom_index)
1214 IF (mod(myind, para_env%num_pe) /= para_env%mepos) cycle atoms
1216 lindmm = pot%mm_atom_index(imm)
1217 indmm = mm_atom_index(lindmm)
1218 ra(:) =
pbc(mm_particles(indmm)%r - dommoqm, mm_cell) + dommoqm
1220 ra(:) =
pbc(mm_particles(lindmm)%r - dommoqm, mm_cell) + dommoqm
1222 qt = mm_charges(lindmm)
1224 IF (qmmm_spherical_cutoff(1) > 0.0_dp)
THEN
1226 qt = qt*sph_chrg_factor
1228 IF (abs(qt) <= epsilon(0.0_dp)) cycle atoms
1235 loopongrid:
DO k = bo(1, 3), bo(2, 3)
1236 my_k = k - gbo(1, 3)
1237 xs3 = real(my_k,
dp)*dr3
1238 my_j = bo(1, 2) - gbo(1, 2)
1239 xs2 = real(my_j,
dp)*dr2
1241 DO j = bo(1, 2), bo(2, 2)
1242 my_i = bo(1, 1) - gbo(1, 1)
1243 xs1 = real(my_i,
dp)*dr1
1245 DO i = bo(1, 1), bo(2, 1)
1247 r2 = rv1*rv1 + rv2*rv2 + rv3*rv3
1249 ix = floor(r/dx) + 1
1250 rx = (r - real(ix - 1,
dp)*dx)/dx
1252 term = pot0_2(1, ix)*(-6.0_dp*(rx - rx2)) &
1253 + pot0_2(2, ix)*(1.0_dp - 4.0_dp*rx + 3.0_dp*rx2) &
1254 + pot0_2(1, ix + 1)*(6.0_dp*(rx - rx2)) &
1255 + pot0_2(2, ix + 1)*(-2.0_dp*rx + 3.0_dp*rx2)
1256 fac = grid(i, j, k)*term
1257 IF (r == 0.0_dp)
THEN
1275 lforces(1, lindmm) = ft1*qt
1276 lforces(2, lindmm) = ft2*qt
1277 lforces(3, lindmm) = ft3*qt
1279 forces(1, lindmm) = forces(1, lindmm) + lforces(1, lindmm)
1280 forces(2, lindmm) = forces(2, lindmm) + lforces(2, lindmm)
1281 forces(3, lindmm) = forces(3, lindmm) + lforces(3, lindmm)
1288 IF (debug_this_module)
THEN
1289 CALL debug_qmmm_forces_with_gauss_lr(pgfs=pgfs, &
1290 aug_pools=aug_pools, &
1292 num_mm_atoms=num_mm_atoms, &
1293 mm_charges=mm_charges, &
1294 mm_atom_index=mm_atom_index, &
1295 mm_particles=mm_particles, &
1296 coarser_grid_level=coarser_grid_level, &
1297 debug_force=lforces, &
1298 potentials=potentials, &
1299 para_env=para_env, &
1303 par_scheme=par_scheme, &
1304 qmmm_spherical_cutoff=qmmm_spherical_cutoff, &
1308 DEALLOCATE (lforces)
1309 CALL timestop(handle)
1310 END SUBROUTINE qmmm_forces_with_gaussian_lr
1329 SUBROUTINE qmmm_debug_forces(rho, qs_env, qmmm_env, Analytical_Forces, &
1330 mm_particles, mm_atom_index, num_mm_atoms, &
1331 interp_section, mm_cell)
1335 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: analytical_forces
1337 INTEGER,
DIMENSION(:),
POINTER :: mm_atom_index
1338 INTEGER,
INTENT(IN) :: num_mm_atoms
1342 CHARACTER(len=*),
PARAMETER :: routinen =
'qmmm_debug_forces'
1344 INTEGER :: handle, i, indmm, iw, j, k
1345 REAL(kind=
dp) :: coord_save
1346 REAL(kind=
dp),
DIMENSION(2) :: energy
1347 REAL(kind=
dp),
DIMENSION(3) :: err
1348 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: num_forces
1357 CALL timeset(routinen, handle)
1358 NULLIFY (num_forces)
1361 input=input_section, &
1367 CALL pw_env_get(pw_env=pw_env, pw_pools=pw_pools)
1368 CALL pw_pools(1)%pool%create_pw(v_qmmm_rspace)
1369 ALLOCATE (num_forces(3, num_mm_atoms))
1370 ks_qmmm_env_loc => qs_env%ks_qmmm_env
1371 IF (iw > 0)
WRITE (iw,
'(/A)')
"DEBUG SECTION:"
1372 atoms:
DO i = 1, num_mm_atoms
1373 indmm = mm_atom_index(i)
1375 coord_save = mm_particles(indmm)%r(j)
1378 mm_particles(indmm)%r(j) = coord_save + (-1)**k*dx
1380 SELECT CASE (qmmm_env%qmmm_coupl_type)
1382 cpabort(
"Coulomb QM/MM electrostatic coupling not implemented for GPW/GAPW.")
1384 cpabort(
"Point Charge QM/MM electrostatic coupling not implemented for GPW/GAPW.")
1387 v_qmmm=v_qmmm_rspace, &
1388 mm_particles=mm_particles, &
1389 aug_pools=qmmm_env%aug_pools, &
1390 para_env=para_env, &
1391 eps_mm_rspace=qmmm_env%eps_mm_rspace, &
1392 cube_info=ks_qmmm_env_loc%cube_info, &
1393 pw_pools=pw_pools, &
1394 auxbas_grid=qmmm_env%gridlevel_info%auxbas_grid, &
1395 coarser_grid=qmmm_env%gridlevel_info%coarser_grid, &
1396 interp_section=interp_section, &
1401 cpabort(
"Unknown QM/MM coupling")
1406 WRITE (iw,
'(A,I6,A,I3,A,2F15.9)') &
1407 "DEBUG :: MM Atom = ", indmm,
" Coord = ", j,
" Energies (+/-) :: ", energy(2), energy(1)
1409 num_forces(j, i) = (energy(2) - energy(1))/(2.0_dp*dx)
1410 mm_particles(indmm)%r(j) = coord_save
1414 SELECT CASE (qmmm_env%qmmm_coupl_type)
1416 cpabort(
"Coulomb QM/MM electrostatic coupling not implemented for GPW/GAPW.")
1418 cpabort(
"Point Charge QM/MM electrostatic coupling not implemented for GPW/GAPW.")
1420 IF (iw > 0)
WRITE (iw,
'(/A/)')
"CHECKING NUMERICAL Vs ANALYTICAL FORCES (Err%):"
1421 DO i = 1, num_mm_atoms
1422 indmm = mm_atom_index(i)
1425 IF (abs(num_forces(k, i)) >= 5.0e-5_dp)
THEN
1426 err(k) = (analytical_forces(k, i) - num_forces(k, i))/num_forces(k, i)*100.0_dp
1430 WRITE (iw, 100) indmm, analytical_forces(1, i), num_forces(1, i), err(1), &
1431 analytical_forces(2, i), num_forces(2, i), err(2), &
1432 analytical_forces(3, i), num_forces(3, i), err(3)
1434 cpassert(abs(err(1)) <= maxerr)
1435 cpassert(abs(err(2)) <= maxerr)
1436 cpassert(abs(err(3)) <= maxerr)
1439 IF (iw > 0)
WRITE (iw,
'(T3,A)')
"No QM/MM Derivatives to debug. Just Mechanical Coupling!"
1441 cpabort(
"Unknown QM/MM coupling")
1445 CALL pw_pools(1)%pool%give_back_pw(v_qmmm_rspace)
1446 DEALLOCATE (num_forces)
1447 CALL timestop(handle)
1448100
FORMAT(i5, 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ")
1449 END SUBROUTINE qmmm_debug_forces
1470 SUBROUTINE debug_integrate_gf_rspace_nopbc(ilevel, zetp, rp, W, pwgrid, cube_info, &
1471 eps_mm_rspace, aug_pools, debug_force, &
1472 mm_cell, auxbas_grid, n_rep_real, iw)
1473 INTEGER,
INTENT(IN) :: ilevel
1474 REAL(kind=
dp),
INTENT(IN) :: zetp
1475 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: rp
1476 REAL(kind=
dp),
INTENT(IN) :: w
1479 REAL(kind=
dp),
INTENT(IN) :: eps_mm_rspace
1481 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: debug_force
1483 INTEGER,
INTENT(IN) :: auxbas_grid
1484 INTEGER,
DIMENSION(3),
INTENT(IN) :: n_rep_real
1485 INTEGER,
INTENT(IN) :: iw
1487 CHARACTER(len=*),
PARAMETER :: routinen =
'debug_integrate_gf_rspace_NoPBC'
1489 INTEGER :: handle, i, igrid, k, ngrids
1490 INTEGER,
DIMENSION(2, 3) :: bo2
1491 INTEGER,
SAVE :: icount
1492 REAL(kind=
dp),
DIMENSION(2) :: energy
1493 REAL(kind=
dp),
DIMENSION(3) :: err, force, myrp
1494 REAL(kind=
dp),
DIMENSION(:),
POINTER :: xdat, ydat, zdat
1499 CALL timeset(routinen, handle)
1501 ngrids =
SIZE(aug_pools)
1503 DO igrid = 1, ngrids
1506 bo2 = grids(auxbas_grid)%pw_grid%bounds
1507 ALLOCATE (xdat(bo2(1, 1):bo2(2, 1)))
1508 ALLOCATE (ydat(bo2(1, 2):bo2(2, 2)))
1509 ALLOCATE (zdat(bo2(1, 3):bo2(2, 3)))
1515 myrp(i) = myrp(i) + (-1.0_dp)**k*dx
1521 pwgrid=grids(ilevel), &
1522 cube_info=cube_info, &
1523 eps_mm_rspace=eps_mm_rspace, &
1528 n_rep_real=n_rep_real, &
1533 force(i) = (energy(2) - energy(1))/(2.0_dp*dx)
1536 IF (all(force /= 0.0_dp))
THEN
1537 err(1) = (debug_force(1) - force(1))/force(1)*100.0_dp
1538 err(2) = (debug_force(2) - force(2))/force(2)*100.0_dp
1539 err(3) = (debug_force(3) - force(3))/force(3)*100.0_dp
1542 WRITE (iw, 100) icount, debug_force(1), force(1), err(1), &
1543 debug_force(2), force(2), err(2), &
1544 debug_force(3), force(3), err(3)
1546 cpassert(abs(err(1)) <= maxerr)
1547 cpassert(abs(err(2)) <= maxerr)
1548 cpassert(abs(err(3)) <= maxerr)
1550 IF (
ASSOCIATED(xdat))
THEN
1553 IF (
ASSOCIATED(ydat))
THEN
1556 IF (
ASSOCIATED(zdat))
THEN
1561 CALL timestop(handle)
1562100
FORMAT(
"Collocation : ", i5, 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ")
1563 END SUBROUTINE debug_integrate_gf_rspace_nopbc
1588 SUBROUTINE debug_qmmm_forces_with_gauss_lg(pgfs, aug_pools, rho, mm_charges, mm_atom_index, &
1589 mm_particles, num_mm_atoms, coarser_grid_level, per_potentials, &
1590 debug_force, para_env, mm_cell, dOmmOqm, iw, par_scheme, qmmm_spherical_cutoff, shells)
1595 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mm_charges
1596 INTEGER,
DIMENSION(:),
POINTER :: mm_atom_index
1598 INTEGER,
INTENT(IN) :: num_mm_atoms, coarser_grid_level
1600 REAL(kind=
dp),
DIMENSION(:, :) :: debug_force
1603 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: dommoqm
1604 INTEGER,
INTENT(IN) :: iw, par_scheme
1605 REAL(kind=
dp),
DIMENSION(2),
INTENT(IN) :: qmmm_spherical_cutoff
1608 CHARACTER(len=*),
PARAMETER :: routinen =
'debug_qmmm_forces_with_gauss_LG'
1610 INTEGER :: handle, i, igrid, indmm, j, k, ngrids
1611 REAL(kind=
dp) :: coord_save
1612 REAL(kind=
dp),
DIMENSION(2) :: energy
1613 REAL(kind=
dp),
DIMENSION(3) :: err
1614 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: num_forces
1617 ALLOCATE (num_forces(3, num_mm_atoms))
1618 CALL timeset(routinen, handle)
1619 ngrids =
SIZE(aug_pools)
1621 DO igrid = 1, ngrids
1624 atoms:
DO i = 1, num_mm_atoms
1625 indmm = mm_atom_index(i)
1627 coord_save = mm_particles(indmm)%r(j)
1630 mm_particles(indmm)%r(j) = coord_save + (-1)**k*dx
1631 CALL pw_zero(grids(coarser_grid_level))
1634 cgrid=grids(coarser_grid_level), &
1635 mm_charges=mm_charges, &
1636 mm_atom_index=mm_atom_index, &
1637 mm_particles=mm_particles, &
1638 para_env=para_env, &
1639 per_potentials=per_potentials, &
1642 par_scheme=par_scheme, &
1643 qmmm_spherical_cutoff=qmmm_spherical_cutoff, &
1649 WRITE (iw,
'(A,I6,A,I3,A,2F15.9)') &
1650 "DEBUG LR:: MM Atom = ", indmm,
" Coord = ", j,
" Energies (+/-) :: ", energy(2), energy(1)
1652 num_forces(j, i) = (energy(2) - energy(1))/(2.0_dp*dx)
1653 mm_particles(indmm)%r(j) = coord_save
1657 DO i = 1, num_mm_atoms
1658 indmm = mm_atom_index(i)
1660 IF (all(num_forces /= 0.0_dp))
THEN
1661 err(1) = (debug_force(1, i) - num_forces(1, i))/num_forces(1, i)*100.0_dp
1662 err(2) = (debug_force(2, i) - num_forces(2, i))/num_forces(2, i)*100.0_dp
1663 err(3) = (debug_force(3, i) - num_forces(3, i))/num_forces(3, i)*100.0_dp
1666 WRITE (iw, 100) indmm, debug_force(1, i), num_forces(1, i), err(1), &
1667 debug_force(2, i), num_forces(2, i), err(2), &
1668 debug_force(3, i), num_forces(3, i), err(3)
1670 cpassert(abs(err(1)) <= maxerr)
1671 cpassert(abs(err(2)) <= maxerr)
1672 cpassert(abs(err(3)) <= maxerr)
1675 DEALLOCATE (num_forces)
1677 CALL timestop(handle)
1678100
FORMAT(
"MM Atom LR : ", i5, 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ")
1679 END SUBROUTINE debug_qmmm_forces_with_gauss_lg
1704 SUBROUTINE debug_qmmm_forces_with_gauss_lr(pgfs, aug_pools, rho, mm_charges, mm_atom_index, &
1705 mm_particles, num_mm_atoms, coarser_grid_level, potentials, &
1706 debug_force, para_env, mm_cell, dOmmOqm, iw, par_scheme, qmmm_spherical_cutoff, shells)
1711 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mm_charges
1712 INTEGER,
DIMENSION(:),
POINTER :: mm_atom_index
1714 INTEGER,
INTENT(IN) :: num_mm_atoms, coarser_grid_level
1716 REAL(kind=
dp),
DIMENSION(:, :) :: debug_force
1719 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: dommoqm
1720 INTEGER,
INTENT(IN) :: iw, par_scheme
1721 REAL(kind=
dp),
DIMENSION(2),
INTENT(IN) :: qmmm_spherical_cutoff
1724 CHARACTER(len=*),
PARAMETER :: routinen =
'debug_qmmm_forces_with_gauss_LR'
1726 INTEGER :: handle, i, igrid, indmm, j, k, ngrids
1727 REAL(kind=
dp) :: coord_save
1728 REAL(kind=
dp),
DIMENSION(2) :: energy
1729 REAL(kind=
dp),
DIMENSION(3) :: err
1730 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: num_forces
1733 ALLOCATE (num_forces(3, num_mm_atoms))
1734 CALL timeset(routinen, handle)
1735 ngrids =
SIZE(aug_pools)
1737 DO igrid = 1, ngrids
1740 atoms:
DO i = 1, num_mm_atoms
1741 indmm = mm_atom_index(i)
1743 coord_save = mm_particles(indmm)%r(j)
1746 mm_particles(indmm)%r(j) = coord_save + (-1)**k*dx
1747 CALL pw_zero(grids(coarser_grid_level))
1750 grid=grids(coarser_grid_level), &
1751 mm_charges=mm_charges, &
1752 mm_atom_index=mm_atom_index, &
1753 mm_particles=mm_particles, &
1754 para_env=para_env, &
1755 potentials=potentials, &
1758 par_scheme=par_scheme, &
1759 qmmm_spherical_cutoff=qmmm_spherical_cutoff, &
1765 WRITE (iw,
'(A,I6,A,I3,A,2F15.9)') &
1766 "DEBUG LR:: MM Atom = ", indmm,
" Coord = ", j,
" Energies (+/-) :: ", energy(2), energy(1)
1768 num_forces(j, i) = (energy(2) - energy(1))/(2.0_dp*dx)
1769 mm_particles(indmm)%r(j) = coord_save
1773 DO i = 1, num_mm_atoms
1774 indmm = mm_atom_index(i)
1776 IF (all(num_forces(:, i) /= 0.0_dp))
THEN
1777 err(1) = (debug_force(1, i) - num_forces(1, i))/num_forces(1, i)*100.0_dp
1778 err(2) = (debug_force(2, i) - num_forces(2, i))/num_forces(2, i)*100.0_dp
1779 err(3) = (debug_force(3, i) - num_forces(3, i))/num_forces(3, i)*100.0_dp
1782 WRITE (iw, 100) indmm, debug_force(1, i), num_forces(1, i), err(1), &
1783 debug_force(2, i), num_forces(2, i), err(2), &
1784 debug_force(3, i), num_forces(3, i), err(3)
1786 cpassert(abs(err(1)) <= maxerr)
1787 cpassert(abs(err(2)) <= maxerr)
1788 cpassert(abs(err(3)) <= maxerr)
1791 DEALLOCATE (num_forces)
1793 CALL timestop(handle)
1794100
FORMAT(
"MM Atom LR : ", i5, 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ")
1795 END SUBROUTINE debug_qmmm_forces_with_gauss_lr
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
static GRID_HOST_DEVICE double fac(const int i)
Factorial function, e.g. fac(5) = 5! = 120.
Handles all functions related to the CELL.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
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,...
utils to manipulate splines on the regular grid of a pw
integer, parameter, public spline3_nopbc_interp
integer, parameter, public spline3_pbc_interp
subroutine, public pw_restrict_s3(pw_fine_in, pw_coarse_out, coarse_pool, param_section)
restricts the function from a fine grid to a coarse one
for a given dr()/dh(r) this will provide the bounds to be used if one wants to go over a sphere-subre...
Defines the basic variable types.
integer, parameter, public dp
Interface to the message passing library MPI.
Calculate the MM potential by collocating the primitive Gaussian functions (pgf).
subroutine, public integrate_gf_rspace_nopbc(zetp, rp, scale, w, pwgrid, cube_info, eps_mm_rspace, xdat, ydat, zdat, bo, force, n_rep_real, mm_cell)
Main driver to integrate gaussian functions on a grid function without using periodic boundary condit...
subroutine, public collocate_gf_rspace_nopbc(zetp, rp, scale, w, pwgrid, cube_info, eps_mm_rspace, xdat, ydat, zdat, bo2, n_rep_real, mm_cell)
Main driver to collocate gaussian functions on grid without using periodic boundary conditions (NoPBC...
Define the data structure for the particle information.
container for various plainwaves related things
subroutine, public pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
returns the various attributes of the pw env
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Sets the typo for the gaussian treatment of the qm/mm interaction.
A collection of methods to treat the QM/MM electrostatic coupling.
subroutine, public qmmm_elec_with_gaussian(qmmm_env, v_qmmm, mm_particles, aug_pools, cube_info, para_env, eps_mm_rspace, pw_pools, auxbas_grid, coarser_grid, interp_section, mm_cell)
Compute the QM/MM electrostatic Interaction collocating the gaussian Electrostatic Potential.
subroutine, public qmmm_elec_with_gaussian_lr(pgfs, grid, mm_charges, mm_atom_index, mm_particles, para_env, potentials, mm_cell, dommoqm, par_scheme, qmmm_spherical_cutoff, shells)
Compute the QM/MM electrostatic Interaction collocating (1/R - Sum_NG Gaussians) on the coarser grid ...
subroutine, public qmmm_elec_with_gaussian_lg(pgfs, cgrid, mm_charges, mm_atom_index, mm_particles, para_env, per_potentials, mm_cell, dommoqm, par_scheme, qmmm_spherical_cutoff, shells)
Compute the QM/MM electrostatic Interaction collocating (1/R - Sum_NG Gaussians) on the coarser grid ...
Routines to compute energy and forces in a QM/MM calculation.
subroutine, public qmmm_forces(qs_env, qmmm_env, mm_particles, calc_force, mm_cell)
General driver to Compute the contribution to the forces due to the QM/MM potential.
Calculation of the derivative of the QMMM Hamiltonian integral matrix <a|\sum_i q_i|b> for semi-empir...
subroutine, public deriv_se_qmmm_matrix(qs_env, qmmm_env, particles_mm, mm_cell, para_env, calc_force, forces, forces_added_charges)
Constructs the derivative w.r.t. 1-el semi-empirical hamiltonian QMMM terms.
TB methods used with QMMM.
subroutine, public deriv_tb_qmmm_matrix_gauss(qs_env, qmmm_env, particles_mm, mm_cell, para_env, calc_force, forces, forces_added_charges)
Constructs tight-binding QM/MM derivatives for Gaussian MM charges.
subroutine, public deriv_tb_qmmm_matrix(qs_env, qmmm_env, particles_mm, mm_cell, para_env, calc_force, forces, forces_added_charges)
Constructs the derivative w.r.t. 1-el DFTB hamiltonian QMMM terms.
subroutine, public deriv_tb_qmmm_matrix_pc(qs_env, qmmm_env, particles_mm, mm_cell, para_env, calc_force, forces, forces_added_charges)
Constructs the derivative w.r.t. 1-el DFTB hamiltonian QMMM terms.
subroutine, public spherical_cutoff_factor(spherical_cutoff, rij, factor)
Computes a spherical cutoff factor for the QMMM interactions.
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, mimic, 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_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, 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, matrix_vhxc, 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, xcint_weights, 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, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_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, harris_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, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
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...
Type defining parameters related to the simulation cell.
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
contained for different pw related things
to create arrays of pools
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
represent a pointer to a qmmm_gaussian_type, to be able to create arrays of pointers
calculation environment to calculate the ks_qmmm matrix, holds the QM/MM potential and all the needed...
keeps the density in various representations, keeping track of which ones are valid.