74#include "./base/base_uses.f90"
79 LOGICAL,
PARAMETER,
PRIVATE :: debug_this_module = .false.
80 REAL(KIND=
dp),
PARAMETER,
PRIVATE :: dx = 0.01_dp
81 REAL(KIND=
dp),
PARAMETER,
PRIVATE :: maxerr = 10.0_dp
82 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qmmm_gpw_forces'
99 SUBROUTINE qmmm_forces(qs_env, qmmm_env, mm_particles, calc_force, mm_cell)
103 LOGICAL,
INTENT(in),
OPTIONAL :: calc_force
106 CHARACTER(len=*),
PARAMETER :: routinen =
'qmmm_forces'
108 INTEGER :: handle, iatom, image_indmm, imm, indmm, &
110 LOGICAL :: gapw, need_f, periodic
111 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: forces, forces_added_charges, &
116 TYPE(
pw_c1d_gs_type),
POINTER :: rho0_s_gs, rho_core, rhoz_cneo_s_gs
128 CALL timeset(routinen, handle)
130 periodic = qmmm_env%periodic
131 IF (
PRESENT(calc_force)) need_f = calc_force
132 NULLIFY (dft_control, ks_qmmm_env_loc, rho, pw_env, energy, forces, &
133 forces_added_charges, input_section, rho0_s_gs, rhoz_cneo_s_gs, rho_r)
140 input=input_section, &
141 rho0_s_gs=rho0_s_gs, &
142 rhoz_cneo_s_gs=rhoz_cneo_s_gs, &
143 dft_control=dft_control)
148 ks_qmmm_env_loc => qs_env%ks_qmmm_env
152 extension=
".qmmmLog")
153 gapw = dft_control%qs_control%gapw
156 ALLOCATE (forces(3, qmmm_env%num_mm_atoms))
157 ALLOCATE (forces_added_charges(3, qmmm_env%added_charges%num_mm_atoms))
158 ALLOCATE (forces_added_shells(3, qmmm_env%added_shells%num_mm_atoms))
159 forces(:, :) = 0.0_dp
160 forces_added_charges(:, :) = 0.0_dp
161 forces_added_shells(:, :) = 0.0_dp
163 IF (dft_control%qs_control%semi_empirical)
THEN
165 SELECT CASE (qmmm_env%qmmm_coupl_type)
168 need_f, forces, forces_added_charges)
170 cpabort(
"Point Charge QM/MM electrostatic coupling not yet implemented for SE.")
172 cpabort(
"GAUSS or SWAVE QM/MM electrostatic coupling not yet implemented for SE.")
174 IF (iw > 0)
WRITE (iw,
'(T2,"QMMM|",1X,A)') &
175 "- No QM/MM Electrostatic coupling. Just Mechanical Coupling!"
177 IF (iw > 0)
WRITE (iw,
'(T2,"QMMM|",1X,A)')
"Unknown Coupling..."
180 ELSEIF (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)
193 cpabort(
"GAUSS or SWAVE QM/MM electrostatic coupling not yet implemented for DFTB.")
195 IF (iw > 0)
WRITE (iw,
'(T2,"QMMM|",1X,A)')
"Unknown Coupling..."
199 forces(:, :) = forces(:, :)/real(para_env%num_pe, kind=
dp)
200 forces_added_charges(:, :) = forces_added_charges(:, :)/real(para_env%num_pe, kind=
dp)
206 auxbas_pw_pool=auxbas_pool)
207 CALL auxbas_pool%create_pw(rho_tot_r)
210 IF (dft_control%qs_control%gapw_control%nopaw_as_gpw)
THEN
212 energy%qmmm_nu =
pw_integral_ab(rho_tot_r, ks_qmmm_env_loc%v_qmmm_rspace)
213 CALL auxbas_pool%create_pw(rho_tot_r2)
215 CALL pw_axpy(rho_tot_r2, rho_tot_r)
216 IF (
ASSOCIATED(rhoz_cneo_s_gs))
THEN
217 CALL auxbas_pool%create_pw(rho_tot_r3)
219 CALL pw_axpy(rho_tot_r3, rho_tot_r)
220 CALL auxbas_pool%give_back_pw(rho_tot_r3)
222 CALL auxbas_pool%give_back_pw(rho_tot_r2)
225 IF (
ASSOCIATED(rhoz_cneo_s_gs))
THEN
226 CALL auxbas_pool%create_pw(rho_tot_r3)
228 CALL pw_axpy(rho_tot_r3, rho_tot_r)
229 CALL auxbas_pool%give_back_pw(rho_tot_r3)
234 energy%qmmm_nu = 0.0_dp
241 energy%qmmm_nu =
pw_integral_ab(rho_tot_r, ks_qmmm_env_loc%v_qmmm_rspace)
245 DO ispin = 1,
SIZE(rho_r)
246 CALL pw_axpy(rho_r(ispin), rho_tot_r)
248 IF (iw > 0)
WRITE (iw,
'(T2,"QMMM|",1X,A)')
"Evaluating forces on MM atoms due to the:"
250 SELECT CASE (qmmm_env%qmmm_coupl_type)
252 cpabort(
"Coulomb QM/MM electrostatic coupling not implemented for GPW/GAPW.")
254 cpabort(
"Point Charge QM/MM electrostatic coupling not yet implemented for GPW/GAPW.")
256 IF (iw > 0)
WRITE (iw,
'(T2,"QMMM|",1X,A)') &
257 "- QM/MM Coupling computed collocating the Gaussian Potential Functions."
258 CALL qmmm_forces_with_gaussian(rho=rho_tot_r, &
260 mm_particles=mm_particles, &
261 aug_pools=qmmm_env%aug_pools, &
262 auxbas_grid=qmmm_env%gridlevel_info%auxbas_grid, &
263 coarser_grid=qmmm_env%gridlevel_info%coarser_grid, &
266 eps_mm_rspace=qmmm_env%eps_mm_rspace, &
267 cube_info=ks_qmmm_env_loc%cube_info, &
269 forces_added_charges=forces_added_charges, &
270 forces_added_shells=forces_added_shells, &
271 interp_section=interp_section, &
275 IF (iw > 0)
WRITE (iw,
'(T2,"QMMM|",1X,A)') &
276 "- No QM/MM Electrostatic coupling. Just Mechanical Coupling!"
278 IF (iw > 0)
WRITE (iw,
'(T2,"QMMM|",1X,A)')
"- Unknown Coupling..."
284 energy%total = energy%total + energy%qmmm_nu
289 IF (qmmm_env%num_mm_atoms /= 0)
CALL para_env%sum(forces)
290 IF (qmmm_env%added_charges%num_mm_atoms /= 0)
CALL para_env%sum(forces_added_charges)
291 IF (qmmm_env%added_shells%num_mm_atoms /= 0)
CALL para_env%sum(forces_added_shells)
293 IF (debug_this_module)
THEN
294 IF (dft_control%qs_control%semi_empirical .OR. &
295 dft_control%qs_control%dftb .OR. dft_control%qs_control%xtb)
THEN
296 WRITE (iw, *)
"NO DEBUG AVAILABLE in module"//trim(routinen)
300 DO imm = 1,
SIZE(qmmm_env%mm_atom_index)
301 WRITE (iw, *)
"ANALYTICAL FORCES:"
302 indmm = qmmm_env%mm_atom_index(imm)
303 WRITE (iw,
'(I6,3F15.9)') indmm, forces(:, imm)
306 CALL qmmm_debug_forces(rho=rho_tot_r, &
309 analytical_forces=forces, &
310 mm_particles=mm_particles, &
311 mm_atom_index=qmmm_env%mm_atom_index, &
312 num_mm_atoms=qmmm_env%num_mm_atoms, &
313 interp_section=interp_section, &
319 IF ((.NOT. dft_control%qs_control%semi_empirical) .AND. &
320 (.NOT. dft_control%qs_control%dftb) .AND. (.NOT. dft_control%qs_control%xtb))
THEN
321 CALL auxbas_pool%give_back_pw(rho_tot_r)
324 IF (.NOT. gapw)
WRITE (iw,
'(T2,"QMMM|",1X,A,T66,F15.9)') &
325 "QM/MM Nuclear Electrostatic Potential :", energy%qmmm_nu
326 WRITE (iw,
'(T2,"QMMM|",1X,A,T66,F15.9)') &
327 "QMMM Total Energy (QM + QMMM electronic + QMMM nuclear):", energy%total
328 WRITE (iw,
'(T2,"QMMM|",1X,A)')
"MM energy NOT included in the above term!"// &
329 " Check for: FORCE_EVAL ( QMMM )"
330 WRITE (iw,
'(T2,"QMMM|",1X,A)')
"that includes both QM, QMMM and MM energy terms!"
334 DO imm = 1, qmmm_env%num_mm_atoms
335 indmm = qmmm_env%mm_atom_index(imm)
338 IF (qmmm_env%image_charge)
THEN
339 DO iatom = 1, qmmm_env%num_image_mm_atoms
340 image_indmm = qmmm_env%image_charge_pot%image_mm_list(iatom)
341 IF (image_indmm .EQ. indmm)
THEN
342 forces(:, imm) = forces(:, imm) &
343 + qmmm_env%image_charge_pot%image_forcesMM(:, iatom)
350 mm_particles(indmm)%f(:) = -forces(:, imm) + mm_particles(indmm)%f(:)
353 IF (qmmm_env%move_mm_charges .OR. qmmm_env%add_mm_charges)
THEN
354 DO imm = 1, qmmm_env%added_charges%num_mm_atoms
355 indmm = qmmm_env%added_charges%mm_atom_index(imm)
358 qmmm_env%added_charges%added_particles(indmm)%f(:) = -forces_added_charges(:, imm)
361 DEALLOCATE (forces_added_charges)
362 IF (qmmm_env%added_shells%num_mm_atoms .GT. 0)
THEN
363 DO imm = 1, qmmm_env%added_shells%num_mm_atoms
364 indmm = qmmm_env%added_shells%mm_core_index(imm)
367 qmmm_env%added_shells%added_particles(imm)%f(:) = qmmm_env%added_shells%added_particles(imm)%f(:) - &
368 forces_added_shells(:, imm)
372 DEALLOCATE (forces_added_shells)
375 CALL timestop(handle)
403 SUBROUTINE qmmm_forces_with_gaussian(rho, qmmm_env, mm_particles, &
404 aug_pools, auxbas_grid, coarser_grid, cube_info, para_env, &
405 eps_mm_rspace, pw_pools, Forces, Forces_added_charges, Forces_added_shells, &
406 interp_section, iw, mm_cell)
411 INTEGER,
INTENT(IN) :: auxbas_grid, coarser_grid
414 REAL(kind=
dp),
INTENT(IN) :: eps_mm_rspace
416 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: forces, forces_added_charges, &
419 INTEGER,
INTENT(IN) :: iw
422 CHARACTER(len=*),
PARAMETER :: routinen =
'qmmm_forces_with_gaussian'
424 INTEGER :: handle, i, igrid, j, k, kind_interp, me, &
426 INTEGER,
DIMENSION(3) :: glb, gub, lb, ub
427 INTEGER,
DIMENSION(:),
POINTER :: pos_of_x
429 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: tmp
436 CALL timeset(routinen, handle)
438 cpassert(
ASSOCIATED(mm_particles))
439 cpassert(
ASSOCIATED(qmmm_env%mm_atom_chrg))
440 cpassert(
ASSOCIATED(qmmm_env%mm_atom_index))
441 cpassert(
ASSOCIATED(forces))
443 ngrids =
SIZE(pw_pools)
449 lb = rho%pw_grid%bounds_local(1, :)
450 ub = rho%pw_grid%bounds_local(2, :)
451 grids(auxbas_grid)%array(lb(1):ub(1), &
453 lb(3):ub(3)) = rho%array
456 grids(auxbas_grid)%array(i, ub(2) + 1, ub(3) + 1) = rho%array(i, lb(2), lb(3))
460 grids(auxbas_grid)%array(i, ub(2) + 1, k) = rho%array(i, lb(2), k)
465 grids(auxbas_grid)%array(i, j, ub(3) + 1) = rho%array(i, j, lb(3))
468 pos_of_x => grids(auxbas_grid)%pw_grid%para%pos_of_x
469 group = grids(auxbas_grid)%pw_grid%para%group
470 me = grids(auxbas_grid)%pw_grid%para%group%mepos
471 glb = rho%pw_grid%bounds(1, :)
472 gub = rho%pw_grid%bounds(2, :)
473 IF ((pos_of_x(glb(1)) .EQ. me) .AND. (pos_of_x(gub(1)) .EQ. me))
THEN
476 grids(auxbas_grid)%array(ub(1) + 1, j, k) = rho%array(lb(1), j, k)
478 grids(auxbas_grid)%array(ub(1) + 1, ub(2) + 1, k) = rho%array(lb(1), lb(2), k)
481 grids(auxbas_grid)%array(ub(1) + 1, j, ub(3) + 1) = rho%array(lb(1), j, lb(3))
483 grids(auxbas_grid)%array(ub(1) + 1, ub(2) + 1, ub(3) + 1) = rho%array(lb(1), lb(2), lb(3))
484 ELSE IF (pos_of_x(glb(1)) .EQ. me)
THEN
485 ALLOCATE (tmp(rho%pw_grid%bounds_local(1, 2):rho%pw_grid%bounds_local(2, 2), &
486 rho%pw_grid%bounds_local(1, 3):rho%pw_grid%bounds_local(2, 3)))
487 tmp = rho%array(lb(1), :, :)
488 CALL group%isend(msgin=tmp, dest=pos_of_x(rho%pw_grid%bounds(2, 1)), &
489 request=request, tag=112)
491 ELSE IF (pos_of_x(gub(1)) .EQ. me)
THEN
492 ALLOCATE (tmp(rho%pw_grid%bounds_local(1, 2):rho%pw_grid%bounds_local(2, 2), &
493 rho%pw_grid%bounds_local(1, 3):rho%pw_grid%bounds_local(2, 3)))
494 CALL group%irecv(msgout=tmp, source=pos_of_x(rho%pw_grid%bounds(1, 1)), &
495 request=request, tag=112)
500 grids(auxbas_grid)%array(ub(1) + 1, j, k) = tmp(j, k)
502 grids(auxbas_grid)%array(ub(1) + 1, ub(2) + 1, k) = tmp(lb(2), k)
505 grids(auxbas_grid)%array(ub(1) + 1, j, ub(3) + 1) = tmp(j, lb(3))
507 grids(auxbas_grid)%array(ub(1) + 1, ub(2) + 1, ub(3) + 1) = tmp(lb(2), lb(3))
509 IF (
ASSOCIATED(tmp))
THEN
514 CALL para_env%sum(grids(auxbas_grid)%array)
518 SELECT CASE (kind_interp)
521 DO igrid = auxbas_grid,
SIZE(grids) - 1
524 aug_pools(igrid + 1)%pool, &
525 param_section=interp_section)
532 CALL qmmm_force_with_gaussian_low(grids, mm_particles, &
533 qmmm_env%mm_atom_chrg, qmmm_env%mm_atom_index, &
534 qmmm_env%num_mm_atoms, cube_info, para_env, eps_mm_rspace, auxbas_grid, &
535 coarser_grid, qmmm_env%pgfs, qmmm_env%potentials, forces, aug_pools, &
536 mm_cell, qmmm_env%dOmmOqm, qmmm_env%periodic, qmmm_env%per_potentials, &
537 iw, qmmm_env%par_scheme, qmmm_env%spherical_cutoff, shells)
539 IF (qmmm_env%move_mm_charges .OR. qmmm_env%add_mm_charges)
THEN
540 CALL qmmm_force_with_gaussian_low(grids, qmmm_env%added_charges%added_particles, &
541 qmmm_env%added_charges%mm_atom_chrg, &
542 qmmm_env%added_charges%mm_atom_index, qmmm_env%added_charges%num_mm_atoms, &
543 cube_info, para_env, eps_mm_rspace, auxbas_grid, coarser_grid, qmmm_env%added_charges%pgfs, &
544 qmmm_env%added_charges%potentials, forces_added_charges, aug_pools, mm_cell, &
545 qmmm_env%dOmmOqm, qmmm_env%periodic, qmmm_env%added_charges%per_potentials, iw, qmmm_env%par_scheme, &
546 qmmm_env%spherical_cutoff, shells)
549 IF (qmmm_env%added_shells%num_mm_atoms .GT. 0)
THEN
551 CALL qmmm_force_with_gaussian_low(grids, qmmm_env%added_shells%added_particles, &
552 qmmm_env%added_shells%mm_core_chrg, &
553 qmmm_env%added_shells%mm_core_index, qmmm_env%added_shells%num_mm_atoms, &
554 cube_info, para_env, eps_mm_rspace, auxbas_grid, coarser_grid, qmmm_env%added_shells%pgfs, &
555 qmmm_env%added_shells%potentials, forces_added_shells, aug_pools, mm_cell, &
556 qmmm_env%dOmmOqm, qmmm_env%periodic, qmmm_env%added_shells%per_potentials, iw, qmmm_env%par_scheme, &
557 qmmm_env%spherical_cutoff, shells)
561 CALL timestop(handle)
563 END SUBROUTINE qmmm_forces_with_gaussian
595 SUBROUTINE qmmm_force_with_gaussian_low(grids, mm_particles, mm_charges, &
596 mm_atom_index, num_mm_atoms, cube_info, para_env, &
597 eps_mm_rspace, auxbas_grid, coarser_grid, pgfs, potentials, Forces, &
598 aug_pools, mm_cell, dOmmOqm, periodic, per_potentials, iw, par_scheme, &
599 qmmm_spherical_cutoff, shells)
602 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mm_charges
603 INTEGER,
DIMENSION(:),
POINTER :: mm_atom_index
604 INTEGER,
INTENT(IN) :: num_mm_atoms
607 REAL(kind=
dp),
INTENT(IN) :: eps_mm_rspace
608 INTEGER,
INTENT(IN) :: auxbas_grid, coarser_grid
611 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: forces
614 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: dommoqm
615 LOGICAL,
INTENT(in) :: periodic
617 INTEGER,
INTENT(IN) :: iw, par_scheme
618 REAL(kind=
dp),
INTENT(IN) :: qmmm_spherical_cutoff(2)
619 LOGICAL,
INTENT(in) :: shells
621 CHARACTER(len=*),
PARAMETER :: routinen =
'qmmm_force_with_gaussian_low', &
622 routinenb =
'qmmm_forces_gaussian_low'
624 INTEGER :: handle, handle2, igauss, ilevel, imm, &
625 indmm, iradtyp, lindmm, myind, &
627 INTEGER,
DIMENSION(2, 3) :: bo
628 REAL(kind=
dp) :: alpha, dvol, height, sph_chrg_factor, w
629 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: xdat, ydat, zdat
630 REAL(kind=
dp),
DIMENSION(3) :: force, ra
635 CALL timeset(routinen, handle)
636 CALL timeset(routinenb//
"_G", handle2)
637 NULLIFY (pgf, pot, per_pot)
639 radius:
DO iradtyp = 1,
SIZE(pgfs)
640 pgf => pgfs(iradtyp)%pgf
641 pot => potentials(iradtyp)%pot
644 per_pot => per_potentials(iradtyp)%pot
645 n_rep_real = per_pot%n_rep_real
647 gaussian:
DO igauss = 1, pgf%Number_of_Gaussians
648 alpha = 1.0_dp/pgf%Gk(igauss)
650 height = pgf%Ak(igauss)
651 ilevel = pgf%grid_level(igauss)
652 dvol = grids(ilevel)%pw_grid%dvol
653 bo = grids(ilevel)%pw_grid%bounds_local
654 ALLOCATE (xdat(2, bo(1, 1):bo(2, 1)))
655 ALLOCATE (ydat(2, bo(1, 2):bo(2, 2)))
656 ALLOCATE (zdat(2, bo(1, 3):bo(2, 3)))
664 atoms:
DO imm = 1,
SIZE(pot%mm_atom_index)
666 myind = imm + (igauss - 1)*
SIZE(pot%mm_atom_index) + (iradtyp - 1)*pgf%Number_of_Gaussians
667 IF (mod(myind, para_env%num_pe) /= para_env%mepos) cycle atoms
669 lindmm = pot%mm_atom_index(imm)
670 indmm = mm_atom_index(lindmm)
672 ra(:) =
pbc(mm_particles(imm)%r - dommoqm, mm_cell) + dommoqm
674 ra(:) =
pbc(mm_particles(indmm)%r - dommoqm, mm_cell) + dommoqm
676 w = mm_charges(lindmm)*height
679 IF (qmmm_spherical_cutoff(1) > 0.0_dp)
THEN
681 w = w*sph_chrg_factor
683 IF (abs(w) <= epsilon(0.0_dp)) cycle atoms
688 pwgrid=grids(ilevel), &
689 cube_info=cube_info(ilevel), &
690 eps_mm_rspace=eps_mm_rspace, &
696 n_rep_real=n_rep_real, &
699 forces(:, lindmm) = forces(:, lindmm) + force(:)
703 IF (debug_this_module)
THEN
704 CALL debug_integrate_gf_rspace_nopbc(ilevel=ilevel, &
708 pwgrid=grids(ilevel), &
709 cube_info=cube_info(ilevel), &
710 eps_mm_rspace=eps_mm_rspace, &
711 aug_pools=aug_pools, &
714 auxbas_grid=auxbas_grid, &
715 n_rep_real=n_rep_real, &
725 CALL timestop(handle2)
726 CALL timeset(routinenb//
"_R", handle2)
728 CALL qmmm_forces_with_gaussian_lg(pgfs=pgfs, &
729 cgrid=grids(coarser_grid), &
730 num_mm_atoms=num_mm_atoms, &
731 mm_charges=mm_charges, &
732 mm_atom_index=mm_atom_index, &
733 mm_particles=mm_particles, &
735 coarser_grid_level=coarser_grid, &
737 per_potentials=per_potentials, &
738 aug_pools=aug_pools, &
742 par_scheme=par_scheme, &
743 qmmm_spherical_cutoff=qmmm_spherical_cutoff, &
746 CALL qmmm_forces_with_gaussian_lr(pgfs=pgfs, &
747 cgrid=grids(coarser_grid), &
748 num_mm_atoms=num_mm_atoms, &
749 mm_charges=mm_charges, &
750 mm_atom_index=mm_atom_index, &
751 mm_particles=mm_particles, &
753 coarser_grid_level=coarser_grid, &
755 potentials=potentials, &
756 aug_pools=aug_pools, &
760 par_scheme=par_scheme, &
761 qmmm_spherical_cutoff=qmmm_spherical_cutoff, &
764 CALL timestop(handle2)
765 CALL timestop(handle)
766 END SUBROUTINE qmmm_force_with_gaussian_low
793 SUBROUTINE qmmm_forces_with_gaussian_lg(pgfs, cgrid, num_mm_atoms, mm_charges, mm_atom_index, &
794 mm_particles, para_env, coarser_grid_level, Forces, per_potentials, &
795 aug_pools, mm_cell, dOmmOqm, iw, par_scheme, qmmm_spherical_cutoff, shells)
798 INTEGER,
INTENT(IN) :: num_mm_atoms
799 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mm_charges
800 INTEGER,
DIMENSION(:),
POINTER :: mm_atom_index
803 INTEGER,
INTENT(IN) :: coarser_grid_level
804 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: forces
808 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: dommoqm
809 INTEGER,
INTENT(IN) :: iw, par_scheme
810 REAL(kind=
dp),
DIMENSION(2),
INTENT(IN) :: qmmm_spherical_cutoff
813 CHARACTER(len=*),
PARAMETER :: routinen =
'qmmm_forces_with_gaussian_LG'
815 INTEGER :: handle, i, ii1, ii2, ii3, ii4, ij1, ij2, ij3, ij4, ik1, ik2, ik3, ik4, imm, &
816 indmm, iradtyp, ivec(3), j, k, lindmm, my_i, my_j, my_k, myind, npts(3)
817 INTEGER,
DIMENSION(2, 3) :: bo, gbo
818 REAL(kind=
dp) :: a1, a2, a3, abc_x(4, 4), abc_x_y(4), b1, b2, b3, c1, c2, c3, d1, d2, d3, &
819 dr1, dr1c, dr1i, dr2, dr2c, dr2i, dr3, dr3c, dr3i, dvol, e1, e2, e3, f1, f2, f3,
fac, &
820 ft1, ft2, ft3, g1, g2, g3, h1, h2, h3, p1, p2, p3, q1, q2, q3, qt, r1, r2, r3, rt1, rt2, &
821 rt3, rv1, rv2, rv3, s1, s1d, s1o, s2, s2d, s2o, s3, s3d, s3o, s4, s4d, s4o, &
822 sph_chrg_factor, t1, t1d, t1o, t2, t2d, t2o, t3, t3d, t3o, t4, t4d, t4o, u1, u2, u3, v1, &
823 v1d, v1o, v2, v2d, v2o, v3, v3d, v3o, v4, v4d, v4o, xd1, xd2, xd3, xs1, xs2, xs3
824 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: lforces
825 REAL(kind=
dp),
DIMENSION(3) :: ra, val, vec
826 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: grid, grid2
830 CALL timeset(routinen, handle)
832 ALLOCATE (lforces(3, num_mm_atoms))
834 dr1c = cgrid%pw_grid%dr(1)
835 dr2c = cgrid%pw_grid%dr(2)
836 dr3c = cgrid%pw_grid%dr(3)
837 dvol = cgrid%pw_grid%dvol
838 gbo = cgrid%pw_grid%bounds
839 bo = cgrid%pw_grid%bounds_local
842 radius:
DO iradtyp = 1,
SIZE(pgfs)
843 per_pot => per_potentials(iradtyp)%pot
845 grid2 => pw%array(:, :, :)
846 npts = pw%pw_grid%npts
847 dr1 = pw%pw_grid%dr(1)
848 dr2 = pw%pw_grid%dr(2)
849 dr3 = pw%pw_grid%dr(3)
868 atoms:
DO imm = 1,
SIZE(per_pot%mm_atom_index)
870 myind = imm + (iradtyp - 1)*
SIZE(per_pot%mm_atom_index)
871 IF (mod(myind, para_env%num_pe) /= para_env%mepos) cycle
873 lindmm = per_pot%mm_atom_index(imm)
874 indmm = mm_atom_index(lindmm)
876 ra(:) =
pbc(mm_particles(lindmm)%r - dommoqm, mm_cell) + dommoqm
878 ra(:) =
pbc(mm_particles(indmm)%r - dommoqm, mm_cell) + dommoqm
880 qt = mm_charges(lindmm)
882 IF (qmmm_spherical_cutoff(1) > 0.0_dp)
THEN
884 qt = qt*sph_chrg_factor
886 IF (abs(qt) <= epsilon(0.0_dp)) cycle atoms
893 loopongrid:
DO k = bo(1, 3), bo(2, 3)
895 xs3 = real(my_k,
dp)*dr3c
896 my_j = bo(1, 2) - gbo(1, 2)
897 xs2 = real(my_j,
dp)*dr2c
900 ivec(3) = floor(vec(3)/pw%pw_grid%dr(3))
901 ik1 =
modulo(ivec(3) - 1, npts(3)) + 1
902 ik2 =
modulo(ivec(3), npts(3)) + 1
903 ik3 =
modulo(ivec(3) + 1, npts(3)) + 1
904 ik4 =
modulo(ivec(3) + 2, npts(3)) + 1
905 xd3 = (vec(3)/dr3) - real(ivec(3), kind=
dp)
918 v1o = 1.0_dp/6.0_dp*(64.0_dp - 48.0_dp*p1 + 12.0_dp*p2 - p3)
919 v2o = -22.0_dp/3.0_dp + 10.0_dp*q1 - 4.0_dp*q2 + 0.5_dp*q3
920 v3o = 2.0_dp/3.0_dp - 2.0_dp*r1 + 2.0_dp*r2 - 0.5_dp*r3
921 v4o = 1.0_dp/6.0_dp*u3
922 v1d = -8.0_dp + 4.0_dp*p1 - 0.5_dp*p2
923 v2d = 10.0_dp - 8.0_dp*q1 + 1.5_dp*q2
924 v3d = -2.0_dp + 4.0_dp*r1 - 1.5_dp*r2
926 DO j = bo(1, 2), bo(2, 2)
927 my_i = bo(1, 1) - gbo(1, 1)
928 xs1 = real(my_i,
dp)*dr1c
931 ivec(2) = floor(vec(2)/pw%pw_grid%dr(2))
932 ij1 =
modulo(ivec(2) - 1, npts(2)) + 1
933 ij2 =
modulo(ivec(2), npts(2)) + 1
934 ij3 =
modulo(ivec(2) + 1, npts(2)) + 1
935 ij4 =
modulo(ivec(2) + 2, npts(2)) + 1
936 xd2 = (vec(2)/dr2) - real(ivec(2), kind=
dp)
949 s1o = 1.0_dp/6.0_dp*(64.0_dp - 48.0_dp*e1 + 12.0_dp*e2 - e3)
950 s2o = -22.0_dp/3.0_dp + 10.0_dp*f1 - 4.0_dp*f2 + 0.5_dp*f3
951 s3o = 2.0_dp/3.0_dp - 2.0_dp*g1 + 2.0_dp*g2 - 0.5_dp*g3
952 s4o = 1.0_dp/6.0_dp*h3
953 s1d = -8.0_dp + 4.0_dp*e1 - 0.5_dp*e2
954 s2d = 10.0_dp - 8.0_dp*f1 + 1.5_dp*f2
955 s3d = -2.0_dp + 4.0_dp*g1 - 1.5_dp*g2
957 DO i = bo(1, 1), bo(2, 1)
960 ivec(1) = floor(vec(1)/pw%pw_grid%dr(1))
961 ii1 =
modulo(ivec(1) - 1, npts(1)) + 1
962 ii2 =
modulo(ivec(1), npts(1)) + 1
963 ii3 =
modulo(ivec(1) + 1, npts(1)) + 1
964 ii4 =
modulo(ivec(1) + 2, npts(1)) + 1
965 xd1 = (vec(1)/dr1) - real(ivec(1), kind=
dp)
978 t1o = 1.0_dp/6.0_dp*(64.0_dp - 48.0_dp*a1 + 12.0_dp*a2 - a3)
979 t2o = -22.0_dp/3.0_dp + 10.0_dp*b1 - 4.0_dp*b2 + 0.5_dp*b3
980 t3o = 2.0_dp/3.0_dp - 2.0_dp*c1 + 2.0_dp*c2 - 0.5_dp*c3
981 t4o = 1.0_dp/6.0_dp*d3
982 t1d = -8.0_dp + 4.0_dp*a1 - 0.5_dp*a2
983 t2d = 10.0_dp - 8.0_dp*b1 + 1.5_dp*b2
984 t3d = -2.0_dp + 4.0_dp*c1 - 1.5_dp*c2
1000 abc_x(1, 1) = grid2(ii1, ij1, ik1)*v1 + grid2(ii1, ij1, ik2)*v2 + grid2(ii1, ij1, ik3)*v3 + grid2(ii1, ij1, ik4)*v4
1001 abc_x(2, 1) = grid2(ii2, ij1, ik1)*v1 + grid2(ii2, ij1, ik2)*v2 + grid2(ii2, ij1, ik3)*v3 + grid2(ii2, ij1, ik4)*v4
1002 abc_x(3, 1) = grid2(ii3, ij1, ik1)*v1 + grid2(ii3, ij1, ik2)*v2 + grid2(ii3, ij1, ik3)*v3 + grid2(ii3, ij1, ik4)*v4
1003 abc_x(4, 1) = grid2(ii4, ij1, ik1)*v1 + grid2(ii4, ij1, ik2)*v2 + grid2(ii4, ij1, ik3)*v3 + grid2(ii4, ij1, ik4)*v4
1004 abc_x_y(1) = abc_x(1, 1)*t1 + abc_x(2, 1)*t2 + abc_x(3, 1)*t3 + abc_x(4, 1)*t4
1006 abc_x(1, 2) = grid2(ii1, ij2, ik1)*v1 + grid2(ii1, ij2, ik2)*v2 + grid2(ii1, ij2, ik3)*v3 + grid2(ii1, ij2, ik4)*v4
1007 abc_x(2, 2) = grid2(ii2, ij2, ik1)*v1 + grid2(ii2, ij2, ik2)*v2 + grid2(ii2, ij2, ik3)*v3 + grid2(ii2, ij2, ik4)*v4
1008 abc_x(3, 2) = grid2(ii3, ij2, ik1)*v1 + grid2(ii3, ij2, ik2)*v2 + grid2(ii3, ij2, ik3)*v3 + grid2(ii3, ij2, ik4)*v4
1009 abc_x(4, 2) = grid2(ii4, ij2, ik1)*v1 + grid2(ii4, ij2, ik2)*v2 + grid2(ii4, ij2, ik3)*v3 + grid2(ii4, ij2, ik4)*v4
1010 abc_x_y(2) = abc_x(1, 2)*t1 + abc_x(2, 2)*t2 + abc_x(3, 2)*t3 + abc_x(4, 2)*t4
1012 abc_x(1, 3) = grid2(ii1, ij3, ik1)*v1 + grid2(ii1, ij3, ik2)*v2 + grid2(ii1, ij3, ik3)*v3 + grid2(ii1, ij3, ik4)*v4
1013 abc_x(2, 3) = grid2(ii2, ij3, ik1)*v1 + grid2(ii2, ij3, ik2)*v2 + grid2(ii2, ij3, ik3)*v3 + grid2(ii2, ij3, ik4)*v4
1014 abc_x(3, 3) = grid2(ii3, ij3, ik1)*v1 + grid2(ii3, ij3, ik2)*v2 + grid2(ii3, ij3, ik3)*v3 + grid2(ii3, ij3, ik4)*v4
1015 abc_x(4, 3) = grid2(ii4, ij3, ik1)*v1 + grid2(ii4, ij3, ik2)*v2 + grid2(ii4, ij3, ik3)*v3 + grid2(ii4, ij3, ik4)*v4
1016 abc_x_y(3) = abc_x(1, 3)*t1 + abc_x(2, 3)*t2 + abc_x(3, 3)*t3 + abc_x(4, 3)*t4
1018 abc_x(1, 4) = grid2(ii1, ij4, ik1)*v1 + grid2(ii1, ij4, ik2)*v2 + grid2(ii1, ij4, ik3)*v3 + grid2(ii1, ij4, ik4)*v4
1019 abc_x(2, 4) = grid2(ii2, ij4, ik1)*v1 + grid2(ii2, ij4, ik2)*v2 + grid2(ii2, ij4, ik3)*v3 + grid2(ii2, ij4, ik4)*v4
1020 abc_x(3, 4) = grid2(ii3, ij4, ik1)*v1 + grid2(ii3, ij4, ik2)*v2 + grid2(ii3, ij4, ik3)*v3 + grid2(ii3, ij4, ik4)*v4
1021 abc_x(4, 4) = grid2(ii4, ij4, ik1)*v1 + grid2(ii4, ij4, ik2)*v2 + grid2(ii4, ij4, ik3)*v3 + grid2(ii4, ij4, ik4)*v4
1022 abc_x_y(4) = abc_x(1, 4)*t1 + abc_x(2, 4)*t2 + abc_x(3, 4)*t3 + abc_x(4, 4)*t4
1024 val(1) = abc_x_y(1)*s1 + abc_x_y(2)*s2 + abc_x_y(3)*s3 + abc_x_y(4)*s4
1035 abc_x_y(1) = abc_x(1, 1)*t1 + abc_x(2, 1)*t2 + abc_x(3, 1)*t3 + abc_x(4, 1)*t4
1036 abc_x_y(2) = abc_x(1, 2)*t1 + abc_x(2, 2)*t2 + abc_x(3, 2)*t3 + abc_x(4, 2)*t4
1037 abc_x_y(3) = abc_x(1, 3)*t1 + abc_x(2, 3)*t2 + abc_x(3, 3)*t3 + abc_x(4, 3)*t4
1038 abc_x_y(4) = abc_x(1, 4)*t1 + abc_x(2, 4)*t2 + abc_x(3, 4)*t3 + abc_x(4, 4)*t4
1040 val(2) = abc_x_y(1)*s1 + abc_x_y(2)*s2 + abc_x_y(3)*s3 + abc_x_y(4)*s4
1055 abc_x(1, 1) = grid2(ii1, ij1, ik1)*v1 + grid2(ii1, ij1, ik2)*v2 + grid2(ii1, ij1, ik3)*v3 + grid2(ii1, ij1, ik4)*v4
1056 abc_x(2, 1) = grid2(ii2, ij1, ik1)*v1 + grid2(ii2, ij1, ik2)*v2 + grid2(ii2, ij1, ik3)*v3 + grid2(ii2, ij1, ik4)*v4
1057 abc_x(3, 1) = grid2(ii3, ij1, ik1)*v1 + grid2(ii3, ij1, ik2)*v2 + grid2(ii3, ij1, ik3)*v3 + grid2(ii3, ij1, ik4)*v4
1058 abc_x(4, 1) = grid2(ii4, ij1, ik1)*v1 + grid2(ii4, ij1, ik2)*v2 + grid2(ii4, ij1, ik3)*v3 + grid2(ii4, ij1, ik4)*v4
1059 abc_x_y(1) = abc_x(1, 1)*t1 + abc_x(2, 1)*t2 + abc_x(3, 1)*t3 + abc_x(4, 1)*t4
1060 abc_x(1, 2) = grid2(ii1, ij2, ik1)*v1 + grid2(ii1, ij2, ik2)*v2 + grid2(ii1, ij2, ik3)*v3 + grid2(ii1, ij2, ik4)*v4
1061 abc_x(2, 2) = grid2(ii2, ij2, ik1)*v1 + grid2(ii2, ij2, ik2)*v2 + grid2(ii2, ij2, ik3)*v3 + grid2(ii2, ij2, ik4)*v4
1062 abc_x(3, 2) = grid2(ii3, ij2, ik1)*v1 + grid2(ii3, ij2, ik2)*v2 + grid2(ii3, ij2, ik3)*v3 + grid2(ii3, ij2, ik4)*v4
1063 abc_x(4, 2) = grid2(ii4, ij2, ik1)*v1 + grid2(ii4, ij2, ik2)*v2 + grid2(ii4, ij2, ik3)*v3 + grid2(ii4, ij2, ik4)*v4
1064 abc_x_y(2) = abc_x(1, 2)*t1 + abc_x(2, 2)*t2 + abc_x(3, 2)*t3 + abc_x(4, 2)*t4
1065 abc_x(1, 3) = grid2(ii1, ij3, ik1)*v1 + grid2(ii1, ij3, ik2)*v2 + grid2(ii1, ij3, ik3)*v3 + grid2(ii1, ij3, ik4)*v4
1066 abc_x(2, 3) = grid2(ii2, ij3, ik1)*v1 + grid2(ii2, ij3, ik2)*v2 + grid2(ii2, ij3, ik3)*v3 + grid2(ii2, ij3, ik4)*v4
1067 abc_x(3, 3) = grid2(ii3, ij3, ik1)*v1 + grid2(ii3, ij3, ik2)*v2 + grid2(ii3, ij3, ik3)*v3 + grid2(ii3, ij3, ik4)*v4
1068 abc_x(4, 3) = grid2(ii4, ij3, ik1)*v1 + grid2(ii4, ij3, ik2)*v2 + grid2(ii4, ij3, ik3)*v3 + grid2(ii4, ij3, ik4)*v4
1069 abc_x_y(3) = abc_x(1, 3)*t1 + abc_x(2, 3)*t2 + abc_x(3, 3)*t3 + abc_x(4, 3)*t4
1070 abc_x(1, 4) = grid2(ii1, ij4, ik1)*v1 + grid2(ii1, ij4, ik2)*v2 + grid2(ii1, ij4, ik3)*v3 + grid2(ii1, ij4, ik4)*v4
1071 abc_x(2, 4) = grid2(ii2, ij4, ik1)*v1 + grid2(ii2, ij4, ik2)*v2 + grid2(ii2, ij4, ik3)*v3 + grid2(ii2, ij4, ik4)*v4
1072 abc_x(3, 4) = grid2(ii3, ij4, ik1)*v1 + grid2(ii3, ij4, ik2)*v2 + grid2(ii3, ij4, ik3)*v3 + grid2(ii3, ij4, ik4)*v4
1073 abc_x(4, 4) = grid2(ii4, ij4, ik1)*v1 + grid2(ii4, ij4, ik2)*v2 + grid2(ii4, ij4, ik3)*v3 + grid2(ii4, ij4, ik4)*v4
1074 abc_x_y(4) = abc_x(1, 4)*t1 + abc_x(2, 4)*t2 + abc_x(3, 4)*t3 + abc_x(4, 4)*t4
1076 val(3) = abc_x_y(1)*s1 + abc_x_y(2)*s2 + abc_x_y(3)*s3 + abc_x_y(4)*s4
1079 ft1 = ft1 + val(1)*
fac
1080 ft2 = ft2 + val(2)*
fac
1081 ft3 = ft3 + val(3)*
fac
1088 lforces(1, lindmm) = ft1*qt
1089 lforces(2, lindmm) = ft2*qt
1090 lforces(3, lindmm) = ft3*qt
1092 forces(1, lindmm) = forces(1, lindmm) + lforces(1, lindmm)
1093 forces(2, lindmm) = forces(2, lindmm) + lforces(2, lindmm)
1094 forces(3, lindmm) = forces(3, lindmm) + lforces(3, lindmm)
1101 IF (debug_this_module)
THEN
1102 CALL debug_qmmm_forces_with_gauss_lg(pgfs=pgfs, &
1103 aug_pools=aug_pools, &
1105 num_mm_atoms=num_mm_atoms, &
1106 mm_charges=mm_charges, &
1107 mm_atom_index=mm_atom_index, &
1108 mm_particles=mm_particles, &
1109 coarser_grid_level=coarser_grid_level, &
1110 debug_force=lforces, &
1111 per_potentials=per_potentials, &
1112 para_env=para_env, &
1116 par_scheme=par_scheme, &
1117 qmmm_spherical_cutoff=qmmm_spherical_cutoff, &
1120 DEALLOCATE (lforces)
1121 CALL timestop(handle)
1122 END SUBROUTINE qmmm_forces_with_gaussian_lg
1149 SUBROUTINE qmmm_forces_with_gaussian_lr(pgfs, cgrid, num_mm_atoms, mm_charges, mm_atom_index, &
1150 mm_particles, para_env, coarser_grid_level, Forces, potentials, &
1151 aug_pools, mm_cell, dOmmOqm, iw, par_scheme, qmmm_spherical_cutoff, shells)
1154 INTEGER,
INTENT(IN) :: num_mm_atoms
1155 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mm_charges
1156 INTEGER,
DIMENSION(:),
POINTER :: mm_atom_index
1159 INTEGER,
INTENT(IN) :: coarser_grid_level
1160 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: forces
1164 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: dommoqm
1165 INTEGER,
INTENT(IN) :: iw, par_scheme
1166 REAL(kind=
dp),
DIMENSION(2),
INTENT(IN) :: qmmm_spherical_cutoff
1169 CHARACTER(len=*),
PARAMETER :: routinen =
'qmmm_forces_with_gaussian_LR'
1171 INTEGER :: handle, i, imm, indmm, iradtyp, ix, j, &
1172 k, lindmm, my_i, my_j, my_k, myind, &
1174 INTEGER,
DIMENSION(2, 3) :: bo, gbo
1175 REAL(kind=
dp) :: dr1, dr2, dr3, dvol, dx,
fac, ft1, ft2, &
1176 ft3, qt, r, r2, rd1, rd2, rd3, rt1, &
1177 rt2, rt3, rv1, rv2, rv3, rx, rx2, &
1178 sph_chrg_factor, term, xs1, xs2, xs3
1179 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: lforces
1180 REAL(kind=
dp),
DIMENSION(3) :: ra
1181 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: pot0_2
1182 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: grid
1185 CALL timeset(routinen, handle)
1186 ALLOCATE (lforces(3, num_mm_atoms))
1188 n1 = cgrid%pw_grid%npts(1)
1189 n2 = cgrid%pw_grid%npts(2)
1190 n3 = cgrid%pw_grid%npts(3)
1191 dr1 = cgrid%pw_grid%dr(1)
1192 dr2 = cgrid%pw_grid%dr(2)
1193 dr3 = cgrid%pw_grid%dr(3)
1194 dvol = cgrid%pw_grid%dvol
1195 gbo = cgrid%pw_grid%bounds
1196 bo = cgrid%pw_grid%bounds_local
1199 radius:
DO iradtyp = 1,
SIZE(pgfs)
1200 pot => potentials(iradtyp)%pot
1202 pot0_2 => pot%pot0_2
1210 atoms:
DO imm = 1,
SIZE(pot%mm_atom_index)
1212 myind = imm + (iradtyp - 1)*
SIZE(pot%mm_atom_index)
1213 IF (mod(myind, para_env%num_pe) /= para_env%mepos) cycle
1215 lindmm = pot%mm_atom_index(imm)
1216 indmm = mm_atom_index(lindmm)
1217 ra(:) =
pbc(mm_particles(indmm)%r - dommoqm, mm_cell) + dommoqm
1219 ra(:) =
pbc(mm_particles(lindmm)%r - dommoqm, mm_cell) + dommoqm
1220 qt = mm_charges(lindmm)
1222 IF (qmmm_spherical_cutoff(1) > 0.0_dp)
THEN
1224 qt = qt*sph_chrg_factor
1226 IF (abs(qt) <= epsilon(0.0_dp)) cycle atoms
1233 loopongrid:
DO k = bo(1, 3), bo(2, 3)
1234 my_k = k - gbo(1, 3)
1235 xs3 = real(my_k,
dp)*dr3
1236 my_j = bo(1, 2) - gbo(1, 2)
1237 xs2 = real(my_j,
dp)*dr2
1239 DO j = bo(1, 2), bo(2, 2)
1240 my_i = bo(1, 1) - gbo(1, 1)
1241 xs1 = real(my_i,
dp)*dr1
1243 DO i = bo(1, 1), bo(2, 1)
1245 r2 = rv1*rv1 + rv2*rv2 + rv3*rv3
1247 ix = floor(r/dx) + 1
1248 rx = (r - real(ix - 1,
dp)*dx)/dx
1250 term = pot0_2(1, ix)*(-6.0_dp*(rx - rx2)) &
1251 + pot0_2(2, ix)*(1.0_dp - 4.0_dp*rx + 3.0_dp*rx2) &
1252 + pot0_2(1, ix + 1)*(6.0_dp*(rx - rx2)) &
1253 + pot0_2(2, ix + 1)*(-2.0_dp*rx + 3.0_dp*rx2)
1254 fac = grid(i, j, k)*term
1255 IF (r == 0.0_dp)
THEN
1273 lforces(1, lindmm) = ft1*qt
1274 lforces(2, lindmm) = ft2*qt
1275 lforces(3, lindmm) = ft3*qt
1277 forces(1, lindmm) = forces(1, lindmm) + lforces(1, lindmm)
1278 forces(2, lindmm) = forces(2, lindmm) + lforces(2, lindmm)
1279 forces(3, lindmm) = forces(3, lindmm) + lforces(3, lindmm)
1286 IF (debug_this_module)
THEN
1287 CALL debug_qmmm_forces_with_gauss_lr(pgfs=pgfs, &
1288 aug_pools=aug_pools, &
1290 num_mm_atoms=num_mm_atoms, &
1291 mm_charges=mm_charges, &
1292 mm_atom_index=mm_atom_index, &
1293 mm_particles=mm_particles, &
1294 coarser_grid_level=coarser_grid_level, &
1295 debug_force=lforces, &
1296 potentials=potentials, &
1297 para_env=para_env, &
1301 par_scheme=par_scheme, &
1302 qmmm_spherical_cutoff=qmmm_spherical_cutoff, &
1306 DEALLOCATE (lforces)
1307 CALL timestop(handle)
1308 END SUBROUTINE qmmm_forces_with_gaussian_lr
1327 SUBROUTINE qmmm_debug_forces(rho, qs_env, qmmm_env, Analytical_Forces, &
1328 mm_particles, mm_atom_index, num_mm_atoms, &
1329 interp_section, mm_cell)
1333 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: analytical_forces
1335 INTEGER,
DIMENSION(:),
POINTER :: mm_atom_index
1336 INTEGER,
INTENT(IN) :: num_mm_atoms
1340 CHARACTER(len=*),
PARAMETER :: routinen =
'qmmm_debug_forces'
1342 INTEGER :: handle, i, indmm, iw, j, k
1343 REAL(kind=
dp) :: coord_save
1344 REAL(kind=
dp),
DIMENSION(2) :: energy
1345 REAL(kind=
dp),
DIMENSION(3) :: err
1346 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: num_forces
1355 CALL timeset(routinen, handle)
1356 NULLIFY (num_forces)
1359 input=input_section, &
1365 CALL pw_env_get(pw_env=pw_env, pw_pools=pw_pools)
1366 CALL pw_pools(1)%pool%create_pw(v_qmmm_rspace)
1367 ALLOCATE (num_forces(3, num_mm_atoms))
1368 ks_qmmm_env_loc => qs_env%ks_qmmm_env
1369 IF (iw > 0)
WRITE (iw,
'(/A)')
"DEBUG SECTION:"
1370 atoms:
DO i = 1, num_mm_atoms
1371 indmm = mm_atom_index(i)
1373 coord_save = mm_particles(indmm)%r(j)
1376 mm_particles(indmm)%r(j) = coord_save + (-1)**k*dx
1378 SELECT CASE (qmmm_env%qmmm_coupl_type)
1380 cpabort(
"Coulomb QM/MM electrostatic coupling not implemented for GPW/GAPW.")
1382 cpabort(
"Point Charge QM/MM electrostatic coupling not implemented for GPW/GAPW.")
1385 v_qmmm=v_qmmm_rspace, &
1386 mm_particles=mm_particles, &
1387 aug_pools=qmmm_env%aug_pools, &
1388 para_env=para_env, &
1389 eps_mm_rspace=qmmm_env%eps_mm_rspace, &
1390 cube_info=ks_qmmm_env_loc%cube_info, &
1391 pw_pools=pw_pools, &
1392 auxbas_grid=qmmm_env%gridlevel_info%auxbas_grid, &
1393 coarser_grid=qmmm_env%gridlevel_info%coarser_grid, &
1394 interp_section=interp_section, &
1399 IF (iw > 0)
WRITE (iw,
'(T3,A)')
"Unknown Coupling..."
1405 WRITE (iw,
'(A,I6,A,I3,A,2F15.9)') &
1406 "DEBUG :: MM Atom = ", indmm,
" Coord = ", j,
" Energies (+/-) :: ", energy(2), energy(1)
1408 num_forces(j, i) = (energy(2) - energy(1))/(2.0_dp*dx)
1409 mm_particles(indmm)%r(j) = coord_save
1413 SELECT CASE (qmmm_env%qmmm_coupl_type)
1415 cpabort(
"Coulomb QM/MM electrostatic coupling not implemented for GPW/GAPW.")
1417 cpabort(
"Point Charge QM/MM electrostatic coupling not implemented for GPW/GAPW.")
1419 IF (iw > 0)
WRITE (iw,
'(/A/)')
"CHECKING NUMERICAL Vs ANALYTICAL FORCES (Err%):"
1420 DO i = 1, num_mm_atoms
1421 indmm = mm_atom_index(i)
1424 IF (abs(num_forces(k, i)) >= 5.0e-5_dp)
THEN
1425 err(k) = (analytical_forces(k, i) - num_forces(k, i))/num_forces(k, i)*100.0_dp
1429 WRITE (iw, 100) indmm, analytical_forces(1, i), num_forces(1, i), err(1), &
1430 analytical_forces(2, i), num_forces(2, i), err(2), &
1431 analytical_forces(3, i), num_forces(3, i), err(3)
1432 cpassert(abs(err(1)) <= maxerr)
1433 cpassert(abs(err(2)) <= maxerr)
1434 cpassert(abs(err(3)) <= maxerr)
1437 IF (iw > 0)
WRITE (iw,
'(T3,A)')
"No QM/MM Derivatives to debug. Just Mechanical Coupling!"
1439 IF (iw > 0)
WRITE (iw,
'(T3,A)')
"Unknown Coupling..."
1444 CALL pw_pools(1)%pool%give_back_pw(v_qmmm_rspace)
1445 DEALLOCATE (num_forces)
1446 CALL timestop(handle)
1447100
FORMAT(i5, 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ")
1448 END SUBROUTINE qmmm_debug_forces
1469 SUBROUTINE debug_integrate_gf_rspace_nopbc(ilevel, zetp, rp, W, pwgrid, cube_info, &
1470 eps_mm_rspace, aug_pools, debug_force, &
1471 mm_cell, auxbas_grid, n_rep_real, iw)
1472 INTEGER,
INTENT(IN) :: ilevel
1473 REAL(kind=
dp),
INTENT(IN) :: zetp
1474 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: rp
1475 REAL(kind=
dp),
INTENT(IN) :: w
1478 REAL(kind=
dp),
INTENT(IN) :: eps_mm_rspace
1480 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: debug_force
1482 INTEGER,
INTENT(IN) :: auxbas_grid
1483 INTEGER,
DIMENSION(3),
INTENT(IN) :: n_rep_real
1484 INTEGER,
INTENT(IN) :: iw
1486 CHARACTER(len=*),
PARAMETER :: routinen =
'debug_integrate_gf_rspace_NoPBC'
1488 INTEGER :: handle, i, igrid, k, ngrids
1489 INTEGER,
DIMENSION(2, 3) :: bo2
1490 INTEGER,
SAVE :: icount
1491 REAL(kind=
dp),
DIMENSION(2) :: energy
1492 REAL(kind=
dp),
DIMENSION(3) :: err, force, myrp
1493 REAL(kind=
dp),
DIMENSION(:),
POINTER :: xdat, ydat, zdat
1498 CALL timeset(routinen, handle)
1500 ngrids =
SIZE(aug_pools)
1502 DO igrid = 1, ngrids
1505 bo2 = grids(auxbas_grid)%pw_grid%bounds
1506 ALLOCATE (xdat(bo2(1, 1):bo2(2, 1)))
1507 ALLOCATE (ydat(bo2(1, 2):bo2(2, 2)))
1508 ALLOCATE (zdat(bo2(1, 3):bo2(2, 3)))
1514 myrp(i) = myrp(i) + (-1.0_dp)**k*dx
1520 pwgrid=grids(ilevel), &
1521 cube_info=cube_info, &
1522 eps_mm_rspace=eps_mm_rspace, &
1527 n_rep_real=n_rep_real, &
1532 force(i) = (energy(2) - energy(1))/(2.0_dp*dx)
1535 IF (all(force /= 0.0_dp))
THEN
1536 err(1) = (debug_force(1) - force(1))/force(1)*100.0_dp
1537 err(2) = (debug_force(2) - force(2))/force(2)*100.0_dp
1538 err(3) = (debug_force(3) - force(3))/force(3)*100.0_dp
1541 WRITE (iw, 100) icount, debug_force(1), force(1), err(1), &
1542 debug_force(2), force(2), err(2), &
1543 debug_force(3), force(3), err(3)
1544 cpassert(abs(err(1)) <= maxerr)
1545 cpassert(abs(err(2)) <= maxerr)
1546 cpassert(abs(err(3)) <= maxerr)
1548 IF (
ASSOCIATED(xdat))
THEN
1551 IF (
ASSOCIATED(ydat))
THEN
1554 IF (
ASSOCIATED(zdat))
THEN
1559 CALL timestop(handle)
1560100
FORMAT(
"Collocation : ", i5, 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ")
1561 END SUBROUTINE debug_integrate_gf_rspace_nopbc
1586 SUBROUTINE debug_qmmm_forces_with_gauss_lg(pgfs, aug_pools, rho, mm_charges, mm_atom_index, &
1587 mm_particles, num_mm_atoms, coarser_grid_level, per_potentials, &
1588 debug_force, para_env, mm_cell, dOmmOqm, iw, par_scheme, qmmm_spherical_cutoff, shells)
1593 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mm_charges
1594 INTEGER,
DIMENSION(:),
POINTER :: mm_atom_index
1596 INTEGER,
INTENT(IN) :: num_mm_atoms, coarser_grid_level
1598 REAL(kind=
dp),
DIMENSION(:, :) :: debug_force
1601 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: dommoqm
1602 INTEGER,
INTENT(IN) :: iw, par_scheme
1603 REAL(kind=
dp),
DIMENSION(2),
INTENT(IN) :: qmmm_spherical_cutoff
1606 CHARACTER(len=*),
PARAMETER :: routinen =
'debug_qmmm_forces_with_gauss_LG'
1608 INTEGER :: handle, i, igrid, indmm, j, k, ngrids
1609 REAL(kind=
dp) :: coord_save
1610 REAL(kind=
dp),
DIMENSION(2) :: energy
1611 REAL(kind=
dp),
DIMENSION(3) :: err
1612 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: num_forces
1615 ALLOCATE (num_forces(3, num_mm_atoms))
1616 CALL timeset(routinen, handle)
1617 ngrids =
SIZE(aug_pools)
1619 DO igrid = 1, ngrids
1622 atoms:
DO i = 1, num_mm_atoms
1623 indmm = mm_atom_index(i)
1625 coord_save = mm_particles(indmm)%r(j)
1628 mm_particles(indmm)%r(j) = coord_save + (-1)**k*dx
1629 CALL pw_zero(grids(coarser_grid_level))
1632 cgrid=grids(coarser_grid_level), &
1633 mm_charges=mm_charges, &
1634 mm_atom_index=mm_atom_index, &
1635 mm_particles=mm_particles, &
1636 para_env=para_env, &
1637 per_potentials=per_potentials, &
1640 par_scheme=par_scheme, &
1641 qmmm_spherical_cutoff=qmmm_spherical_cutoff, &
1647 WRITE (iw,
'(A,I6,A,I3,A,2F15.9)') &
1648 "DEBUG LR:: MM Atom = ", indmm,
" Coord = ", j,
" Energies (+/-) :: ", energy(2), energy(1)
1649 num_forces(j, i) = (energy(2) - energy(1))/(2.0_dp*dx)
1650 mm_particles(indmm)%r(j) = coord_save
1654 DO i = 1, num_mm_atoms
1655 indmm = mm_atom_index(i)
1657 IF (all(num_forces /= 0.0_dp))
THEN
1658 err(1) = (debug_force(1, i) - num_forces(1, i))/num_forces(1, i)*100.0_dp
1659 err(2) = (debug_force(2, i) - num_forces(2, i))/num_forces(2, i)*100.0_dp
1660 err(3) = (debug_force(3, i) - num_forces(3, i))/num_forces(3, i)*100.0_dp
1663 WRITE (iw, 100) indmm, debug_force(1, i), num_forces(1, i), err(1), &
1664 debug_force(2, i), num_forces(2, i), err(2), &
1665 debug_force(3, i), num_forces(3, i), err(3)
1666 cpassert(abs(err(1)) <= maxerr)
1667 cpassert(abs(err(2)) <= maxerr)
1668 cpassert(abs(err(3)) <= maxerr)
1671 DEALLOCATE (num_forces)
1673 CALL timestop(handle)
1674100
FORMAT(
"MM Atom LR : ", i5, 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ")
1675 END SUBROUTINE debug_qmmm_forces_with_gauss_lg
1700 SUBROUTINE debug_qmmm_forces_with_gauss_lr(pgfs, aug_pools, rho, mm_charges, mm_atom_index, &
1701 mm_particles, num_mm_atoms, coarser_grid_level, potentials, &
1702 debug_force, para_env, mm_cell, dOmmOqm, iw, par_scheme, qmmm_spherical_cutoff, shells)
1707 REAL(kind=
dp),
DIMENSION(:),
POINTER :: mm_charges
1708 INTEGER,
DIMENSION(:),
POINTER :: mm_atom_index
1710 INTEGER,
INTENT(IN) :: num_mm_atoms, coarser_grid_level
1712 REAL(kind=
dp),
DIMENSION(:, :) :: debug_force
1715 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: dommoqm
1716 INTEGER,
INTENT(IN) :: iw, par_scheme
1717 REAL(kind=
dp),
DIMENSION(2),
INTENT(IN) :: qmmm_spherical_cutoff
1720 CHARACTER(len=*),
PARAMETER :: routinen =
'debug_qmmm_forces_with_gauss_LR'
1722 INTEGER :: handle, i, igrid, indmm, j, k, ngrids
1723 REAL(kind=
dp) :: coord_save
1724 REAL(kind=
dp),
DIMENSION(2) :: energy
1725 REAL(kind=
dp),
DIMENSION(3) :: err
1726 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: num_forces
1729 ALLOCATE (num_forces(3, num_mm_atoms))
1730 CALL timeset(routinen, handle)
1731 ngrids =
SIZE(aug_pools)
1733 DO igrid = 1, ngrids
1736 atoms:
DO i = 1, num_mm_atoms
1737 indmm = mm_atom_index(i)
1739 coord_save = mm_particles(indmm)%r(j)
1742 mm_particles(indmm)%r(j) = coord_save + (-1)**k*dx
1743 CALL pw_zero(grids(coarser_grid_level))
1746 grid=grids(coarser_grid_level), &
1747 mm_charges=mm_charges, &
1748 mm_atom_index=mm_atom_index, &
1749 mm_particles=mm_particles, &
1750 para_env=para_env, &
1751 potentials=potentials, &
1754 par_scheme=par_scheme, &
1755 qmmm_spherical_cutoff=qmmm_spherical_cutoff, &
1761 WRITE (iw,
'(A,I6,A,I3,A,2F15.9)') &
1762 "DEBUG LR:: MM Atom = ", indmm,
" Coord = ", j,
" Energies (+/-) :: ", energy(2), energy(1)
1763 num_forces(j, i) = (energy(2) - energy(1))/(2.0_dp*dx)
1764 mm_particles(indmm)%r(j) = coord_save
1768 DO i = 1, num_mm_atoms
1769 indmm = mm_atom_index(i)
1771 IF (all(num_forces(:, i) /= 0.0_dp))
THEN
1772 err(1) = (debug_force(1, i) - num_forces(1, i))/num_forces(1, i)*100.0_dp
1773 err(2) = (debug_force(2, i) - num_forces(2, i))/num_forces(2, i)*100.0_dp
1774 err(3) = (debug_force(3, i) - num_forces(3, i))/num_forces(3, i)*100.0_dp
1777 WRITE (iw, 100) indmm, debug_force(1, i), num_forces(1, i), err(1), &
1778 debug_force(2, i), num_forces(2, i), err(2), &
1779 debug_force(3, i), num_forces(3, i), err(3)
1780 cpassert(abs(err(1)) <= maxerr)
1781 cpassert(abs(err(2)) <= maxerr)
1782 cpassert(abs(err(3)) <= maxerr)
1785 DEALLOCATE (num_forces)
1787 CALL timestop(handle)
1788100
FORMAT(
"MM Atom LR : ", i5, 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ", 2f15.9,
" ( ", f7.2,
" ) ")
1789 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(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, 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, 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, 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.