Skip to content
Open
Show file tree
Hide file tree
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
19 changes: 5 additions & 14 deletions dpdata/formats/qe/scf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
from dpdata.utils import open_file

from .traj import (
convert_celldm,
kbar2evperang3,
load_celldm,
resolve_celldm,
ry2ev,
)
from .traj import (
Expand Down Expand Up @@ -64,21 +67,9 @@ def get_cell(lines):
for ii in blk:
ret.append([float(jj) for jj in ii.split()[0:3]])
ret = np.array(ret)
elif ibrav == 1:
a = None
for iline in lines:
line = iline.replace("=", " ").replace(",", "").split()
if len(line) >= 2 and "a" == line[0]:
# print("line = ", line)
a = float(line[1])
if len(line) >= 2 and "celldm(1)" == line[0]:
a = float(line[1]) * bohr2ang
# print("a = ", a)
if not a:
raise RuntimeError("parameter 'a' or 'celldm(1)' cannot be found.")
ret = np.array([[a, 0.0, 0.0], [0.0, a, 0.0], [0.0, 0.0, a]])
else:
raise RuntimeError("ibrav > 1 not supported yet.")
celldm = resolve_celldm(lines, ibrav, load_celldm(lines))
ret = convert_celldm(ibrav, celldm) * bohr2ang
return ret


Expand Down
Loading