fix another bug in extract_compute() method of LAMMPS python module

This commit is contained in:
Axel Kohlmeyer
2019-10-25 16:16:39 -04:00
parent 8f8bcf5f7b
commit f21b059cd4

View File

@ -390,10 +390,15 @@ class lammps(object):
def extract_compute(self,id,style,type):
if id: id = id.encode()
if type == 0:
if style > 0: return None
self.lib.lammps_extract_compute.restype = POINTER(c_double)
ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
return ptr[0]
if style == 0:
self.lib.lammps_extract_compute.restype = POINTER(c_double)
ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
return ptr[0]
else if style == 1:
return None
else if style == 2:
self.lib.lammps_extract_compute.restype = POINTER(c_int)
return ptr[0]
if type == 1:
self.lib.lammps_extract_compute.restype = POINTER(c_double)
ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)