library: add API for compute clearstep and addstep

This commit is contained in:
Richard Berger
2024-11-12 13:43:22 -07:00
parent 0fa1255cc3
commit 83a73ba0b9
3 changed files with 112 additions and 0 deletions

View File

@ -339,6 +339,10 @@ class lammps(object):
self.lib.lammps_extract_variable_datatype.argtypes = [c_void_p, c_char_p]
self.lib.lammps_extract_variable_datatype.restype = c_int
self.lib.lammps_compute_clearstep.argtype = [c_void_p]
self.lib.lammps_compute_addstep.argtype = [c_void_p, self.c_bigint]
self.lib.lammps_compute_addstep_all.argtype = [c_void_p, self.c_bigint]
self.lib.lammps_fix_external_get_force.argtypes = [c_void_p, c_char_p]
self.lib.lammps_fix_external_get_force.restype = POINTER(POINTER(c_double))
@ -1453,6 +1457,24 @@ class lammps(object):
# -------------------------------------------------------------------------
def compute_clearstep(self, nextstep):
with ExceptionCheck(self):
return self.lib.lammps_compute_clearstep(self.lmp)
# -------------------------------------------------------------------------
def compute_addstep(self, nextstep):
with ExceptionCheck(self):
return self.lib.lammps_compute_addstep(self.lmp, nextstep)
# -------------------------------------------------------------------------
def compute_addstep_all(self, nextstep):
with ExceptionCheck(self):
return self.lib.lammps_compute_addstep_all(self.lmp, nextstep)
# -------------------------------------------------------------------------
def flush_buffers(self):
"""Flush output buffers