Fixed a mistake in the calculation of the vdW non-local contribution

to vtxc that was affecting mainly total energy and stress.



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@10958 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
gibertini 2014-05-12 17:20:34 +00:00
parent 20419a2381
commit a555374ba9
2 changed files with 23 additions and 4 deletions

View File

@ -209,8 +209,13 @@ CONTAINS
grid_cell_volume = omega/(dfftp%nr1*dfftp%nr2*dfftp%nr3)
do i_grid = 1, dfftp%nnr
vtxc = vtxc + grid_cell_volume*total_rho(i_grid)*potential(i_grid)
vtxc = vtxc + grid_cell_volume*rho_valence(i_grid,1)*potential(i_grid)
end do
if (nspin==2) then
do i_grid = 1, dfftp%nnr
vtxc = vtxc + grid_cell_volume*rho_valence(i_grid,2)*potential(i_grid)
end do
endif
deallocate(potential)

View File

@ -459,9 +459,17 @@ CONTAINS
do i_grid = 1, dfftp%nnr
vtxc = vtxc + e2*grid_cell_volume*total_rho(i_grid)*potential(i_grid)
vtxc = vtxc + e2*grid_cell_volume*rho_valence(i_grid,1)*potential(i_grid)
end do
if (nspin==2) then
do i_grid = 1, dfftp%nnr
vtxc = vtxc + e2*grid_cell_volume*rho_valence(i_grid,2)*potential(i_grid)
end do
endif
deallocate(potential)
@ -511,10 +519,16 @@ CONTAINS
do i_grid = 1, dfftp%nnr
vtxc = vtxc + e2*grid_cell_volume * total_rho(i_grid)*potential(procs_start(me_pool)+i_grid-1)
vtxc = vtxc + e2*grid_cell_volume * rho_valence(i_grid,1)*potential(procs_start(me_pool)+i_grid-1)
end do
if (nspin==2) then
do i_grid = 1, dfftp%nnr
vtxc = vtxc + e2*grid_cell_volume * rho_valence(i_grid,2)*potential(procs_start(me_pool)+i_grid-1)
end do
endif
deallocate(potential)
#endif