Clean up Code
This commit is contained in:
@ -30,153 +30,164 @@ cdef extern from "gromacs/mdtypes/inputrec.h":
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
ctypedef struct t_inputrec:
|
ctypedef struct t_inputrec:
|
||||||
int eI # Integration method */
|
# t_inputrec()
|
||||||
int nsteps # number of steps to be taken */
|
# explicit t_inputrec(const t_inputrec &) = delete
|
||||||
int simulation_part # Used in checkpointing to separate chunks */
|
# t_inputrec &operator=(const t_inputrec &) = delete
|
||||||
int init_step # start at a stepcount >0 (used w. convert-tpr) */
|
# ~t_inputrec()
|
||||||
int nstcalcenergy # frequency of energy calc. and T/P coupl. upd. */
|
int eI # Integration method */
|
||||||
int cutoff_scheme # group or verlet cutoffs */
|
gmx_int64_t nsteps # number of steps to be taken */
|
||||||
int ns_type # which ns method should we use? */
|
int simulation_part # Used in checkpointing to separate chunks */
|
||||||
int nstlist # number of steps before pairlist is generated */
|
gmx_int64_t init_step # start at a stepcount >0 (used w. convert-tpr) */
|
||||||
int ndelta # number of cells per rlong */
|
int nstcalcenergy # frequency of energy calc. and T/P coupl. upd. */
|
||||||
int nstcomm # number of steps after which center of mass */
|
int cutoff_scheme # group or verlet cutoffs */
|
||||||
# motion is removed */
|
int ns_type # which ns method should we use? */
|
||||||
int comm_mode # Center of mass motion removal algorithm */
|
int nstlist # number of steps before pairlist is generated */
|
||||||
int nstlog # number of steps after which print to logfile */
|
int ndelta # number of cells per rlong */
|
||||||
int nstxout # number of steps after which X is output */
|
int nstcomm # number of steps after which center of mass */
|
||||||
int nstvout # id. for V */
|
# motion is removed */
|
||||||
int nstfout # id. for F */
|
int comm_mode # Center of mass motion removal algorithm */
|
||||||
int nstenergy # number of steps after which energies printed */
|
int nstlog # number of steps after which print to logfile */
|
||||||
int nstxout_compressed # id. for compressed trj (.xtc,.tng) */
|
int nstxout # number of steps after which X is output */
|
||||||
double init_t # initial time (ps) */
|
int nstvout # id. for V */
|
||||||
double delta_t # time step (ps) */
|
int nstfout # id. for F */
|
||||||
double x_compression_precision # precision of x in compressed trajectory file */
|
int nstenergy # number of steps after which energies printed */
|
||||||
double fourier_spacing # requested fourier_spacing, when nk? not set */
|
int nstxout_compressed # id. for compressed trj (.xtc,.tng) */
|
||||||
int nkx, nky, nkz # number of k vectors in each spatial dimension*/
|
double init_t # initial time (ps) */
|
||||||
# for fourier methods for long range electrost.*/
|
double delta_t # time step (ps) */
|
||||||
int pme_order # interpolation order for PME */
|
real x_compression_precision # precision of x in compressed trajectory file */
|
||||||
double ewald_rtol # double space tolerance for Ewald, determines */
|
real fourier_spacing # requested fourier_spacing, when nk? not set */
|
||||||
# the double/reciprocal space relative weight */
|
int nkx, nky, nkz # number of k vectors in each spatial dimension*/
|
||||||
double ewald_rtol_lj # double space tolerance for LJ-Ewald */
|
# for fourier methods for long range electrost.*/
|
||||||
int ewald_geometry # normal/3d ewald, or pseudo-2d LR corrections */
|
int pme_order # interpolation order for PME */
|
||||||
double epsilon_surface # Epsilon for PME dipole correction */
|
real ewald_rtol # Real space tolerance for Ewald, determines */
|
||||||
int ljpme_combination_rule # Type of combination rule in LJ-PME */
|
# the real/reciprocal space relative weight */
|
||||||
int ePBC # Type of periodic boundary conditions */
|
real ewald_rtol_lj # Real space tolerance for LJ-Ewald */
|
||||||
int bPeriodicMols # Periodic molecules */
|
int ewald_geometry # normal/3d ewald, or pseudo-2d LR corrections */
|
||||||
bint bContinuation # Continuation run: starting state is correct */
|
real epsilon_surface # Epsilon for PME dipole correction */
|
||||||
int etc # temperature coupling */
|
int ljpme_combination_rule # Type of combination rule in LJ-PME */
|
||||||
int nsttcouple # interval in steps for temperature coupling */
|
int ePBC # Type of periodic boundary conditions */
|
||||||
bint bPrintNHChains # whether to print nose-hoover chains */
|
int bPeriodicMols # Periodic molecules */
|
||||||
int epc # pressure coupling */
|
gmx_bool bContinuation # Continuation run: starting state is correct */
|
||||||
int epct # pressure coupling type */
|
int etc # temperature coupling */
|
||||||
int nstpcouple # interval in steps for pressure coupling */
|
int nsttcouple # interval in steps for temperature coupling */
|
||||||
double tau_p # pressure coupling time (ps) */
|
gmx_bool bPrintNHChains # whether to print nose-hoover chains */
|
||||||
tensor ref_p # reference pressure (kJ/(mol nm^3)) */
|
int epc # pressure coupling */
|
||||||
tensor compress # compressability ((mol nm^3)/kJ) */
|
int epct # pressure coupling type */
|
||||||
int refcoord_scaling # How to scale absolute reference coordinates */
|
int nstpcouple # interval in steps for pressure coupling */
|
||||||
rvec posres_com # The COM of the posres atoms */
|
real tau_p # pressure coupling time (ps) */
|
||||||
rvec posres_comB # The B-state COM of the posres atoms */
|
tensor ref_p # reference pressure (kJ/(mol nm^3)) */
|
||||||
int andersen_seed # Random seed for Andersen thermostat (obsolete) */
|
tensor compress # compressability ((mol nm^3)/kJ) */
|
||||||
double verletbuf_tol # Per atom pair energy drift tolerance (kJ/mol/ps/atom) for list buffer */
|
int refcoord_scaling # How to scale absolute reference coordinates */
|
||||||
double rlist # short range pairlist cut-off (nm) */
|
rvec posres_com # The COM of the posres atoms */
|
||||||
double rtpi # Radius for test particle insertion */
|
rvec posres_comB # The B-state COM of the posres atoms */
|
||||||
int coulombtype # Type of electrostatics treatment */
|
int andersen_seed # Random seed for Andersen thermostat (obsolete) */
|
||||||
int coulomb_modifier # Modify the Coulomb interaction */
|
real verletbuf_tol # Per atom pair energy drift tolerance (kJ/mol/ps/atom) for list buffer */
|
||||||
double rcoulomb_switch # Coulomb switch range start (nm) */
|
real rlist # short range pairlist cut-off (nm) */
|
||||||
double rcoulomb # Coulomb cutoff (nm) */
|
real rtpi # Radius for test particle insertion */
|
||||||
double epsilon_r # relative dielectric constant */
|
int coulombtype # Type of electrostatics treatment */
|
||||||
double epsilon_rf # relative dielectric constant of the RF */
|
int coulomb_modifier # Modify the Coulomb interaction */
|
||||||
int implicit_solvent # No (=explicit water), or GBSA solvent models */
|
real rcoulomb_switch # Coulomb switch range start (nm) */
|
||||||
int gb_algorithm # Algorithm to use for calculation Born radii */
|
real rcoulomb # Coulomb cutoff (nm) */
|
||||||
int nstgbradii # Frequency of updating Generalized Born radii */
|
real epsilon_r # relative dielectric constant */
|
||||||
double rgbradii # Cutoff for GB radii calculation */
|
real epsilon_rf # relative dielectric constant of the RF */
|
||||||
double gb_saltconc # Salt concentration (M) for GBSA models */
|
int implicit_solvent # No (=explicit water), or GBSA solvent models */
|
||||||
double gb_epsilon_solvent # dielectric coeff. of implicit solvent */
|
int gb_algorithm # Algorithm to use for calculation Born radii */
|
||||||
double gb_obc_alpha # 1st scaling factor for Bashford-Case GB */
|
int nstgbradii # Frequency of updating Generalized Born radii */
|
||||||
double gb_obc_beta # 2nd scaling factor for Bashford-Case GB */
|
real rgbradii # Cutoff for GB radii calculation */
|
||||||
double gb_obc_gamma # 3rd scaling factor for Bashford-Case GB */
|
real gb_saltconc # Salt concentration (M) for GBSA models */
|
||||||
double gb_dielectric_offset # Dielectric offset for Still/HCT/OBC */
|
real gb_epsilon_solvent # dielectric coeff. of implicit solvent */
|
||||||
int sa_algorithm # Algorithm for SA part of GBSA */
|
real gb_obc_alpha # 1st scaling factor for Bashford-Case GB */
|
||||||
double sa_surface_tension # Energy factor for SA part of GBSA */
|
real gb_obc_beta # 2nd scaling factor for Bashford-Case GB */
|
||||||
int vdwtype # Type of Van der Waals treatment */
|
real gb_obc_gamma # 3rd scaling factor for Bashford-Case GB */
|
||||||
int vdw_modifier # Modify the VdW interaction */
|
real gb_dielectric_offset # Dielectric offset for Still/HCT/OBC */
|
||||||
double rvdw_switch # Van der Waals switch range start (nm) */
|
int sa_algorithm # Algorithm for SA part of GBSA */
|
||||||
double rvdw # Van der Waals cutoff (nm) */
|
real sa_surface_tension # Energy factor for SA part of GBSA */
|
||||||
int eDispCorr # Perform Long range dispersion corrections */
|
int vdwtype # Type of Van der Waals treatment */
|
||||||
double tabext # Extension of the table beyond the cut-off, *
|
int vdw_modifier # Modify the VdW interaction */
|
||||||
# * as well as the table length for 1-4 interac. */
|
real rvdw_switch # Van der Waals switch range start (nm) */
|
||||||
double shake_tol # tolerance for shake */
|
real rvdw # Van der Waals cutoff (nm) */
|
||||||
int efep # free energy calculations */
|
int eDispCorr # Perform Long range dispersion corrections */
|
||||||
t_lambda *fepvals # Data for the FEP state */
|
real tabext # Extension of the table beyond the cut-off, *
|
||||||
bint bSimTemp # Whether to do simulated tempering */
|
# * as well as the table length for 1-4 interac. */
|
||||||
t_simtemp *simtempvals # Variables for simulated tempering */
|
real shake_tol # tolerance for shake */
|
||||||
bint bExpanded # Whether expanded ensembles are used */
|
int efep # free energy calculations */
|
||||||
t_expanded *expandedvals # Expanded ensemble parameters */
|
t_lambda *fepvals # Data for the FEP state */
|
||||||
int eDisre # Type of distance restraining */
|
gmx_bool bSimTemp # Whether to do simulated tempering */
|
||||||
double dr_fc # force constant for ta_disre */
|
t_simtemp *simtempvals # Variables for simulated tempering */
|
||||||
int eDisreWeighting # type of weighting of pairs in one restraints */
|
gmx_bool bExpanded # Whether expanded ensembles are used */
|
||||||
bint bDisreMixed # Use comb of time averaged and instan. viol's */
|
t_expanded *expandedvals # Expanded ensemble parameters */
|
||||||
int nstdisreout # frequency of writing pair distances to enx */
|
int eDisre # Type of distance restraining */
|
||||||
double dr_tau # time constant for memory function in disres */
|
real dr_fc # force constant for ta_disre */
|
||||||
double orires_fc # force constant for orientational restraints */
|
int eDisreWeighting # type of weighting of pairs in one restraints */
|
||||||
double orires_tau # time constant for memory function in orires */
|
gmx_bool bDisreMixed # Use comb of time averaged and instan. viol's */
|
||||||
int nstorireout # frequency of writing tr(SD) to enx */
|
int nstdisreout # frequency of writing pair distances to enx */
|
||||||
double em_stepsize # The stepsize for updating */
|
real dr_tau # time constant for memory function in disres */
|
||||||
double em_tol # The tolerance */
|
real orires_fc # force constant for orientational restraints */
|
||||||
int niter # Number of iterations for convergence of */
|
real orires_tau # time constant for memory function in orires */
|
||||||
# steepest descent in relax_shells */
|
int nstorireout # frequency of writing tr(SD) to enx */
|
||||||
double fc_stepsize # Stepsize for directional minimization */
|
real em_stepsize # The stepsize for updating */
|
||||||
# in relax_shells */
|
real em_tol # The tolerance */
|
||||||
int nstcgsteep # number of steps after which a steepest */
|
int niter # Number of iterations for convergence of */
|
||||||
# descents step is done while doing cg */
|
# steepest descent in relax_shells */
|
||||||
int nbfgscorr # Number of corrections to the hessian to keep */
|
real fc_stepsize # Stepsize for directional minimization */
|
||||||
int eConstrAlg # Type of constraint algorithm */
|
# in relax_shells */
|
||||||
int nProjOrder # Order of the LINCS Projection Algorithm */
|
int nstcgsteep # number of steps after which a steepest */
|
||||||
double LincsWarnAngle # If bond rotates more than %g degrees, warn */
|
# descents step is done while doing cg */
|
||||||
int nLincsIter # Number of iterations in the final Lincs step */
|
int nbfgscorr # Number of corrections to the hessian to keep */
|
||||||
bint bShakeSOR # Use successive overrelaxation for shake */
|
int eConstrAlg # Type of constraint algorithm */
|
||||||
double bd_fric # Friction coefficient for BD (amu/ps) */
|
int nProjOrder # Order of the LINCS Projection Algorithm */
|
||||||
int ld_seed # Random seed for SD and BD */
|
real LincsWarnAngle # If bond rotates more than %g degrees, warn */
|
||||||
int nwall # The number of walls */
|
int nLincsIter # Number of iterations in the final Lincs step */
|
||||||
int wall_type # The type of walls */
|
gmx_bool bShakeSOR # Use successive overrelaxation for shake */
|
||||||
double wall_r_linpot # The potentail is linear for r<=wall_r_linpot */
|
real bd_fric # Friction coefficient for BD (amu/ps) */
|
||||||
int wall_atomtype[2] # The atom type for walls */
|
gmx_int64_t ld_seed # Random seed for SD and BD */
|
||||||
double wall_density[2] # Number density for walls */
|
int nwall # The number of walls */
|
||||||
double wall_ewald_zfac # Scaling factor for the box for Ewald */
|
int wall_type # The type of walls */
|
||||||
|
real wall_r_linpot # The potentail is linear for r<=wall_r_linpot */
|
||||||
|
int wall_atomtype[2] # The atom type for walls */
|
||||||
|
real wall_density[2] # Number density for walls */
|
||||||
|
real wall_ewald_zfac # Scaling factor for the box for Ewald */
|
||||||
|
|
||||||
# COM pulling data */
|
# COM pulling data */
|
||||||
bint bPull # Do we do COM pulling? */
|
# gmx_bool bPull # Do we do COM pulling? */
|
||||||
#struct pull_params_t *pull # The data for center of mass pulling */
|
# struct pull_params_t *pull # The data for center of mass pulling */
|
||||||
#struct pull_t *pull_work # The COM pull force calculation data structure TODO this pointer should live somewhere else */
|
# TODO: Remove this by converting pull into a ForceProvider
|
||||||
|
# struct pull_t *pull_work # The COM pull force calculation data structure */
|
||||||
|
|
||||||
|
# AWH bias data */
|
||||||
|
gmx_bool bDoAwh # Use awh biasing for PMF calculations? */
|
||||||
|
# gmx::AwhParams *awhParams # AWH biasing parameters */
|
||||||
|
# TODO: Remove this by converting AWH into a ForceProvider
|
||||||
|
# gmx::Awh *awh # AWH work object */
|
||||||
|
|
||||||
# Enforced rotation data */
|
# Enforced rotation data */
|
||||||
bint bRot # Calculate enforced rotation potential(s)? */
|
gmx_bool bRot # Calculate enforced rotation potential(s)? */
|
||||||
t_rot *rot # The data for enforced rotation potentials */
|
t_rot *rot # The data for enforced rotation potentials */
|
||||||
|
|
||||||
int eSwapCoords # Do ion/water position exchanges (CompEL)? */
|
int eSwapCoords # Do ion/water position exchanges (CompEL)? */
|
||||||
t_swapcoords *swap
|
t_swapcoords *swap
|
||||||
|
|
||||||
bint bIMD # Allow interactive MD sessions for this .tpr? */
|
gmx_bool bIMD # Allow interactive MD sessions for this .tpr? */
|
||||||
t_IMD *imd # Interactive molecular dynamics */
|
t_IMD *imd # Interactive molecular dynamics */
|
||||||
|
|
||||||
double cos_accel # Acceleration for viscosity calculation */
|
real cos_accel # Acceleration for viscosity calculation */
|
||||||
tensor deform # Triclinic deformation velocities (nm/ps) */
|
tensor deform # Triclinic deformation velocities (nm/ps) */
|
||||||
int userint1 # User determined parameters */
|
int userint1 # User determined parameters */
|
||||||
int userint2
|
int userint2
|
||||||
int userint3
|
int userint3
|
||||||
int userint4
|
int userint4
|
||||||
double userdouble1
|
real userreal1
|
||||||
double userdouble2
|
real userreal2
|
||||||
double userdouble3
|
real userreal3
|
||||||
double userdouble4
|
real userreal4
|
||||||
t_grpopts opts # Group options */
|
t_grpopts opts # Group options */
|
||||||
t_cosines ex[0] # Electric field stuff (spatial part) */
|
gmx_bool bQMMM # QM/MM calculation */
|
||||||
t_cosines et[0] # Electric field stuff (time part) */
|
int QMconstraints # constraints on QM bonds */
|
||||||
bint bQMMM # QM/MM calculation */
|
int QMMMscheme # Scheme: ONIOM or normal */
|
||||||
int QMconstraints # constraints on QM bonds */
|
real scalefactor # factor for scaling the MM charges in QM calc.*/
|
||||||
int QMMMscheme # Scheme: ONIOM or normal */
|
|
||||||
double scalefactor # factor for scaling the MM charges in QM calc.*/
|
|
||||||
|
|
||||||
# Fields for removed features go here (better caching) */
|
# Fields for removed features go here (better caching) */
|
||||||
bint bAdress # Whether AdResS is enabled - always false if a valid .tpr was read
|
gmx_bool bAdress # Whether AdResS is enabled - always false if a valid .tpr was read
|
||||||
bint useTwinRange # Whether twin-range scheme is active - always false if a valid .tpr was read
|
gmx_bool useTwinRange # Whether twin-range scheme is active - always false if a valid .tpr was read
|
||||||
|
|
||||||
|
# gmx::KeyValueTreeObject *params
|
||||||
|
107
pygmx/topology.pxd
Normal file → Executable file
107
pygmx/topology.pxd
Normal file → Executable file
@ -7,22 +7,22 @@ from mdtypes cimport *
|
|||||||
|
|
||||||
cdef extern from "gromacs/topology/atoms.h":
|
cdef extern from "gromacs/topology/atoms.h":
|
||||||
ctypedef struct t_atom:
|
ctypedef struct t_atom:
|
||||||
real m, q; # Mass and charge */
|
real m, q # Mass and charge */
|
||||||
real mB, qB; # Mass and charge for Free Energy calc */
|
real mB, qB # Mass and charge for Free Energy calc */
|
||||||
unsigned short type; # Atom type */
|
unsigned short type # Atom type */
|
||||||
unsigned short typeB; # Atom type for Free Energy calc */
|
unsigned short typeB # Atom type for Free Energy calc */
|
||||||
int ptype; # Particle type */
|
int ptype # Particle type */
|
||||||
int resind; # Index into resinfo (in t_atoms) */
|
int resind # Index into resinfo (in t_atoms) */
|
||||||
int atomnumber; # Atomic Number or 0 */
|
int atomnumber # Atomic Number or 0 */
|
||||||
char elem[4]; # Element name */
|
char elem[4] # Element name */
|
||||||
|
|
||||||
ctypedef struct t_resinfo:
|
ctypedef struct t_resinfo:
|
||||||
char **name; # Pointer to the residue name */
|
char **name # Pointer to the residue name */
|
||||||
int nr; # Residue number */
|
int nr # Residue number */
|
||||||
unsigned char ic; # Code for insertion of residues */
|
unsigned char ic # Code for insertion of residues */
|
||||||
int chainnum; # Iincremented at TER or new chain id */
|
int chainnum # Iincremented at TER or new chain id */
|
||||||
char chainid; # Chain identifier written/read to pdb */
|
char chainid # Chain identifier written/read to pdb */
|
||||||
char **rtp; # rtp building block name (optional) */
|
char **rtp # rtp building block name (optional) */
|
||||||
|
|
||||||
ctypedef struct t_pdbinfo:
|
ctypedef struct t_pdbinfo:
|
||||||
pass
|
pass
|
||||||
@ -46,8 +46,8 @@ cdef extern from "gromacs/topology/atoms.h":
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
ctypedef struct t_grps:
|
ctypedef struct t_grps:
|
||||||
int nr; # Number of different groups */
|
int nr # Number of different groups */
|
||||||
int *nm_ind; # Index in the group names */
|
int *nm_ind # Index in the group names */
|
||||||
|
|
||||||
#ctypedef t_atoms *t_atoms_ptr
|
#ctypedef t_atoms *t_atoms_ptr
|
||||||
|
|
||||||
@ -57,7 +57,10 @@ cdef extern from "gromacs/topology/symtab.h":
|
|||||||
|
|
||||||
cdef extern from "gromacs/topology/block.h":
|
cdef extern from "gromacs/topology/block.h":
|
||||||
ctypedef struct t_block:
|
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:
|
ctypedef struct t_blocka:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -65,8 +68,8 @@ cdef extern from "gromacs/topology/idef.h":
|
|||||||
ctypedef struct t_ilist:
|
ctypedef struct t_ilist:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
cdef enum t_ft_enum:
|
#cdef enum t_ft_enum:
|
||||||
F_LJ
|
# F_LJ
|
||||||
|
|
||||||
ctypedef union t_iparams:
|
ctypedef union t_iparams:
|
||||||
pass
|
pass
|
||||||
@ -77,13 +80,13 @@ cdef extern from "gromacs/topology/idef.h":
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
ctypedef struct gmx_ffparams_t:
|
ctypedef struct gmx_ffparams_t:
|
||||||
int ntypes;
|
int ntypes
|
||||||
int atnr;
|
int atnr
|
||||||
t_functype *functype;
|
t_functype *functype
|
||||||
t_iparams *iparams;
|
t_iparams *iparams
|
||||||
double reppow; # The repulsion power for VdW: C12*r^-reppow */
|
double reppow # The repulsion power for VdW: C12*r^-reppow */
|
||||||
real fudgeQQ; # The scaling factor for Coulomb 1-4: f*q1*q2 */
|
real fudgeQQ # The scaling factor for Coulomb 1-4: f*q1*q2 */
|
||||||
gmx_cmap_t cmap_grid; # The dihedral correction maps */
|
gmx_cmap_t cmap_grid # The dihedral correction maps */
|
||||||
|
|
||||||
|
|
||||||
void pr_ffparams(FILE *fp, int indent, const char *title,
|
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":
|
cdef extern from "gromacs/topology/topology.h":
|
||||||
ctypedef struct gmx_moltype_t:
|
ctypedef struct gmx_moltype_t:
|
||||||
char **name; # Name of the molecule type */
|
char **name # Name of the molecule type */
|
||||||
t_atoms atoms; # The atoms in this molecule */
|
t_atoms atoms # The atoms in this molecule */
|
||||||
t_ilist ilist[0]; # Interaction list with local indices */
|
t_ilist ilist[0] # Interaction list with local indices */
|
||||||
t_block cgs; # The charge groups */
|
t_block cgs # The charge groups */
|
||||||
t_blocka excls; # The exclusions */
|
t_blocka excls # The exclusions */
|
||||||
|
|
||||||
ctypedef struct gmx_molblock_t:
|
ctypedef struct gmx_molblock_t:
|
||||||
int type; # The molcule type index in mtop.moltype */
|
int type #*< The molecule type index in mtop.moltype */
|
||||||
int nmol; # The number of molecules in this block */
|
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 */
|
||||||
int nposres_xA; # The number of posres coords for top A */
|
rvec *posres_xA #*< Position restraint coordinates for top A */
|
||||||
rvec *posres_xA; # The posres coords for top A */
|
int nposres_xB #*< The number of posres coords for top B */
|
||||||
int nposres_xB; # The number of posres coords for top B */
|
rvec *posres_xB #*< Position restraint coordinates for top B */
|
||||||
rvec *posres_xB; # The posres coords 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:
|
ctypedef struct gmx_groups_t:
|
||||||
pass
|
pass
|
||||||
@ -115,24 +124,24 @@ cdef extern from "gromacs/topology/topology.h":
|
|||||||
# unsigned char *grpnr[0] # Group numbers or NULL */
|
# unsigned char *grpnr[0] # Group numbers or NULL */
|
||||||
|
|
||||||
ctypedef struct gmx_mtop_t:
|
ctypedef struct gmx_mtop_t:
|
||||||
char **name # Name of the topology */
|
char **name # Name of the topology */
|
||||||
gmx_ffparams_t ffparams
|
gmx_ffparams_t ffparams
|
||||||
int nmoltype
|
int nmoltype
|
||||||
gmx_moltype_t *moltype
|
gmx_moltype_t *moltype
|
||||||
int nmolblock
|
int nmolblock
|
||||||
gmx_molblock_t *molblock
|
gmx_molblock_t *molblock
|
||||||
bint bIntermolecularInteractions # Are there intermolecular
|
gmx_bool bIntermolecularInteractions # Are there intermolecular
|
||||||
# interactions? */
|
# * interactions? */
|
||||||
t_ilist *intermolecular_ilist # List of intermolecular interactions
|
t_ilist *intermolecular_ilist # List of intermolecular interactions
|
||||||
# using system wide atom indices,
|
# * using system wide atom indices,
|
||||||
# either NULL or size F_NRE */
|
# * either NULL or size F_NRE */
|
||||||
int natoms
|
int natoms
|
||||||
int maxres_renum # Parameter for residue numbering */
|
int maxres_renum # Parameter for residue numbering */
|
||||||
int maxresnr # The maximum residue number in moltype */
|
int maxresnr # The maximum residue number in moltype */
|
||||||
t_atomtypes atomtypes # Atomtype properties */
|
t_atomtypes atomtypes # Atomtype properties */
|
||||||
t_block mols # The molecules */
|
t_block mols # The molecules */
|
||||||
gmx_groups_t groups
|
gmx_groups_t groups
|
||||||
t_symtab symtab # The symbol table */
|
t_symtab symtab # The symbol table */
|
||||||
|
|
||||||
# cdef extern from "gromacs/topology/topology.h":
|
# cdef extern from "gromacs/topology/topology.h":
|
||||||
# generate a t_atoms struct for the system from gmx_mtop_t
|
# generate a t_atoms struct for the system from gmx_mtop_t
|
||||||
|
56
pygmx/tpxio.pyx
Normal file → Executable file
56
pygmx/tpxio.pyx
Normal file → Executable file
@ -34,7 +34,6 @@ cdef extern from "gromacs/fileio/tpxio.h":
|
|||||||
int *natoms,
|
int *natoms,
|
||||||
rvec *x,
|
rvec *x,
|
||||||
rvec *v,
|
rvec *v,
|
||||||
# rvec *f,
|
|
||||||
gmx_mtop_t *mtop)
|
gmx_mtop_t *mtop)
|
||||||
|
|
||||||
|
|
||||||
@ -89,11 +88,12 @@ cdef index_groups_from_topology(gmx_mtop_t *topology):
|
|||||||
|
|
||||||
|
|
||||||
cdef open_tpx(const char* filename, t_inputrec *ir, matrix box, int *natoms, gmx_mtop_t *top):
|
cdef open_tpx(const char* filename, t_inputrec *ir, matrix box, int *natoms, gmx_mtop_t *top):
|
||||||
#cdef stdio.FILE *old_stderr = stdio.stderr
|
|
||||||
#stdio.stderr = stdio.freopen('tmp', 'w', stdio.stderr)
|
# unterdrücke GMX output durch internen stderr buffer...
|
||||||
cdef char buffer[stdio.BUFSIZ]
|
cdef char buffer[stdio.BUFSIZ]
|
||||||
stdio.setbuf(stdio.stderr, buffer)
|
stdio.setbuf(stdio.stderr, buffer)
|
||||||
return_code = read_tpx(filename, ir, box, natoms, NULL, NULL, top)
|
cdef rvec *x, *v
|
||||||
|
return_code = read_tpx(filename, ir, box, natoms, x, v, top)
|
||||||
|
|
||||||
for i in range(stdio.BUFSIZ):
|
for i in range(stdio.BUFSIZ):
|
||||||
buffer[i] = 0
|
buffer[i] = 0
|
||||||
@ -194,29 +194,39 @@ cdef class TPXReader:
|
|||||||
types += mol_type * nmol
|
types += mol_type * nmol
|
||||||
return np.array(types)
|
return np.array(types)
|
||||||
|
|
||||||
@property
|
property molecules:
|
||||||
def nsteps(self):
|
"Get molecule indices from topology."
|
||||||
return self.input_record.nsteps
|
def __get__(self):
|
||||||
|
mols = [0] * self.n_atoms
|
||||||
|
molid = 0
|
||||||
|
for i in range(self.topology.mols.nr):
|
||||||
|
molid += 1
|
||||||
|
for j in range(self.topology.mols.index[i], self.topology.mols.index[i+1]):
|
||||||
|
mols[j] = molid
|
||||||
|
return mols
|
||||||
|
# @property
|
||||||
|
# def nsteps(self):
|
||||||
|
# return self.input_record.nsteps
|
||||||
|
|
||||||
@property
|
# @property
|
||||||
def nstxout(self):
|
# def nstxout(self):
|
||||||
return self.input_record.nstxout
|
# return self.input_record.nstxout
|
||||||
|
|
||||||
@property
|
# @property
|
||||||
def nstvout(self):
|
# def nstvout(self):
|
||||||
return self.input_record.nstvout
|
# return self.input_record.nstvout
|
||||||
|
|
||||||
@property
|
# @property
|
||||||
def nstfout(self):
|
# def nstfout(self):
|
||||||
return self.input_record.nstfout
|
# return self.input_record.nstfout
|
||||||
|
|
||||||
@property
|
# @property
|
||||||
def nstxout_compressed(self):
|
# def nstxout_compressed(self):
|
||||||
return self.input_record.nstxout_compressed
|
# return self.input_record.nstxout_compressed
|
||||||
|
|
||||||
@property
|
# @property
|
||||||
def nstenergy(self):
|
# def nstenergy(self):
|
||||||
return self.input_record.nstenergy
|
# return self.input_record.nstenergy
|
||||||
|
|
||||||
|
|
||||||
def read_ff(self):
|
def read_ff(self):
|
||||||
@ -235,7 +245,7 @@ cdef class TPXReader:
|
|||||||
# cdef np.ndarray[real, ndim=2] forces = 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)
|
||||||
open_tpx(
|
open_tpx(
|
||||||
<char *>filename,
|
<char *>filename,
|
||||||
&self.input_record,
|
NULL,
|
||||||
self.box,
|
self.box,
|
||||||
&self.n_atoms,
|
&self.n_atoms,
|
||||||
&self.topology
|
&self.topology
|
||||||
|
2
setup.py
Normal file → Executable file
2
setup.py
Normal file → Executable file
@ -27,7 +27,7 @@ if 'gromacs' in os.environ.get('LD_LIBRARY_PATH', ''):
|
|||||||
if os.path.exists(include):
|
if os.path.exists(include):
|
||||||
include_dirs.append(include)
|
include_dirs.append(include)
|
||||||
check_header_version(include)
|
check_header_version(include)
|
||||||
|
# übergebe library_dirs, damit beim linken die richtige version gefunden wird
|
||||||
extensions = [
|
extensions = [
|
||||||
Extension(
|
Extension(
|
||||||
'pygmx.gromacs.coordinates',
|
'pygmx.gromacs.coordinates',
|
||||||
|
Reference in New Issue
Block a user