DipoleCorrection is always true for slab
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Siesta |
Fix Released
|
Wishlist
|
Nick Papior | ||
4.0 |
Fix Released
|
Wishlist
|
Nick Papior | ||
4.1 |
Fix Released
|
Wishlist
|
Nick Papior |
Bug Description
if ( nbcell == 2 ) then
! Note that we enable the correction if there is an
! external field
& .false.)
if (acting_efield .and. (.not. dipole_correction)) then
if (ionode) write(6,'(/,(a))')
. 'efield: SlabDipoleCorre
. 'efield: when an external electric field is applied.',
. 'efield: For backward compatibility, set if to .false.'
endif
else
end if
This code in m_efield.F always use True to overwrite the dipole_correction, no matter what user set, making it impossible to set it to false.
Version 4.1
description: | updated |
summary: |
- DipoleCorrection not working for slab + DipoleCorrection is always true for slab |
description: | updated |
no longer affects: | siesta/trunk |
Changed in siesta: | |
milestone: | none → 4.0.1 |
Changed in siesta: | |
status: | Fix Committed → Fix Released |
Thanks for the report.
First, this always turns on the dipole-correction when there is a user-defined E-field.
This is required for the correct physics.
So as for physical correctness there is no problem.
However, this was not the case for previous siesta versions (4.0 and before). /bugs.launchpad .net/siesta/ +bug/1593725
See https:/
I have attached a patch that defaults to true, but allows the user to specify false.
In the latter case siesta prints an error:
efield: WARNING! ction is .false. with an external efield. ction should be .true.
efield: SlabDipoleCorre
efield: For correct physics SlabDipoleCorre
efield: This is only for backwards compatibility!