78#include "./base/base_uses.f90"
84 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .false.
86 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_integrate_potential_single'
111 CHARACTER(len=*),
PARAMETER :: routinen =
'integrate_ppl_rspace'
113 INTEGER :: atom_a, handle, iatom, ikind, j, lppl, &
114 n, natom_of_kind, ni, npme
115 INTEGER,
DIMENSION(:),
POINTER :: atom_list, cores
116 LOGICAL :: use_virial
117 REAL(kind=
dp) :: alpha, eps_rho_rspace, radius
118 REAL(kind=
dp),
DIMENSION(3) :: force_a, force_b, ra
119 REAL(kind=
dp),
DIMENSION(3, 3) :: my_virial_a, my_virial_b
120 REAL(kind=
dp),
DIMENSION(:),
POINTER :: cexp_ppl
121 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: hab, pab
129 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
133 CALL timeset(routinen, handle)
135 NULLIFY (pw_env, cores)
138 CALL pw_env_get(pw_env=pw_env, auxbas_rs_grid=rs_v)
143 atomic_kind_set=atomic_kind_set, &
144 qs_kind_set=qs_kind_set, &
146 dft_control=dft_control, &
147 particle_set=particle_set, &
149 force=force, virial=virial)
151 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
153 eps_rho_rspace = dft_control%qs_control%eps_rho_rspace
155 DO ikind = 1,
SIZE(atomic_kind_set)
157 CALL get_atomic_kind(atomic_kind_set(ikind), natom=natom_of_kind, atom_list=atom_list)
158 CALL get_qs_kind(qs_kind_set(ikind), gth_potential=gth_potential)
160 IF (.NOT.
ASSOCIATED(gth_potential)) cycle
161 CALL get_potential(potential=gth_potential, alpha_ppl=alpha, nexp_ppl=lppl, cexp_ppl=cexp_ppl)
166 ALLOCATE (hab(ni, 1), pab(ni, 1))
177 pab(1, 1) = cexp_ppl(1)
180 pab(n, 1) = cexp_ppl(2)
182 pab(n, 1) = cexp_ppl(2)
184 pab(n, 1) = cexp_ppl(2)
187 pab(n, 1) = cexp_ppl(3)
189 pab(n, 1) = cexp_ppl(3)
191 pab(n, 1) = cexp_ppl(3)
193 pab(n, 1) = 2._dp*cexp_ppl(3)
195 pab(n, 1) = 2._dp*cexp_ppl(3)
197 pab(n, 1) = 2._dp*cexp_ppl(3)
200 pab(n, 1) = cexp_ppl(4)
202 pab(n, 1) = cexp_ppl(4)
204 pab(n, 1) = cexp_ppl(4)
206 pab(n, 1) = 3._dp*cexp_ppl(4)
208 pab(n, 1) = 3._dp*cexp_ppl(4)
210 pab(n, 1) = 3._dp*cexp_ppl(4)
212 pab(n, 1) = 3._dp*cexp_ppl(4)
214 pab(n, 1) = 3._dp*cexp_ppl(4)
216 pab(n, 1) = 3._dp*cexp_ppl(4)
218 pab(n, 1) = 6._dp*cexp_ppl(4)
220 CALL cp_abort(__location__, &
221 "Only 1, 2, 3, 4 are supported as the "// &
222 "value of j in integrate_ppl_rspace")
226 DO iatom = 1, natom_of_kind
227 atom_a = atom_list(iatom)
228 ra(:) =
pbc(particle_set(atom_a)%r, cell)
229 IF (rs_v%desc%parallel .AND. .NOT. rs_v%desc%distributed)
THEN
231 IF (
modulo(iatom, rs_v%desc%group_size) == rs_v%desc%my_pos)
THEN
244 atom_a = atom_list(iatom)
245 ra(:) =
pbc(particle_set(atom_a)%r, cell)
256 ra=ra, rb=ra, rp=ra, &
257 zetp=alpha, eps=eps_rho_rspace, &
258 pab=pab, o1=0, o2=0, &
259 prefactor=1.0_dp, cutoff=1.0_dp)
262 0, 0.0_dp, 0, ra, [0.0_dp, 0.0_dp, 0.0_dp], &
263 rs_v, hab, pab=pab, o1=0, o2=0, &
265 calculate_forces=.true., force_a=force_a, &
266 force_b=force_b, use_virial=use_virial, my_virial_a=my_virial_a, &
267 my_virial_b=my_virial_b, use_subpatch=.true., subpatch_pattern=0)
269 force(ikind)%gth_ppl(:, iatom) = &
270 force(ikind)%gth_ppl(:, iatom) + force_a(:)*rho_rspace%pw_grid%dvol
273 virial%pv_ppl = virial%pv_ppl + my_virial_a*rho_rspace%pw_grid%dvol
274 virial%pv_virial = virial%pv_virial + my_virial_a*rho_rspace%pw_grid%dvol
275 cpabort(
"Virial not debuged for CORE_PPL")
279 DEALLOCATE (hab, pab)
285 CALL timestop(handle)
300 LOGICAL,
INTENT(IN),
OPTIONAL :: debug_forces, debug_stress
301 CHARACTER(len=*),
OPTIONAL :: iotag
303 CHARACTER(len=*),
PARAMETER :: routinen =
'integrate_rho_nlcc'
305 CHARACTER(len=30) :: ftag, stag
306 INTEGER :: atom_a, handle, iatom, iexp_nlcc, ikind, &
307 iounit, j, n, natom, nc, nexp_nlcc, &
309 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: nct_nlcc
310 INTEGER,
DIMENSION(:),
POINTER :: atom_list, cores
311 LOGICAL :: debfor, debstr, use_virial
312 REAL(kind=
dp) :: alpha, eps_rho_rspace, fconv, radius
313 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: alpha_nlcc
314 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: cval_nlcc
315 REAL(kind=
dp),
DIMENSION(3) :: fodeb, force_a, force_b, ra
316 REAL(kind=
dp),
DIMENSION(3, 3) :: my_virial_a, my_virial_b, stdeb
317 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: hab, pab
326 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
330 CALL timeset(routinen, handle)
333 IF (logger%para_env%is_source())
THEN
339 NULLIFY (pw_env, cores)
342 CALL pw_env_get(pw_env=pw_env, auxbas_rs_grid=rs_v)
347 atomic_kind_set=atomic_kind_set, &
348 qs_kind_set=qs_kind_set, &
350 dft_control=dft_control, &
351 particle_set=particle_set, &
354 force=force, virial=virial)
356 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
359 IF (
PRESENT(debug_forces)) debfor = debug_forces
361 IF (
PRESENT(debug_stress)) debstr = debug_stress
362 debstr = debstr .AND. use_virial
364 fconv = 1.0e-9_dp*
pascal/cell%deth
366 IF (
PRESENT(iotag))
THEN
367 ftag =
"DEBUG :: "//adjustl(iotag)
368 stag =
"STRESS| INT "//adjustl(iotag)
370 ftag =
"DEBUG :: dnlcc*V(r) "
371 stag =
"STRESS| INT dnlcc*V(r) "
374 IF (debfor) fodeb(1:3) = force(1)%gth_nlcc(1:3, 1)
375 IF (debstr) stdeb = virial%pv_nlcc
377 eps_rho_rspace = dft_control%qs_control%eps_rho_rspace
379 DO ikind = 1,
SIZE(atomic_kind_set)
381 CALL get_atomic_kind(atomic_kind_set(ikind), natom=natom, atom_list=atom_list)
383 nexp_nlcc =
SIZE(alpha_nlcc)
385 DO iexp_nlcc = 1, nexp_nlcc
387 alpha = alpha_nlcc(iexp_nlcc)
388 nc = nct_nlcc(iexp_nlcc)
392 ALLOCATE (hab(ni, 1), pab(ni, 1))
403 pab(1, 1) = cval_nlcc(1, iexp_nlcc)
406 pab(n, 1) = cval_nlcc(2, iexp_nlcc)/alpha**2
408 pab(n, 1) = cval_nlcc(2, iexp_nlcc)/alpha**2
410 pab(n, 1) = cval_nlcc(2, iexp_nlcc)/alpha**2
413 pab(n, 1) = cval_nlcc(3, iexp_nlcc)/alpha**4
415 pab(n, 1) = cval_nlcc(3, iexp_nlcc)/alpha**4
417 pab(n, 1) = cval_nlcc(3, iexp_nlcc)/alpha**4
419 pab(n, 1) = 2._dp*cval_nlcc(3, iexp_nlcc)/alpha**4
421 pab(n, 1) = 2._dp*cval_nlcc(3, iexp_nlcc)/alpha**4
423 pab(n, 1) = 2._dp*cval_nlcc(3, iexp_nlcc)/alpha**4
426 pab(n, 1) = cval_nlcc(4, iexp_nlcc)/alpha**6
428 pab(n, 1) = cval_nlcc(4, iexp_nlcc)/alpha**6
430 pab(n, 1) = cval_nlcc(4, iexp_nlcc)/alpha**6
432 pab(n, 1) = 3._dp*cval_nlcc(4, iexp_nlcc)/alpha**6
434 pab(n, 1) = 3._dp*cval_nlcc(4, iexp_nlcc)/alpha**6
436 pab(n, 1) = 3._dp*cval_nlcc(4, iexp_nlcc)/alpha**6
438 pab(n, 1) = 3._dp*cval_nlcc(4, iexp_nlcc)/alpha**6
440 pab(n, 1) = 3._dp*cval_nlcc(4, iexp_nlcc)/alpha**6
442 pab(n, 1) = 3._dp*cval_nlcc(4, iexp_nlcc)/alpha**6
444 pab(n, 1) = 6._dp*cval_nlcc(4, iexp_nlcc)/alpha**6
446 CALL cp_abort(__location__, &
447 "Only 1, 2, 3, 4 are supported as the "// &
448 "value of j in integrate_rho_nlcc")
451 IF (dft_control%nspins == 2) pab = pab*0.5_dp
454 atom_a = atom_list(iatom)
455 ra(:) =
pbc(particle_set(atom_a)%r, cell)
456 IF (rs_v%desc%parallel .AND. .NOT. rs_v%desc%distributed)
THEN
458 IF (
modulo(iatom, rs_v%desc%group_size) == rs_v%desc%my_pos)
THEN
471 atom_a = atom_list(iatom)
472 ra(:) =
pbc(particle_set(atom_a)%r, cell)
483 ra=ra, rb=ra, rp=ra, &
484 zetp=1/(2*alpha**2), eps=eps_rho_rspace, &
485 pab=pab, o1=0, o2=0, &
486 prefactor=1.0_dp, cutoff=1.0_dp)
489 0, 0.0_dp, 0, ra, [0.0_dp, 0.0_dp, 0.0_dp], &
490 rs_v, hab, pab=pab, o1=0, o2=0, &
492 calculate_forces=.true., force_a=force_a, &
493 force_b=force_b, use_virial=use_virial, my_virial_a=my_virial_a, &
494 my_virial_b=my_virial_b, use_subpatch=.true., subpatch_pattern=0)
496 force(ikind)%gth_nlcc(:, iatom) = &
497 force(ikind)%gth_nlcc(:, iatom) + force_a(:)*rho_rspace%pw_grid%dvol
500 virial%pv_nlcc = virial%pv_nlcc + my_virial_a*rho_rspace%pw_grid%dvol
501 virial%pv_virial = virial%pv_virial + my_virial_a*rho_rspace%pw_grid%dvol
505 DEALLOCATE (hab, pab)
511 IF (
ASSOCIATED(cores))
DEALLOCATE (cores)
514 fodeb(1:3) = force(1)%gth_nlcc(1:3, 1) - fodeb(1:3)
515 CALL para_env%sum(fodeb)
516 IF (iounit > 0)
WRITE (iounit,
"(T3,A,T33,3F16.8)") trim(ftag), fodeb
519 stdeb = fconv*(virial%pv_nlcc - stdeb)
520 CALL para_env%sum(stdeb)
521 IF (iounit > 0)
WRITE (unit=iounit, fmt=
"(T2,A,T41,2(1X,ES19.11))") &
525 CALL timestop(handle)
541 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL :: atecc, calpha, ccore
543 CHARACTER(len=*),
PARAMETER :: routinen =
'integrate_v_core_rspace'
545 INTEGER :: atom_a, handle, iatom, ikind, j, natom, &
547 INTEGER,
DIMENSION(:),
POINTER :: atom_list, cores
548 LOGICAL :: paw_atom, skip_fcore, use_virial
549 REAL(kind=
dp) :: alpha_core_charge, ccore_charge, &
550 eps_rho_rspace, radius
551 REAL(kind=
dp),
DIMENSION(3) :: force_a, force_b, ra
552 REAL(kind=
dp),
DIMENSION(3, 3) :: my_virial_a, my_virial_b
553 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: hab, pab
561 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
565 CALL timeset(routinen, handle)
566 NULLIFY (virial, force, atprop, dft_control)
567 IF (
PRESENT(calpha))
THEN
568 cpassert(
PRESENT(ccore))
571 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control)
576 IF (dft_control%qs_control%gapw .AND. (.NOT.
PRESENT(calpha)))
THEN
577 IF (.NOT. dft_control%qs_control%gapw_control%nopaw_as_gpw) skip_fcore = .true.
580 IF (.NOT. skip_fcore)
THEN
587 CALL pw_env_get(pw_env=pw_env, auxbas_rs_grid=rs_v)
592 atomic_kind_set=atomic_kind_set, &
593 qs_kind_set=qs_kind_set, &
595 dft_control=dft_control, &
596 particle_set=particle_set, &
603 natom =
SIZE(particle_set)
604 IF (
ASSOCIATED(atprop))
THEN
608 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
610 eps_rho_rspace = dft_control%qs_control%eps_rho_rspace
612 DO ikind = 1,
SIZE(atomic_kind_set)
614 CALL get_atomic_kind(atomic_kind_set(ikind), natom=natom_of_kind, atom_list=atom_list)
615 CALL get_qs_kind(qs_kind_set(ikind), paw_atom=paw_atom)
617 IF (dft_control%qs_control%gapw .AND. paw_atom .AND. (.NOT.
PRESENT(calpha))) cycle
619 IF (
PRESENT(calpha))
THEN
621 alpha_core_charge = calpha(ikind)
622 ccore_charge = ccore(ikind)
624 CALL get_qs_kind(qs_kind_set(ikind), alpha_core_charge=alpha_core_charge, &
625 ccore_charge=ccore_charge)
628 pab(1, 1) = -ccore_charge
629 IF (alpha_core_charge == 0.0_dp .OR. pab(1, 1) == 0.0_dp) cycle
635 DO iatom = 1, natom_of_kind
636 atom_a = atom_list(iatom)
637 ra(:) =
pbc(particle_set(atom_a)%r, cell)
638 IF (rs_v%desc%parallel .AND. .NOT. rs_v%desc%distributed)
THEN
640 IF (
modulo(iatom, rs_v%desc%group_size) == rs_v%desc%my_pos)
THEN
653 atom_a = atom_list(iatom)
654 ra(:) =
pbc(particle_set(atom_a)%r, cell)
664 ra=ra, rb=ra, rp=ra, &
665 zetp=alpha_core_charge, eps=eps_rho_rspace, &
666 pab=pab, o1=0, o2=0, &
667 prefactor=1.0_dp, cutoff=1.0_dp)
670 0, 0.0_dp, 0, ra, [0.0_dp, 0.0_dp, 0.0_dp], &
671 rs_v, hab, pab=pab, o1=0, o2=0, &
673 calculate_forces=.true., force_a=force_a, &
674 force_b=force_b, use_virial=use_virial, my_virial_a=my_virial_a, &
675 my_virial_b=my_virial_b, use_subpatch=.true., subpatch_pattern=0)
677 IF (
ASSOCIATED(force))
THEN
678 force(ikind)%rho_core(:, iatom) = force(ikind)%rho_core(:, iatom) + force_a(:)
681 virial%pv_ehartree = virial%pv_ehartree + my_virial_a
682 virial%pv_virial = virial%pv_virial + my_virial_a
684 IF (
ASSOCIATED(atprop) .AND. (.NOT.
PRESENT(calpha)))
THEN
685 atprop%ateb(atom_a) = atprop%ateb(atom_a) + 0.5_dp*hab(1, 1)*pab(1, 1)
687 IF (
PRESENT(atecc))
THEN
688 atecc(atom_a) = atecc(atom_a) + 0.5_dp*hab(1, 1)*pab(1, 1)
695 DEALLOCATE (hab, pab, cores)
699 CALL timestop(handle)
714 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: alpha, ccore
715 REAL(kind=
dp),
DIMENSION(:) :: atecc
717 CHARACTER(len=*),
PARAMETER :: routinen =
'integrate_v_gaussian_rspace'
719 INTEGER :: atom_a, handle, iatom, ikind, j, natom, &
721 INTEGER,
DIMENSION(:),
POINTER :: atom_list, cores
722 REAL(kind=
dp) :: alpha_core_charge, eps_rho_rspace, radius
723 REAL(kind=
dp),
DIMENSION(3) :: ra
724 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: hab, pab
730 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
733 CALL timeset(routinen, handle)
735 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control)
738 cpassert(.NOT. dft_control%qs_control%gapw)
746 CALL pw_env_get(pw_env=pw_env, auxbas_rs_grid=rs_v)
751 atomic_kind_set=atomic_kind_set, &
752 qs_kind_set=qs_kind_set, &
754 dft_control=dft_control, &
755 particle_set=particle_set, &
759 natom =
SIZE(particle_set)
760 eps_rho_rspace = dft_control%qs_control%eps_rho_rspace
762 DO ikind = 1,
SIZE(atomic_kind_set)
764 CALL get_atomic_kind(atomic_kind_set(ikind), natom=natom_of_kind, atom_list=atom_list)
765 pab(1, 1) = -ccore(ikind)
766 alpha_core_charge = alpha(ikind)
767 IF (alpha_core_charge == 0.0_dp .OR. pab(1, 1) == 0.0_dp) cycle
773 DO iatom = 1, natom_of_kind
774 atom_a = atom_list(iatom)
775 ra(:) =
pbc(particle_set(atom_a)%r, cell)
776 IF (rs_v%desc%parallel .AND. .NOT. rs_v%desc%distributed)
THEN
778 IF (
modulo(iatom, rs_v%desc%group_size) == rs_v%desc%my_pos)
THEN
791 atom_a = atom_list(iatom)
792 ra(:) =
pbc(particle_set(atom_a)%r, cell)
796 ra=ra, rb=ra, rp=ra, &
797 zetp=alpha_core_charge, eps=eps_rho_rspace, &
798 pab=pab, o1=0, o2=0, &
799 prefactor=1.0_dp, cutoff=1.0_dp)
802 0, 0.0_dp, 0, ra, [0.0_dp, 0.0_dp, 0.0_dp], &
803 rs_v, hab, pab=pab, o1=0, o2=0, &
804 radius=radius, calculate_forces=.false., &
805 use_subpatch=.true., subpatch_pattern=0)
806 atecc(atom_a) = atecc(atom_a) + 0.5_dp*hab(1, 1)*pab(1, 1)
812 DEALLOCATE (hab, pab, cores)
814 CALL timestop(handle)
829 calculate_forces, basis_type, atomlist)
833 LOGICAL,
INTENT(IN) :: calculate_forces
834 CHARACTER(len=*),
INTENT(IN) :: basis_type
835 INTEGER,
DIMENSION(:),
OPTIONAL :: atomlist
837 CHARACTER(len=*),
PARAMETER :: routinen =
'integrate_v_rspace_one_center'
839 INTEGER :: atom_a, group_size, handle, i, iatom, igrid_level, ikind, ipgf, iset, m1, &
840 max_npgf, maxco, maxsgf_set, my_pos, na1, natom_of_kind, ncoa, nkind, nseta, offset, sgfa
841 INTEGER,
DIMENSION(:),
POINTER :: atom_list, la_max, la_min, npgfa, &
843 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgfa
844 LOGICAL :: use_virial
845 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: map_it
846 REAL(kind=
dp) :: eps_rho_rspace, radius
847 REAL(kind=
dp),
DIMENSION(3) :: force_a, force_b, ra
848 REAL(kind=
dp),
DIMENSION(3, 3) :: my_virial_a, my_virial_b
849 REAL(kind=
dp),
DIMENSION(:),
POINTER :: set_radius_a
850 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: hab, pab, rpgfa, sphi_a, work_f, work_i, &
859 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
864 CALL timeset(routinen, handle)
866 NULLIFY (atomic_kind_set, qs_kind_set, atom_list, cell, dft_control, &
867 first_sgfa, gridlevel_info, hab, la_max, la_min, lri_basis_set, &
868 npgfa, nsgf_seta, pab, particle_set, pw_env, rpgfa, &
869 rs_grid, rs_v, virial, set_radius_a, sphi_a, work_f, &
879 gridlevel_info => pw_env%gridlevel_info
884 atomic_kind_set=atomic_kind_set, &
885 qs_kind_set=qs_kind_set, &
887 dft_control=dft_control, &
889 particle_set=particle_set, &
893 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
895 eps_rho_rspace = dft_control%qs_control%eps_rho_rspace
898 my_pos = v_rspace%pw_grid%para%group%mepos
899 group_size = v_rspace%pw_grid%para%group%num_pe
903 CALL get_atomic_kind(atomic_kind_set(ikind), natom=natom_of_kind, atom_list=atom_list)
904 CALL get_qs_kind(qs_kind_set(ikind), basis_set=lri_basis_set, basis_type=basis_type)
906 first_sgf=first_sgfa, &
910 maxsgf_set=maxsgf_set, &
913 nsgf_set=nsgf_seta, &
915 set_radius=set_radius_a, &
919 ALLOCATE (hab(maxco, 1), pab(maxco, 1))
922 max_npgf = maxval(npgfa(1:nseta))
923 ALLOCATE (map_it(max_npgf))
924 ALLOCATE (work_i(maxsgf_set, 1))
925 IF (calculate_forces)
ALLOCATE (work_f(maxsgf_set, 1))
927 DO iatom = 1, natom_of_kind
929 atom_a = atom_list(iatom)
930 IF (
PRESENT(atomlist))
THEN
931 IF (atomlist(atom_a) == 0) cycle
933 ra(:) =
pbc(particle_set(atom_a)%r, cell)
936 my_virial_a(:, :) = 0._dp
937 my_virial_b(:, :) = 0._dp
942 DO ipgf = 1, npgfa(iset)
944 rs_grid => rs_v(igrid_level)
945 map_it(ipgf) =
map_gaussian_here(rs_grid, cell%h_inv, ra, offset, group_size, my_pos)
949 IF (any(map_it(1:npgfa(iset))))
THEN
950 sgfa = first_sgfa(1, iset)
951 ncoa = npgfa(iset)*
ncoset(la_max(iset))
953 work_i(1:nsgf_seta(iset), 1) = 0.0_dp
956 IF (calculate_forces)
THEN
957 m1 = sgfa + nsgf_seta(iset) - 1
958 work_f(1:nsgf_seta(iset), 1) = int_res(ikind)%acoef(iatom, sgfa:m1)
959 CALL dgemm(
"N",
"N", ncoa, 1, nsgf_seta(iset), 1.0_dp, sphi_a(1, sgfa), &
960 SIZE(sphi_a, 1), work_f(1, 1),
SIZE(work_f, 1), 0.0_dp, pab(1, 1), &
964 DO ipgf = 1, npgfa(iset)
965 na1 = (ipgf - 1)*
ncoset(la_max(iset))
967 rs_grid => rs_v(igrid_level)
970 lb_min=0, lb_max=0, ra=ra, rb=ra, rp=ra, &
971 zetp=zeta(ipgf, iset), eps=eps_rho_rspace, &
972 prefactor=1.0_dp, cutoff=1.0_dp)
974 IF (map_it(ipgf))
THEN
975 IF (.NOT. calculate_forces)
THEN
977 zeta=zeta(ipgf, iset), la_min=la_min(iset), &
978 lb_max=0, zetb=0.0_dp, lb_min=0, &
979 ra=ra, rab=[0.0_dp, 0.0_dp, 0.0_dp], &
981 hab=hab, o1=na1, o2=0, radius=radius, &
982 calculate_forces=calculate_forces)
985 zeta=zeta(ipgf, iset), la_min=la_min(iset), &
986 lb_max=0, zetb=0.0_dp, lb_min=0, &
987 ra=ra, rab=[0.0_dp, 0.0_dp, 0.0_dp], &
989 hab=hab, pab=pab, o1=na1, o2=0, radius=radius, &
990 calculate_forces=calculate_forces, &
991 force_a=force_a, force_b=force_b, &
992 use_virial=use_virial, &
993 my_virial_a=my_virial_a, my_virial_b=my_virial_b)
998 CALL dgemm(
"T",
"N", nsgf_seta(iset), 1, ncoa, 1.0_dp, sphi_a(1, sgfa), &
999 SIZE(sphi_a, 1), hab(1, 1),
SIZE(hab, 1), 0.0_dp, work_i(1, 1),
SIZE(work_i, 1))
1001 int_res(ikind)%v_int(iatom, sgfa:sgfa - 1 + nsgf_seta(iset)) = &
1002 int_res(ikind)%v_int(iatom, sgfa:sgfa - 1 + nsgf_seta(iset)) + work_i(1:nsgf_seta(iset), 1)
1006 IF (calculate_forces)
THEN
1007 int_res(ikind)%v_dfdr(iatom, :) = int_res(ikind)%v_dfdr(iatom, :) + force_a(:)
1008 IF (use_virial)
THEN
1009 virial%pv_lrigpw = virial%pv_lrigpw + my_virial_a
1010 virial%pv_virial = virial%pv_virial + my_virial_a
1016 IF (calculate_forces)
DEALLOCATE (work_f)
1017 DEALLOCATE (work_i, map_it)
1018 DEALLOCATE (hab, pab)
1021 CALL timestop(handle)
1038 TYPE(
dbcsr_type),
INTENT(INOUT) :: ksmat, pmat
1040 LOGICAL,
INTENT(IN) :: calculate_forces
1041 CHARACTER(len=*),
INTENT(IN) :: basis_type
1043 CHARACTER(len=*),
PARAMETER :: routinen =
'integrate_v_rspace_diagonal'
1045 INTEGER :: atom_a, group_size, handle, iatom, igrid_level, ikind, ipgf, iset, jpgf, jset, &
1046 m1, maxco, maxsgf_set, my_pos, na1, na2, natom_of_kind, nb1, nb2, ncoa, ncob, nkind, &
1047 nseta, nsgfa, offset, sgfa, sgfb
1048 INTEGER,
DIMENSION(:),
POINTER :: atom_list, la_max, la_min, npgfa, &
1050 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgfa
1051 LOGICAL :: found, use_virial
1052 LOGICAL,
ALLOCATABLE,
DIMENSION(:, :) :: map_it2
1053 REAL(kind=
dp) :: eps_rho_rspace, radius, zetp
1054 REAL(kind=
dp),
DIMENSION(3) :: force_a, force_b, ra
1055 REAL(kind=
dp),
DIMENSION(3, 3) :: my_virial_a, my_virial_b
1056 REAL(kind=
dp),
DIMENSION(:),
POINTER :: set_radius_a
1057 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: h_block, hab, hmat, p_block, pab, pblk, &
1058 rpgfa, sphi_a, work, zeta
1068 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1073 CALL timeset(routinen, handle)
1075 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env)
1079 gridlevel_info => pw_env%gridlevel_info
1082 atomic_kind_set=atomic_kind_set, &
1083 qs_kind_set=qs_kind_set, &
1085 dft_control=dft_control, &
1087 particle_set=particle_set, &
1092 eps_rho_rspace = dft_control%qs_control%eps_rho_rspace
1093 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
1096 my_pos = v_rspace%pw_grid%para%group%mepos
1097 group_size = v_rspace%pw_grid%para%group%num_pe
1101 CALL get_atomic_kind(atomic_kind_set(ikind), natom=natom_of_kind, atom_list=atom_list)
1102 CALL get_qs_kind(qs_kind_set(ikind), basis_set=orb_basis_set, basis_type=basis_type)
1104 lmax=la_max, lmin=la_min, maxco=maxco, maxsgf_set=maxsgf_set, &
1105 npgf=npgfa, nset=nseta, nsgf_set=nsgf_seta, nsgf=nsgfa, &
1106 first_sgf=first_sgfa, pgf_radius=rpgfa, set_radius=set_radius_a, &
1107 sphi=sphi_a, zet=zeta)
1109 ALLOCATE (hab(maxco, maxco), work(maxco, maxsgf_set), hmat(nsgfa, nsgfa))
1110 IF (calculate_forces)
ALLOCATE (pab(maxco, maxco), pblk(nsgfa, nsgfa))
1112 DO iatom = 1, natom_of_kind
1113 atom_a = atom_list(iatom)
1114 ra(:) =
pbc(particle_set(atom_a)%r, cell)
1116 IF (calculate_forces)
THEN
1117 CALL dbcsr_get_block_p(matrix=pmat, row=atom_a, col=atom_a, block=p_block, found=found)
1119 pblk(1:nsgfa, 1:nsgfa) = p_block(1:nsgfa, 1:nsgfa)
1123 CALL para_env%sum(pblk)
1126 IF (use_virial)
THEN
1127 my_virial_a = 0.0_dp
1128 my_virial_b = 0.0_dp
1131 m1 = maxval(npgfa(1:nseta))
1132 ALLOCATE (map_it2(m1, m1))
1134 sgfa = first_sgfa(1, iset)
1135 ncoa = npgfa(iset)*
ncoset(la_max(iset))
1137 sgfb = first_sgfa(1, jset)
1138 ncob = npgfa(jset)*
ncoset(la_max(jset))
1141 DO ipgf = 1, npgfa(iset)
1142 DO jpgf = 1, npgfa(jset)
1143 zetp = zeta(ipgf, iset) + zeta(jpgf, jset)
1145 rs_grid => rs_v(igrid_level)
1146 map_it2(ipgf, jpgf) =
map_gaussian_here(rs_grid, cell%h_inv, ra, offset, group_size, my_pos)
1151 IF (any(map_it2(1:npgfa(iset), 1:npgfa(jset))))
THEN
1153 IF (calculate_forces)
THEN
1154 CALL dgemm(
"N",
"N", ncoa, nsgf_seta(jset), nsgf_seta(iset), &
1155 1.0_dp, sphi_a(1, sgfa),
SIZE(sphi_a, 1), &
1156 pblk(sgfa, sgfb),
SIZE(pblk, 1), &
1157 0.0_dp, work(1, 1),
SIZE(work, 1))
1158 CALL dgemm(
"N",
"T", ncoa, ncob, nsgf_seta(jset), &
1159 1.0_dp, work(1, 1),
SIZE(work, 1), &
1160 sphi_a(1, sgfb),
SIZE(sphi_a, 1), &
1161 0.0_dp, pab(1, 1),
SIZE(pab, 1))
1164 DO ipgf = 1, npgfa(iset)
1165 na1 = (ipgf - 1)*
ncoset(la_max(iset))
1166 na2 = ipgf*
ncoset(la_max(iset))
1167 DO jpgf = 1, npgfa(jset)
1168 nb1 = (jpgf - 1)*
ncoset(la_max(jset))
1169 nb2 = jpgf*
ncoset(la_max(jset))
1170 zetp = zeta(ipgf, iset) + zeta(jpgf, jset)
1172 rs_grid => rs_v(igrid_level)
1175 lb_min=la_min(jset), lb_max=la_max(jset), &
1176 ra=ra, rb=ra, rp=ra, &
1177 zetp=zetp, eps=eps_rho_rspace, &
1178 prefactor=1.0_dp, cutoff=1.0_dp)
1180 IF (map_it2(ipgf, jpgf))
THEN
1181 IF (calculate_forces)
THEN
1183 la_max(iset), zeta(ipgf, iset), la_min(iset), &
1184 la_max(jset), zeta(jpgf, jset), la_min(jset), &
1185 ra=ra, rab=[0.0_dp, 0.0_dp, 0.0_dp], &
1186 rsgrid=rs_v(igrid_level), &
1187 hab=hab, pab=pab, o1=na1, o2=nb1, &
1189 calculate_forces=.true., &
1190 force_a=force_a, force_b=force_b, &
1191 use_virial=use_virial, my_virial_a=my_virial_a, my_virial_b=my_virial_b)
1194 la_max(iset), zeta(ipgf, iset), la_min(iset), &
1195 la_max(jset), zeta(jpgf, jset), la_min(jset), &
1196 ra=ra, rab=[0.0_dp, 0.0_dp, 0.0_dp], &
1197 rsgrid=rs_v(igrid_level), &
1198 hab=hab, o1=na1, o2=nb1, &
1200 calculate_forces=.false.)
1206 CALL dgemm(
"N",
"N", ncoa, nsgf_seta(jset), ncob, &
1207 1.0_dp, hab(1, 1),
SIZE(hab, 1), &
1208 sphi_a(1, sgfb),
SIZE(sphi_a, 1), &
1209 0.0_dp, work(1, 1),
SIZE(work, 1))
1210 CALL dgemm(
"T",
"N", nsgf_seta(iset), nsgf_seta(jset), ncoa, &
1211 1.0_dp, sphi_a(1, sgfa),
SIZE(sphi_a, 1), &
1212 work(1, 1),
SIZE(work, 1), &
1213 1.0_dp, hmat(sgfa, sgfb),
SIZE(hmat, 1))
1217 DEALLOCATE (map_it2)
1219 CALL para_env%sum(hmat)
1220 CALL dbcsr_get_block_p(matrix=ksmat, row=atom_a, col=atom_a, block=h_block, found=found)
1222 h_block(1:nsgfa, 1:nsgfa) = h_block(1:nsgfa, 1:nsgfa) + hmat(1:nsgfa, 1:nsgfa)
1224 IF (calculate_forces)
THEN
1225 force(ikind)%rho_elec(:, iatom) = force(ikind)%rho_elec(:, iatom) + 2.0_dp*force_a(:)
1226 IF (use_virial)
THEN
1227 IF (use_virial .AND. calculate_forces)
THEN
1228 virial%pv_lrigpw = virial%pv_lrigpw + 2.0_dp*my_virial_a
1229 virial%pv_virial = virial%pv_virial + 2.0_dp*my_virial_a
1234 DEALLOCATE (hab, work, hmat)
1235 IF (calculate_forces)
DEALLOCATE (pab, pblk)
1238 CALL timestop(handle)
1256 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: f_coef
1257 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: f_integral
1258 LOGICAL,
INTENT(IN) :: calculate_forces
1259 CHARACTER(len=*),
INTENT(IN) :: basis_type
1261 CHARACTER(len=*),
PARAMETER :: routinen =
'integrate_function'
1263 INTEGER :: atom_a, group_size, handle, i, iatom, igrid_level, ikind, ipgf, iset, maxco, &
1264 maxsgf_set, my_pos, na1, natom, ncoa, nkind, nseta, offset, sgfa
1265 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: atom_of_kind
1266 INTEGER,
DIMENSION(:),
POINTER :: la_max, la_min, npgfa, nsgfa
1267 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgfa
1268 LOGICAL :: use_virial
1269 REAL(kind=
dp) :: eps_rho_rspace, radius
1270 REAL(kind=
dp),
DIMENSION(3) :: force_a, force_b, ra
1271 REAL(kind=
dp),
DIMENSION(3, 3) :: my_virial_a, my_virial_b
1272 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: hab, pab, sphi_a, work, zeta
1281 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1286 CALL timeset(routinen, handle)
1288 CALL get_qs_env(qs_env=qs_env, pw_env=pw_env)
1289 gridlevel_info => pw_env%gridlevel_info
1295 atomic_kind_set=atomic_kind_set, &
1296 qs_kind_set=qs_kind_set, &
1299 dft_control=dft_control, &
1302 particle_set=particle_set, &
1307 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
1308 IF (use_virial)
THEN
1309 cpabort(
"Virial NYA")
1312 eps_rho_rspace = dft_control%qs_control%eps_rho_rspace
1315 maxco=maxco, maxsgf_set=maxsgf_set, basis_type=basis_type)
1316 ALLOCATE (hab(maxco, 1), pab(maxco, 1), work(maxco, 1))
1319 my_pos = v_rspace%pw_grid%para%group%mepos
1320 group_size = v_rspace%pw_grid%para%group%num_pe
1323 ikind = particle_set(iatom)%atomic_kind%kind_number
1324 atom_a = atom_of_kind(iatom)
1325 CALL get_qs_kind(qs_kind_set(ikind), basis_set=orb_basis_set, basis_type=basis_type)
1327 first_sgf=first_sgfa, &
1335 ra(:) =
pbc(particle_set(iatom)%r, cell)
1339 my_virial_a(:, :) = 0._dp
1340 my_virial_b(:, :) = 0._dp
1344 ncoa = npgfa(iset)*
ncoset(la_max(iset))
1345 sgfa = first_sgfa(1, iset)
1350 DO i = 1, nsgfa(iset)
1351 work(i, 1) = f_coef(offset + i)
1354 CALL dgemm(
"N",
"N", ncoa, 1, nsgfa(iset), &
1355 1.0_dp, sphi_a(1, sgfa),
SIZE(sphi_a, 1), &
1356 work(1, 1),
SIZE(work, 1), &
1357 0.0_dp, pab(1, 1),
SIZE(pab, 1))
1359 DO ipgf = 1, npgfa(iset)
1361 na1 = (ipgf - 1)*
ncoset(la_max(iset))
1364 rs_grid => rs_v(igrid_level)
1366 IF (
map_gaussian_here(rs_grid, cell%h_inv, ra, offset, group_size, my_pos))
THEN
1368 lb_min=0, lb_max=0, ra=ra, rb=ra, rp=ra, &
1369 zetp=zeta(ipgf, iset), eps=eps_rho_rspace, &
1370 prefactor=1.0_dp, cutoff=1.0_dp)
1372 IF (calculate_forces)
THEN
1374 zeta=zeta(ipgf, iset), la_min=la_min(iset), &
1375 lb_max=0, zetb=0.0_dp, lb_min=0, &
1376 ra=ra, rab=[0.0_dp, 0.0_dp, 0.0_dp], &
1378 hab=hab, pab=pab, o1=na1, o2=0, radius=radius, &
1379 calculate_forces=.true., &
1380 force_a=force_a, force_b=force_b, &
1381 use_virial=use_virial, &
1382 my_virial_a=my_virial_a, my_virial_b=my_virial_b)
1385 zeta=zeta(ipgf, iset), la_min=la_min(iset), &
1386 lb_max=0, zetb=0.0_dp, lb_min=0, &
1387 ra=ra, rab=[0.0_dp, 0.0_dp, 0.0_dp], &
1389 hab=hab, o1=na1, o2=0, radius=radius, &
1390 calculate_forces=.false.)
1397 CALL dgemm(
"T",
"N", nsgfa(iset), 1, ncoa, 1.0_dp, sphi_a(1, sgfa), &
1398 SIZE(sphi_a, 1), hab(1, 1),
SIZE(hab, 1), 0.0_dp, work(1, 1),
SIZE(work, 1))
1399 DO i = 1, nsgfa(iset)
1400 f_integral(offset + i) = work(i, 1)
1403 offset = offset + nsgfa(iset)
1407 IF (calculate_forces)
THEN
1408 force(ikind)%rho_elec(:, atom_a) = force(ikind)%rho_elec(:, atom_a) + force_a(:)
1409 IF (use_virial)
THEN
1410 virial%pv_virial = virial%pv_virial + my_virial_a
1416 DEALLOCATE (hab, pab, work)
1418 CALL timestop(handle)
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
static void dgemm(const char transa, const char transb, const int m, const int n, const int k, const double alpha, const double *a, const int lda, const double *b, const int ldb, const double beta, double *c, const int ldc)
Convenient wrapper to hide Fortran nature of dgemm_, swapping a and b.
All kind of helpful little routines.
real(kind=dp) function, public exp_radius_very_extended(la_min, la_max, lb_min, lb_max, pab, o1, o2, ra, rb, rp, zetp, eps, prefactor, cutoff, epsabs)
computes the radius of the Gaussian outside of which it is smaller than eps
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
Holds information on atomic properties.
subroutine, public atprop_array_init(atarray, natom)
...
subroutine, public get_gto_basis_set(gto_basis_set, name, aliases, norm_type, kind_radius, ncgf, nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum, ccon)
...
Handles all functions related to the CELL.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_get_block_p(matrix, row, col, block, found, row_size, col_size)
...
various routines to log and control the output. The idea is that decisions about where to log should ...
recursive integer function, public cp_logger_get_default_unit_nr(logger, local, skip_not_ionode)
asks the default unit number of the given logger. try to use cp_logger_get_unit_nr
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
Definition of the atomic potential types.
integer function, public gaussian_gridlevel(gridlevel_info, exponent)
...
Fortran API for the grid package, which is written in C.
subroutine, public integrate_pgf_product(la_max, zeta, la_min, lb_max, zetb, lb_min, ra, rab, rsgrid, hab, pab, o1, o2, radius, calculate_forces, force_a, force_b, compute_tau, use_virial, my_virial_a, my_virial_b, hdab, hadb, a_hdab, use_subpatch, subpatch_pattern)
low level function to compute matrix elements of primitive gaussian functions
Defines the basic variable types.
integer, parameter, public dp
contains the types and subroutines for dealing with the lri_env lri : local resolution of the identit...
Collection of simple mathematical functions and subroutines.
Utility routines for the memory handling.
Interface to the message passing library MPI.
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:), allocatable, public ncoset
integer, dimension(:, :, :), allocatable, public coset
Define the data structure for the particle information.
Definition of physical constants:
real(kind=dp), parameter, public pascal
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
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.
Build up the plane wave density by collocating the primitive Gaussian functions (pgf).
subroutine, public integrate_function(qs_env, v_rspace, f_coef, f_integral, calculate_forces, basis_type)
computes integrals of product of v_rspace times a basis function (vector function) and possible force...
subroutine, public integrate_rho_nlcc(rho_rspace, qs_env, debug_forces, debug_stress, iotag)
computes the forces/virial due to the nlcc pseudopotential
subroutine, public integrate_v_gaussian_rspace(v_rspace, qs_env, alpha, ccore, atecc)
computes the overlap of a set of Gaussians with a potential on grid
subroutine, public integrate_v_rspace_diagonal(v_rspace, ksmat, pmat, qs_env, calculate_forces, basis_type)
computes integrals of product of v_rspace times the diagonal block basis functions required for LRIGP...
subroutine, public integrate_v_core_rspace(v_rspace, qs_env, atecc, calpha, ccore)
computes the forces/virial due to the ionic cores with a potential on grid
subroutine, public integrate_v_rspace_one_center(v_rspace, qs_env, int_res, calculate_forces, basis_type, atomlist)
computes integrals of product of v_rspace times a one-center function required for LRIGPW
subroutine, public integrate_ppl_rspace(rho_rspace, qs_env)
computes the forces/virial due to the local pseudopotential
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, cneo_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, hund_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, proj_shell_charge, lr_atom, do_mtlr, u_j_loop, ao_coef, init_u_ramping_each_scf, reltmat, ghost, monovalent, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
subroutine, public get_qs_kind_set(qs_kind_set, all_potential_present, tnadd_potential_present, gth_potential_present, sgp_potential_present, paw_atom_present, dft_plus_u_atom_present, maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, maxlprj, maxnset, maxsgf_set, ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, maxppnl, nelectron, maxder, max_ngrid_rad, max_sph_harm, maxg_iso_not0, lmax_rho0, basis_rcut, do_mtlr_present, basis_type, total_zeff_corr, npgf_seg, cneo_potential_present, nkind_q, natom_q)
Get attributes of an atomic kind set.
Common Gaussian representation of nonlinear core densities.
subroutine, public get_nlcc_gaussians(qs_kind, alpha, nct, cval)
Return rho(r) = sum_i exp(-r**2/(2*alpha(i)**2)) * sum_j cval(j,i)*(r/alpha(i))**(2*j-2)....
subroutine, public transfer_pw2rs(rs, pw)
...
pure logical function, public map_gaussian_here(rs_grid, h_inv, ra, offset, group_size, my_pos)
...
subroutine, public rs_grid_zero(rs)
Initialize grid to zero.
Transfers densities from PW to RS grids and potentials from PW to RS.
subroutine, public potential_pw2rs(rs_v, v_rspace, pw_env)
transfers a potential from a pw_grid to a vector of realspace multigrids
pure real(kind=dp) function, public one_third_sum_diag(a)
...
Provides all information about an atomic kind.
type for the atomic properties
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
Provides all information about a quickstep kind.