Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
add restart logic from mbuild pr844
Browse files Browse the repository at this point in the history
  • Loading branch information
jennyfothergill committed Mar 8, 2021
1 parent 8208891 commit 71c77b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion planckton/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class Simulation:
target_length : unyt.unyt_quantity
Target final box length for the shrink step. If None is provided, no
shrink step will be performed. (default None)
restart : str
Path to gsd file from which to restart the simulation (default None)
Attributes
----------
Expand Down Expand Up @@ -84,6 +86,7 @@ def __init__(
dt=0.0001,
mode="gpu",
target_length=None,
restart=None
):
self.system = typed_system
self.kT = kT
Expand All @@ -97,6 +100,7 @@ def __init__(
self.dt = dt
self.mode = mode
self.target_length = target_length
self.restart = restart

def run(self):
hoomd_args = f"--single-mpi --mode={self.mode}"
Expand All @@ -106,7 +110,7 @@ def run(self):
hoomd.util.quiet_status()
# mbuild units are nm, amu
hoomd_objects, ref_values = create_hoomd_simulation(
self.system, auto_scale=True
self.system, auto_scale=True, restart=self.restart
)
self.ref_values = ref_values
snap = hoomd_objects[0]
Expand Down

0 comments on commit 71c77b2

Please sign in to comment.