Clean up Code

This commit is contained in:
Niels Mueller
2019-10-08 15:08:52 +02:00
parent 27fc2cbbcc
commit a820741ec3
4 changed files with 244 additions and 214 deletions

107
pygmx/topology.pxd Normal file → Executable file
View File

@ -7,22 +7,22 @@ from mdtypes cimport *
cdef extern from "gromacs/topology/atoms.h":
ctypedef struct t_atom:
real m, q; # Mass and charge */
real mB, qB; # Mass and charge for Free Energy calc */
unsigned short type; # Atom type */
unsigned short typeB; # Atom type for Free Energy calc */
int ptype; # Particle type */
int resind; # Index into resinfo (in t_atoms) */
int atomnumber; # Atomic Number or 0 */
char elem[4]; # Element name */
real m, q # Mass and charge */
real mB, qB # Mass and charge for Free Energy calc */
unsigned short type # Atom type */
unsigned short typeB # Atom type for Free Energy calc */
int ptype # Particle type */
int resind # Index into resinfo (in t_atoms) */
int atomnumber # Atomic Number or 0 */
char elem[4] # Element name */
ctypedef struct t_resinfo:
char **name; # Pointer to the residue name */
int nr; # Residue number */
unsigned char ic; # Code for insertion of residues */
int chainnum; # Iincremented at TER or new chain id */
char chainid; # Chain identifier written/read to pdb */
char **rtp; # rtp building block name (optional) */
char **name # Pointer to the residue name */
int nr # Residue number */
unsigned char ic # Code for insertion of residues */
int chainnum # Iincremented at TER or new chain id */
char chainid # Chain identifier written/read to pdb */
char **rtp # rtp building block name (optional) */
ctypedef struct t_pdbinfo:
pass
@ -46,8 +46,8 @@ cdef extern from "gromacs/topology/atoms.h":
pass
ctypedef struct t_grps:
int nr; # Number of different groups */
int *nm_ind; # Index in the group names */
int nr # Number of different groups */
int *nm_ind # Index in the group names */
#ctypedef t_atoms *t_atoms_ptr
@ -57,7 +57,10 @@ cdef extern from "gromacs/topology/symtab.h":
cdef extern from "gromacs/topology/block.h":
ctypedef struct t_block:
pass
int nr #/* The number of blocks */
int *index #/* Array of indices (dim: nr+1) */
int nalloc_index #/* The allocation size for index */
ctypedef struct t_blocka:
pass
@ -65,8 +68,8 @@ cdef extern from "gromacs/topology/idef.h":
ctypedef struct t_ilist:
pass
cdef enum t_ft_enum:
F_LJ
#cdef enum t_ft_enum:
# F_LJ
ctypedef union t_iparams:
pass
@ -77,13 +80,13 @@ cdef extern from "gromacs/topology/idef.h":
pass
ctypedef struct gmx_ffparams_t:
int ntypes;
int atnr;
t_functype *functype;
t_iparams *iparams;
double reppow; # The repulsion power for VdW: C12*r^-reppow */
real fudgeQQ; # The scaling factor for Coulomb 1-4: f*q1*q2 */
gmx_cmap_t cmap_grid; # The dihedral correction maps */
int ntypes
int atnr
t_functype *functype
t_iparams *iparams
double reppow # The repulsion power for VdW: C12*r^-reppow */
real fudgeQQ # The scaling factor for Coulomb 1-4: f*q1*q2 */
gmx_cmap_t cmap_grid # The dihedral correction maps */
void pr_ffparams(FILE *fp, int indent, const char *title,
@ -91,20 +94,26 @@ cdef extern from "gromacs/topology/idef.h":
cdef extern from "gromacs/topology/topology.h":
ctypedef struct gmx_moltype_t:
char **name; # Name of the molecule type */
t_atoms atoms; # The atoms in this molecule */
t_ilist ilist[0]; # Interaction list with local indices */
t_block cgs; # The charge groups */
t_blocka excls; # The exclusions */
char **name # Name of the molecule type */
t_atoms atoms # The atoms in this molecule */
t_ilist ilist[0] # Interaction list with local indices */
t_block cgs # The charge groups */
t_blocka excls # The exclusions */
ctypedef struct gmx_molblock_t:
int type; # The molcule type index in mtop.moltype */
int nmol; # The number of molecules in this block */
int natoms_mol; # The number of atoms in one molecule */
int nposres_xA; # The number of posres coords for top A */
rvec *posres_xA; # The posres coords for top A */
int nposres_xB; # The number of posres coords for top B */
rvec *posres_xB; # The posres coords for top B */
int type #*< The molecule type index in mtop.moltype */
int nmol #*< The number of molecules in this block */
int nposres_xA #*< The number of posres coords for top A */
rvec *posres_xA #*< Position restraint coordinates for top A */
int nposres_xB #*< The number of posres coords for top B */
rvec *posres_xB #*< Position restraint coordinates for top B */
# Convenience information, derived from other gmx_mtop_t contents */
int natoms_mol #*< The number of atoms in one molecule */
int globalAtomStart #*< Global atom index of the first atom in the block */
int globalAtomEnd #*< Global atom index + 1 of the last atom in the block */
int globalResidueStart #*< Global residue index of the first residue in the block */
int residueNumberStart #*< Residue numbers start from this value if the number of residues per molecule is <= maxres_renum */
ctypedef struct gmx_groups_t:
pass
@ -115,24 +124,24 @@ cdef extern from "gromacs/topology/topology.h":
# unsigned char *grpnr[0] # Group numbers or NULL */
ctypedef struct gmx_mtop_t:
char **name # Name of the topology */
char **name # Name of the topology */
gmx_ffparams_t ffparams
int nmoltype
gmx_moltype_t *moltype
int nmolblock
gmx_molblock_t *molblock
bint bIntermolecularInteractions # Are there intermolecular
# interactions? */
t_ilist *intermolecular_ilist # List of intermolecular interactions
# using system wide atom indices,
# either NULL or size F_NRE */
gmx_bool bIntermolecularInteractions # Are there intermolecular
# * interactions? */
t_ilist *intermolecular_ilist # List of intermolecular interactions
# * using system wide atom indices,
# * either NULL or size F_NRE */
int natoms
int maxres_renum # Parameter for residue numbering */
int maxresnr # The maximum residue number in moltype */
t_atomtypes atomtypes # Atomtype properties */
t_block mols # The molecules */
int maxres_renum # Parameter for residue numbering */
int maxresnr # The maximum residue number in moltype */
t_atomtypes atomtypes # Atomtype properties */
t_block mols # The molecules */
gmx_groups_t groups
t_symtab symtab # The symbol table */
t_symtab symtab # The symbol table */
# cdef extern from "gromacs/topology/topology.h":
# generate a t_atoms struct for the system from gmx_mtop_t