Skip to content

Commit

Permalink
Write and return default mlip.ini in potential_files
Browse files Browse the repository at this point in the history
Enables use of MTP potentials with default lammps job.
  • Loading branch information
pmrv committed Jul 15, 2024
1 parent cfc2de8 commit d16413a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pyiron_potentialfit/mlip/mlip.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,17 @@ def calculation_dataframe(self):

@property
def potential_files(self):
if not self.status.finished:
return []
pot = os.path.join(self.working_directory, "Trained.mtp_")
states = os.path.join(self.working_directory, "state.mvs")
if os.path.exists(pot) and os.path.exists(states):
return [pot, states]
if not (os.path.exists(pot) and os.path.exists(states)):
raise RuntimeError("Potential files not created!")
ini = os.path.join(self.working_directory, "mlip.ini")
if not os.path.exists(ini):
with open(ini, "w") as f:
f.write("mtp-filename Trained.mtp_\nselect FALSE\n")
return [pot, states, ini]

def _get_elements(self):
"""
Expand Down

0 comments on commit d16413a

Please sign in to comment.