Skip to content

Commit

Permalink
Merge pull request #81 from muon-spectroscopy-computational-project/8…
Browse files Browse the repository at this point in the history
…0_initial_magnetic_moments

Use spins from cell instead of castep for UEP #80
  • Loading branch information
patrick-austin committed Jun 9, 2023
2 parents 00d00fe + 1a52518 commit 95e35da
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit 95e35da

Please sign in to comment.