mirror of https://gitlab.com/QEF/q-e.git
Added US forces with Berry's phase electric field
Corrected bug in NC forces with Berry's phase electric field. P.U. git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4564 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
parent
53c1cd9250
commit
9349f84e21
|
@ -76,6 +76,7 @@ ewald.o \
|
|||
ewald_dipole.o \
|
||||
exx.o \
|
||||
find_group.o \
|
||||
forces_bp_efield.o \
|
||||
force_cc.o \
|
||||
force_corr.o \
|
||||
force_ew.o \
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
subroutine allocate_bp_efield
|
||||
!this subroutine allocate memory for the Berry's phase electric field
|
||||
USE bp
|
||||
USE ions_base, ONLY : nat
|
||||
USE gvect, ONLY : ngm_g
|
||||
|
||||
implicit none
|
||||
|
||||
if(lberry.or.lelfield) then
|
||||
allocate(mapgp_global(ngm_g,3))
|
||||
allocate(mapgm_global(ngm_g,3))
|
||||
allocate(mapgm_global(ngm_g,3))
|
||||
allocate(forces_bp_efield(3,nat))
|
||||
endif
|
||||
|
||||
return
|
||||
|
@ -25,6 +27,7 @@
|
|||
if(lberry.or.lelfield) then
|
||||
deallocate(mapgp_global)
|
||||
deallocate(mapgm_global)
|
||||
deallocate(forces_bp_efield)
|
||||
endif
|
||||
|
||||
return
|
||||
|
|
|
@ -512,7 +512,8 @@ SUBROUTINE c_phase_field
|
|||
if(nspin==1) pola=pola*2.d0
|
||||
!pola=pola/(gpar(gdir)*tpiba)
|
||||
call factor_a(gdir,at,dkfact)
|
||||
pola=pola/tpiba*dkfact
|
||||
!factor sqrt(2) is the electronic charge in Rydberg units
|
||||
pola=pola*dsqrt(2.d0)/tpiba*dkfact
|
||||
|
||||
!write output
|
||||
write(stdout,*)
|
||||
|
|
|
@ -38,6 +38,8 @@ SUBROUTINE forces()
|
|||
USE ldaU, ONLY : lda_plus_u
|
||||
USE extfield, ONLY : tefield, forcefield
|
||||
USE control_flags, ONLY : gamma_only, remove_rigid_rot, lbfgs
|
||||
USE bp, ONLY : lelfield, forces_bp_efield
|
||||
USE uspp, ONLY : okvan
|
||||
!
|
||||
IMPLICIT NONE
|
||||
!
|
||||
|
@ -91,6 +93,14 @@ SUBROUTINE forces()
|
|||
!
|
||||
CALL force_corr( forcescc )
|
||||
!
|
||||
! Berry's phase electric field terms
|
||||
!
|
||||
if(lelfield) then
|
||||
forces_bp_efield(:,:)=0.d0
|
||||
if(okvan) call forces_us_efield(forces_bp_efield)
|
||||
call forces_ion_efield
|
||||
endif
|
||||
!
|
||||
! ... here we sum all the contributions and compute the total force acting
|
||||
! ... on the crstal
|
||||
!
|
||||
|
@ -108,6 +118,7 @@ SUBROUTINE forces()
|
|||
forcescc(ipol,na)
|
||||
!
|
||||
IF ( tefield ) force(ipol,na) = force(ipol,na) + forcefield(ipol,na)
|
||||
IF (lelfield) force(ipol,na) = force(ipol,na) + forces_bp_efield(ipol,na)
|
||||
!
|
||||
sumfor = sumfor + force(ipol,na)
|
||||
!
|
||||
|
|
|
@ -235,15 +235,15 @@ subroutine h_epsi_her_set
|
|||
dkm(:)=-dk(:)
|
||||
|
||||
!calculates fact factor
|
||||
!electronic charge is 2. (Rydberg units)
|
||||
!electronic charge is sqrt(2.) (Rydberg units)
|
||||
!the factor (-i)/2 comes form operator Im
|
||||
|
||||
if(nspin == 1) then
|
||||
!fact_hepsi(ik)=CMPLX(0.d0,-1.d0)*efield*(2.d0)/2.d0/dkmod
|
||||
fact_hepsi(ik)=CMPLX(0.d0,-1.d0)*efield*(2.d0)/2.d0/dkfact
|
||||
fact_hepsi(ik)=CMPLX(0.d0,-1.d0)*efield*dsqrt(2.d0)/2.d0/dkfact
|
||||
else
|
||||
!fact_hepsi(ik)=CMPLX(0.d0,-1.d0)*efield*(2.d0)/2.d0/dkmod/DBLE(nspin)
|
||||
fact_hepsi(ik)=CMPLX(0.d0,-1.d0)*efield*(2.d0)/2.d0/dkfact
|
||||
fact_hepsi(ik)=CMPLX(0.d0,-1.d0)*efield*dsqrt(2.d0)/2.d0/dkfact
|
||||
endif
|
||||
|
||||
|
||||
|
|
|
@ -580,7 +580,7 @@ MODULE bp
|
|||
COMPLEX(DP), ALLOCATABLE, TARGET :: bec_evcel(:,:)!for storing bec's factors with evcel
|
||||
INTEGER, ALLOCATABLE, TARGET :: mapgp_global(:,:)! map for G'= G+1 correspondence
|
||||
INTEGER, ALLOCATABLE, TARGET :: mapgm_global(:,:)! map for G'= G-1 correspondence
|
||||
|
||||
REAL(DP), ALLOCATABLE, TARGET :: forces_bp_efield(:,:)!ionic and US contributions to the atomic forces due to el. fields
|
||||
|
||||
|
||||
!
|
||||
|
|
Loading…
Reference in New Issue