Example #1
0
 def __init__(self,filename):
     toptitle=(c_char*256)()
     top=t_topology()
     xp=POINTER(rvec)()
     vp=POINTER(rvec)()
     cePBC=c_int(-1)
     box=matrix()
     bMass=c_int()
     ret = libgmx.read_tps_conf(filename,byref(toptitle),byref(top),byref(cePBC),byref(xp),byref(vp),box,byref(bMass))
     if ret!=1:
         raise GMXctypesError,"Error reading topology with read_tps_conf"
     self.title,self.top,self.ePBC,self.x,self.v,self.box,self.bMass=toptitle.value,top,cePBC.value,xp,vp,box,bMass.value
Example #2
0
 def __init__(self,filename):
     toptitle=(c_char*256)()
     top=t_topology()
     xp=POINTER(rvec)()
     vp=POINTER(rvec)()
     cePBC=c_int(-1)
     box=matrix()
     bMass=c_int()
     ret = libgmx.read_tps_conf(filename,byref(toptitle),byref(top),byref(cePBC),byref(xp),byref(vp),box,byref(bMass))
     if ret!=1:
         raise GMXctypesError("Error reading topology with read_tps_conf")
     self.title,self.top,self.ePBC,self.x,self.v,self.box,self.bMass=toptitle.value,top,cePBC.value,xp,vp,box,bMass.value
     self.natoms = self.top.atoms.nr
     if auto_mode==mNumPy:
       self.x = maprvec(self.x,self.natoms)
       self.v = maprvec(self.v,self.natoms)
       self.A = mapatom(self.top.atoms.atom,self.natoms)