Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for qe v7.2 #444

Merged
merged 2 commits into from
Apr 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dpdata/qe/scf.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ def get_energy(lines):
return energy


def get_force(lines):
def get_force(lines, natoms):
blk = get_block(lines, "Forces acting on atoms", skip=1)
ret = []
blk = blk[0 : sum(natoms)]
for ii in blk:
ret.append([float(jj) for jj in ii.split("=")[1].split()])
ret = np.array(ret)
Expand Down Expand Up @@ -146,7 +147,7 @@ def get_frame(fname):
cell = get_cell(inlines)
atom_names, natoms, types, coords = get_coords(inlines, cell)
energy = get_energy(outlines)
force = get_force(outlines)
force = get_force(outlines, natoms)
stress = get_stress(outlines) * np.linalg.det(cell)
return (
atom_names,
Expand Down