forked from lijiext/lammps
Merge pull request #1742 from athomps/python-extract-compute-bug
Fixes bug in extract_compute() python method
This commit is contained in:
commit
c5b7b9649f
|
@ -390,23 +390,23 @@ class lammps(object):
|
||||||
def extract_compute(self,id,style,type):
|
def extract_compute(self,id,style,type):
|
||||||
if id: id = id.encode()
|
if id: id = id.encode()
|
||||||
if type == 0:
|
if type == 0:
|
||||||
if style > 0: return None
|
if style == 0:
|
||||||
self.lib.lammps_extract_compute.restype = POINTER(c_double)
|
self.lib.lammps_extract_compute.restype = POINTER(c_double)
|
||||||
ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
|
ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
|
||||||
return ptr[0]
|
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:
|
if type == 1:
|
||||||
self.lib.lammps_extract_compute.restype = POINTER(c_double)
|
self.lib.lammps_extract_compute.restype = POINTER(c_double)
|
||||||
ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
|
ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
|
||||||
return ptr
|
return ptr
|
||||||
if type == 2:
|
if type == 2:
|
||||||
if style == 0:
|
self.lib.lammps_extract_compute.restype = POINTER(POINTER(c_double))
|
||||||
self.lib.lammps_extract_compute.restype = POINTER(c_int)
|
ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
|
||||||
ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
|
return ptr
|
||||||
return ptr[0]
|
|
||||||
else:
|
|
||||||
self.lib.lammps_extract_compute.restype = POINTER(POINTER(c_double))
|
|
||||||
ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type)
|
|
||||||
return ptr
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# extract fix info
|
# extract fix info
|
||||||
|
|
Loading…
Reference in New Issue