RestartFromTrajectory¶
- class RestartFromTrajectory(trajectory_filename=None, object_id=None, restore_optimizer_state=None)¶
Class for restarting a geometry optimization from a previously saved trajectory.
- Parameters:
trajectory_filename (str) – The filename used to look for the restart trajectory.
object_id (str) – The ID of the object in the file. Can only be specified together with a trajectory_filename.
restore_optimizer_state (bool) – Whether to restart using the state of the optimizer method object as well as the atomic positions. Default:
True
if the optimizer method object is present on the trajectory and compatible with the new optimizer method,False
otherwise.
- objectId()¶
- Returns:
The object ID of the restart trajectory.
- Return type:
str | None
- restoreOptimizerState()¶
- Returns:
Whether to restart using the state of the optimizer method object.
- Return type:
bool | None
- trajectoryFilename()¶
- Returns:
The filename used to look for the restart trajectory.
- Return type:
str | None
- uniqueString()¶
Return a unique string representing the state of the object.
Notes¶
The RestartFromTrajectory
class is intended to facilitate restarts
of OptimizeGeometry()
and OptimizeNudgedElasticBand()
, as well as other objects
which accept OptimizeGeometryParameters
, using an existing trajectory file.
If trajectory_filename is not specified in RestartFromTrajectory
, the filename of the
current optimization object will be used to search for a compatible trajectory to restart from. In
case no trajectory can be found, the restart behavior falls back to NoRestart
.
If specified, the object_id
parameter will determine the object in the file that is used for
restart. For OptimizeNudgedElasticBand()
the specified object_id
is treated as prefix
and all matching NudgedElasticBand
objects in the file are searched for. The one with
the highest suffix is used. If the object_id
parameter is not specified, the
trajectory_object_id
in OptimizeGeometry()
or OptimizeNudgedElasticBand()
will
be used if specified there. Otherwise the trajectory file will be searched for all objects matching
the expected type with numbered IDs, and the highest one will be used. In case no matching object
can be found, the restart behavior falls back to NoRestart
.
Before restarting from a given object, the simulations are checked for consistency, including
elements, type of configuration, constraints, optimizer method, and calculator (only for NEB). If
the consistency check fails, a warning is printed to the log file and the restart behavior falls
back to NoRestart
.