Skip to content

Commit 669f83d

Browse files
Fix the bug in PWmat-MOVEMENT converter
1 parent 3443aec commit 669f83d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dpdata/pwmat/movement.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def analyze_block(lines, ntot, nelm) :
107107
sc_index = int(ii.split('SCF =')[1])
108108
if sc_index >= nelm:
109109
is_converge = False
110-
energy = float(ii.split('Etot,Ep,Ek (eV)')[1].split()[1])
110+
energy = float(ii.split('Etot,Ep,Ek (eV)')[1].split()[2]) # use Ep, not Etot=Ep+Ek
111111
elif '----------' in ii:
112112
assert((force is not None) and len(coord) > 0 and len(cell) > 0)
113113
# all_coords.append(coord)
@@ -170,7 +170,7 @@ def analyze_block(lines, ntot, nelm) :
170170
min = jj
171171
lines[min], lines[kk] = lines[kk],lines[min]
172172
for gg in range(idx+1,idx+1+ntot):
173-
info = [float(ss) for ss in lines[gg].split()]
173+
info = [-float(ss) for ss in lines[gg].split()] # forces in MOVEMENT file are dE/dR, lacking a minus sign
174174
force.append(info[1:4])
175175
# elif 'Atomic-Energy' in ii:
176176
# for jj in range(idx+1, idx+1+ntot) :

0 commit comments

Comments
 (0)