From cc721816df987da04f4f5c3e0522362094e5433d Mon Sep 17 00:00:00 2001 From: yuhldr Date: Sun, 14 Apr 2024 17:17:36 +0800 Subject: [PATCH] pylammps: append_cmd_history --- python/lammps/pylammps.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/python/lammps/pylammps.py b/python/lammps/pylammps.py index 05d6d577b9..b691129e72 100644 --- a/python/lammps/pylammps.py +++ b/python/lammps/pylammps.py @@ -532,6 +532,18 @@ class PyLammps(object): """ self._cmd_history = [] + + def append_cmd_history(self, cmd): + """ + Commands will be recorded but not execute + + Add `run steps` only to the command history, but do not execute the run command. + Convenient batch create Lammps script files, use + :py:meth:`PyLammps.write_script()`. + """ + self._cmd_history.append(cmd) + + def command(self, cmd): """ Execute LAMMPS command