provide access to number of local data rows for fixes

This commit is contained in:
Axel Kohlmeyer
2020-03-07 10:58:35 -05:00
parent 6f1d913e7e
commit 475b7dc4f4
2 changed files with 5 additions and 0 deletions

View File

@ -510,6 +510,10 @@ class lammps(object):
result = ptr[0] result = ptr[0]
self.lib.lammps_free(ptr) self.lib.lammps_free(ptr)
return result return result
elif (style == 2) and (type == 0):
self.lib.lammps_extract_fix.restype = POINTER(c_int)
ptr = self.lib.lammps_extract_fix(self.lmp,id,style,type,i,j)
return ptr[0]
elif (style == 1) or (style == 2): elif (style == 1) or (style == 2):
if type == 1: if type == 1:
self.lib.lammps_extract_fix.restype = POINTER(c_double) self.lib.lammps_extract_fix.restype = POINTER(c_double)

View File

@ -621,6 +621,7 @@ void *lammps_extract_fix(void *ptr, char *id, int style, int type,
if (style == 2) { if (style == 2) {
if (!fix->local_flag) return NULL; if (!fix->local_flag) return NULL;
if (type == 0) return (void *) &fix->size_local_rows;
if (type == 1) return (void *) fix->vector_local; if (type == 1) return (void *) fix->vector_local;
if (type == 2) return (void *) fix->array_local; if (type == 2) return (void *) fix->array_local;
} }