Use gromacs 5.1 release (instead of master)
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
from utility cimport *
|
from utility cimport *
|
||||||
from math cimport *
|
from math cimport *
|
||||||
|
|
||||||
cdef extern from "gromacs/mdtypes/inputrec.h":
|
cdef extern from "gromacs/legacyheaders/types/inputrec.h":
|
||||||
ctypedef struct t_simtemp:
|
ctypedef struct t_simtemp:
|
||||||
pass
|
pass
|
||||||
ctypedef struct t_lambda:
|
ctypedef struct t_lambda:
|
||||||
|
@ -13,15 +13,13 @@ from topology cimport *
|
|||||||
|
|
||||||
|
|
||||||
cdef extern from "gromacs/fileio/tpxio.h":
|
cdef extern from "gromacs/fileio/tpxio.h":
|
||||||
void read_tpxheader(const char *fn, t_tpxheader *tpx, bint TopOnlyOK)
|
ctypedef struct t_tpxheader:
|
||||||
|
int bIr # Non zero if input_rec is present */
|
||||||
cdef struct t_tpxheader:
|
int bBox # Non zero if a box is present */
|
||||||
bint bIr # Non zero if input_rec is present */
|
int bTop # Non zero if a topology is present */
|
||||||
bint bBox # Non zero if a box is present */
|
int bX # Non zero if coordinates are present */
|
||||||
bint bTop # Non zero if a topology is present */
|
int bV # Non zero if velocities are present */
|
||||||
bint bX # Non zero if coordinates are present */
|
int bF # Non zero if forces are present (no longer
|
||||||
bint bV # Non zero if velocities are present */
|
|
||||||
bint bF # Non zero if forces are present (no longer
|
|
||||||
# supported, but retained so old .tpr can be read) */
|
# supported, but retained so old .tpr can be read) */
|
||||||
int natoms # The total number of atoms */
|
int natoms # The total number of atoms */
|
||||||
int ngtc # The number of temperature coupling groups */
|
int ngtc # The number of temperature coupling groups */
|
||||||
@ -29,12 +27,14 @@ cdef extern from "gromacs/fileio/tpxio.h":
|
|||||||
int fep_state # Current value of the alchemical state --
|
int fep_state # Current value of the alchemical state --
|
||||||
|
|
||||||
|
|
||||||
|
void read_tpxheader(const char *fn, t_tpxheader *tpx, bint TopOnlyOK, int *version, int *generation)
|
||||||
int read_tpx(const char *fname,
|
int read_tpx(const char *fname,
|
||||||
t_inputrec *ir,
|
t_inputrec *ir,
|
||||||
double box[3][3],
|
matrix box,
|
||||||
int *natoms,
|
int *natoms,
|
||||||
rvec *x,
|
rvec *x,
|
||||||
rvec *v,
|
rvec *v,
|
||||||
|
rvec *f,
|
||||||
gmx_mtop_t *mtop)
|
gmx_mtop_t *mtop)
|
||||||
|
|
||||||
|
|
||||||
@ -172,20 +172,25 @@ cdef class TPXReader:
|
|||||||
|
|
||||||
def __cinit__(self, filename):
|
def __cinit__(self, filename):
|
||||||
filename = cstr(filename)
|
filename = cstr(filename)
|
||||||
read_tpxheader(<char *>filename, &self.header, True)
|
|
||||||
self.n_atoms = self.header.natoms
|
|
||||||
self.n_tcouple_groups = self.header.ngtc
|
|
||||||
|
|
||||||
cdef np.ndarray[real, ndim=2] coordinates = np.empty((self.n_atoms, 3), dtype=np.float32)
|
# Arrays for coordinates etc can be NULL, if they shouldn't be read
|
||||||
cdef np.ndarray[real, ndim=2] velocites = np.empty((self.n_atoms, 3), dtype=np.float32)
|
# cdef int version, generation
|
||||||
|
# read_tpxheader(<char *>filename, &self.header, True, &version, &generation)
|
||||||
|
# self.n_atoms = self.header.natoms
|
||||||
|
# self.n_tcouple_groups = self.header.ngtc
|
||||||
|
# cdef np.ndarray[real, ndim=2] coordinates = np.empty((self.n_atoms, 3), dtype=np.float32)
|
||||||
|
# cdef np.ndarray[real, ndim=2] velocites = np.empty((self.n_atoms, 3), dtype=np.float32)
|
||||||
|
# cdef np.ndarray[real, ndim=2] forces = np.empty((self.n_atoms, 3), dtype=np.float32)
|
||||||
|
|
||||||
return_code = read_tpx(
|
return_code = read_tpx(
|
||||||
<char *>filename,
|
<char *>filename,
|
||||||
&self.input_record,
|
&self.input_record,
|
||||||
self.box,
|
self.box,
|
||||||
&self.n_atoms,
|
&self.n_atoms,
|
||||||
<rvec *>coordinates.data,
|
NULL, NULL, NULL,
|
||||||
<rvec *>velocites.data,
|
# <rvec *>coordinates.data,
|
||||||
|
# <rvec *>velocites.data,
|
||||||
|
# <rvec *>forces.data,
|
||||||
&self.topology
|
&self.topology
|
||||||
)
|
)
|
||||||
self.topology_name = self.topology.name[0]
|
self.topology_name = self.topology.name[0]
|
||||||
|
Reference in New Issue
Block a user