When I use VASP to compute in-plane polarization of a slab with hexagonal cell (a axis along x axis, b axis is at a(-1/2,$\sqrt{3}$/2),polarization is along diagonal direction so I got it using $p_x$/cos30°), the result has a jump in polarization at two ends. I computed till 2% and 99% atom displacement. The structure is a slab composed of one quintuple layer and with vacuum region larger than 20A.
Related input parameters for slab and berry phase:
#Dipole correction
LDIPOL = .TRUE.
IDIPOL = 3
DIPOL = 0.5 0.5 0.6
LCALCPOL = .TRUE.
I'm really confused about these and couldn't find a explanation. But if I just use those middle points (2-99%) and extrapolate them to two ends, I can get the correct dipole moment value (same as paper).
