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

Use spins from cell instead of castep for UEP #80 #81

Merged
merged 3 commits into from
Jun 9, 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: 4 additions & 1 deletion pymuonsuite/calculate/uep/charged.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def __init__(self, seedname, gw_fac=3, path=""):
self._elec_den = FMTReader(seedpath + ".den_fmt")
with silence_stdio():
self._struct = io.read(seedpath + ".castep")
# Set all spins to 0 rather than use the CASTEP results
spins = [0] * len(self._struct.positions)
self._struct.set_initial_magnetic_moments(spins)

ppots = parse_castep_ppots(seedpath + ".castep")

Expand All @@ -87,7 +90,7 @@ def __init__(self, seedname, gw_fac=3, path=""):
with silence_stdio():
cppot = io.read(seedpath + ".cell").calc.cell.species_pot.value
except IOError:
pass # If not available, ignore this
print(f"WARNING: cell file {seedpath}.cell not found")
if cppot is not None:
ppf = [lpp.split() for lpp in cppot.split("\n") if lpp]
for el, pppath in ppf:
Expand Down
Loading