Commit 0effdb69 authored by Miriam Hinzen's avatar Miriam Hinzen

Fix Bugs in Film-Case Preconditioner

parent 5c27041c
......@@ -75,6 +75,7 @@ contains
type(t_potden) :: resDen, vYukawa
integer :: ierr(2)
!External functions
real :: CPP_BLAS_sdot
external :: CPP_BLAS_sdot
......@@ -230,7 +231,7 @@ contains
! KERKER PRECONDITIONER
if( input%preconditioning_param /= 0 ) then
call resDen%init( stars, atoms, sphhar, vacuum, input%jspins, noco%l_noco, 1001 )
call resDen%init( stars, atoms, sphhar, vacuum, input%jspins, noco%l_noco, POTDEN_TYPE_DEN )
call vYukawa%init( stars, atoms, sphhar, vacuum, input%jspins, noco%l_noco, 4 )
MPI0_b: if( mpi%irank == 0 ) then
call resDen%subPotDen( outDen, inDen )
......@@ -258,6 +259,8 @@ contains
* vYukawa%mt(1:atoms%jri(n),lh,n,1) * atoms%rmsh(1:atoms%jri(n),n) ** 2
end do
end do
resDen%vacz = resDen%vacz - input%preconditioning_param ** 2 / fpi_const * vYukawa%vacz
resDen%vacxy = resDen%vacxy - input%preconditioning_param ** 2 / fpi_const * vYukawa%vacxy
if( input%jspins == 2 ) call resDen%ChargeAndMagnetisationToSpins()
! fix the preconditioned density
call outDen%addPotDen( resDen, inDen )
......
This diff is collapsed.
......@@ -152,6 +152,7 @@ contains
#endif
if ( mpi%irank == 0 ) then
if ( potdenType == POTDEN_TYPE_POTYUK ) return
! Check: integral of the pseudo charge density within the slab
if ( input%film .and. .not. oneD%odi%d1 ) then
psint = psq(1) * stars%nstr(1) * vacuum%dvac
......
......@@ -67,7 +67,6 @@ contains
integer:: ierr
#endif
allocate ( alphm(stars%ng2,2), af1(3*stars%mx3), bf1(3*stars%mx3), psq(stars%ng3) )
vCoul%iter = den%iter
......@@ -135,6 +134,8 @@ contains
! bf1(i_sm) = bf1(i_sm) + z * deltb
! ENDDO
! ENDIF
! --> 1-d fourier transform and store the coefficients in vTot%pw( ,1)
call cfft( af1, bf1, ivfft, ivfft, ivfft, -1 )
! delta = ivfft * delta * 2 / fpi ! * amat(3,3)**2 * ani
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment