/* _______________________________________________________________________ * * RDPARM/PTRAJ: APR 2000 * _______________________________________________________________________ * * $Header: /thr/gamow/cvsroot/amber7/src/ptraj/trajectory.h,v 1.5 2000/05/10 21:52:02 cheatham Exp $ * * Revision: $Revision: 1.5 $ * Date: $Date: 2000/05/10 21:52:02 $ * Last checked in by $Author: cheatham $ * * This source is now archived under CVS at Scripps in the amber7 tree. * * NOTE: this is a beta, pre-release version, is under constant development, * probably contains some bugs and is under constant revision; therefore * take care. Please report bugs (and fixes!) to cheatham@chpc.utah.edu or * cheatham@cgl.ucsf.edu * * Do not distribute this code without explicit permission. * Do not incorporate into other codes without explicit permission. * * Current contact information: * * Thomas Cheatham, III * 2000 East, 30 South, Skaggs Hall 201 * Department of Medicinal Chemistry * University of Utah * Salt Lake City, UT 84112-5820 * cheatham@chpc.utah.edu * (801) 587-9653 * FAX: (801) 585-5366 * * Other contributors: * * David Case (Scripps) * Michael Crowley (Scripps) * Jed Pitera (UCSF) * Vickie Tsui (Scripps) * _______________________________________________________________________ */ /* * header file for trajectory.c */ /* * possible coordinate types */ typedef enum _coordType { COORD_UNKNOWN, COORD_AMBER_TRAJECTORY, COORD_AMBER_RESTART, COORD_PDB, COORD_BINPOS, COORD_CHARMM_TRAJECTORY } coordType; /* * information relating to a coordinate file */ typedef struct _coordinateInfo { FILE *file; char *filename; int start; int stop; int offset; int isBox; int isVelocity; int option1; int option2; int *mask; double *x; double *y; double *z; void *info; coordType type; } coordinateInfo; #define INITIALIZE_coordinateInfo(_p_) \ _p_->file = NULL; \ _p_->filename = NULL; \ _p_->start = 1; \ _p_->stop = -1; \ _p_->offset = 1; \ _p_->isBox = 0; \ _p_->isVelocity = 0; \ _p_->option1 = 0; \ _p_->option2 = 0; \ _p_->mask = NULL; \ _p_->x = NULL; \ _p_->y = NULL; \ _p_->z = NULL; \ _p_->info = NULL; \ _p_->type = COORD_UNKNOWN /* * union structures for binary I/O, i.e. read in as bytes which can be * interpreted as float or integer */ typedef union _byte { char c[4]; int i; float f; } byte; typedef union _bytebyte { char c[8]; double d; } bytebyte; typedef struct _charmmTrajectoryInfo { int byteorder; /* endian-ness, 1:LITTLE or [3][2][1][0]; 0:BIG or [0][1][2][3] */ byte magic; /* the magic header, should be "CORD" */ int icntrl[20]; /* the control variables */ int ntitle; /* the number of title lines */ stackType *titleStack; /* a stack for the title */ int natrec; /* the number of written atom records */ int nfreat; /* the number of free atoms */ int *freeat; /* a list of the free atoms */ double xtlabc[6]; /* the crystal information in XTLABC form */ double *fixedx; /* fixed atom coords */ double *fixedy; /* fixed atom coords */ double *fixedz; /* fixed atom coords */ } charmmTrajectoryInfo; #define INITIALIZE_charmmTrajectoryInfo( _p_ ) \ _p_->byteorder = 0; \ _p_->magic.i = 0; \ _p_->titleStack = NULL; \ _p_->natrec = 0; \ _p_->nfreat = 0; \ _p_->freeat = NULL; \ _p_->fixedx = NULL; \ _p_->fixedy = NULL; \ _p_->fixedz = NULL #ifndef TRAJECTORY_MODULE # ifdef __STDC__ extern Restart * readAmberRestart(int, char *, FILE *); extern int getCoordinatesFromRestart(FILE *, double *, double *, double *, double *, double *, double *, double *, double *, double *); extern int getCoordinatesFromPdb(pdb_record *, double *, double *, double *); extern void dumpAmberRestart(FILE *, int, double *, double *, double *, double *, double *, double *, double *); extern void writeAmberRestart(Restart *, char *, FILE *); extern int loadPdb(FILE *, pdb_record **); extern void savePdb(FILE *, pdb_record *); extern pdb_record *parmToPdb(Parm *, int *); extern pdb_record *ptrajStateToPdb(ptrajState *, int *, int); extern void putCoordinatesInPdb(pdb_record *, int, double *, double *, double *); extern int readAmberTrajectory(FILE *, int, double *, double *, double *, double *, int, int); extern void dumpAmberTrajectory(FILE *, int, double *, double *, double *, double *); extern void writebinpos(FILE *, int, double *, double *, double *); extern int openbinpos(); extern int readbinpos(FILE *, int *, float *, int *); extern int readCharmmTrajectory(FILE *, charmmTrajectoryInfo **, double *, double *, double *, double *, int); extern void dumpCharmmTrajectory(FILE *, charmmTrajectoryInfo *, int, double *, double *, double *, double *, int); extern void printString(void *); # else extern Restart * readAmberRestart(); extern int getCoordinatesFromRestart(); extern int getCoordinatesFromPdb(); extern void dumpAmberRestart(); extern void writeAmberRestart(); extern int loadPdb(); extern void savePdb(); extern pdb_record *parmToPdb(); extern pdb_record *ptrajStateToPdb(); extern putCoordinatesInPdb(); extern int readAmberTrajectory(); extern void dumpAmberTrajectory(); extern void writebinpos(); extern int openbinpos(); extern int readbinpos(); extern int readCharmmTrajectory(); extern void dumpCharmmTrajectory(); extern void printString(); # endif #endif