Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
yangtengleo committed Sep 20, 2024
2 parents 9bc8a68 + c1d6c73 commit 614fde7
Show file tree
Hide file tree
Showing 33 changed files with 4,145 additions and 253 deletions.
8 changes: 8 additions & 0 deletions dpdata/abacus/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
get_cell,
get_coords,
get_geometry_in,
get_mag_force,
kbar2evperang3,
)

Expand Down Expand Up @@ -199,6 +200,9 @@ def get_frame(fname):
stress[iframe] *= np.linalg.det(cells[iframe, :, :].reshape([3, 3]))
if np.sum(np.abs(stress[0])) < 1e-10:
stress = None

magmom, magforce = get_mag_force(outlines)

data = {}
data["atom_names"] = atom_names
data["atom_numbs"] = natoms
Expand All @@ -213,5 +217,9 @@ def get_frame(fname):
if not isinstance(data["virials"], np.ndarray):
del data["virials"]
data["orig"] = np.zeros(3)
if len(magmom) > 0:
data["spins"] = magmom
if len(magforce) > 0:
data["mag_forces"] = magforce

return data
8 changes: 8 additions & 0 deletions dpdata/abacus/relax.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
get_cell,
get_coords,
get_geometry_in,
get_mag_force,
kbar2evperang3,
)

Expand Down Expand Up @@ -198,6 +199,8 @@ def get_frame(fname):
lines, atomnumber
)

magmom, magforce = get_mag_force(lines)

data = {}
data["atom_names"] = atom_names
data["atom_numbs"] = natoms
Expand All @@ -211,4 +214,9 @@ def get_frame(fname):
data["stress"] = stress
data["orig"] = np.zeros(3)

if len(magmom) > 0:
data["spins"] = magmom
if len(magforce) > 0:
data["mag_forces"] = magforce

return data
Loading

0 comments on commit 614fde7

Please sign in to comment.