Main Page | Class List | File List | Class Members | File Members

param.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004-2005 by David J. Hardy.  All rights reserved.
00003  */
00004 
00020 #ifndef MDIO_PARAM_H
00021 #define MDIO_PARAM_H
00022 
00023 #include "adt/list.h"
00024 #include "adt/table.h"
00025 #include "mdio/file.h"
00026 #include "mdapi/mdtypes.h"
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00032   /*
00033    * Set the "filetype" field to identify the type of parameter files.
00034    * Must permit param files of only a single type, because the
00035    * interpretation of PSF depends on the type of param files read.
00036    *
00037    * Specifically, X-Plor dihedral multiplicities are determined both by
00038    * how many terms are read from param file and the number of times that
00039    * a dihedral interaction is repeated in the PSF.  For example, a set of
00040    * dihedral parameters of multiplicity 3 may be read in from the param
00041    * file, but if a dihedral interaction using that set of parameters is
00042    * listed only once in the PSF, then that dihedral is treated as having
00043    * multiplicity 1, using just the first term read from the param file.
00044    *
00045    * For the first parameter file reading, X-Plor format is assumed.
00046    * If the first non-white char is '*', then MDIO_PARAM_CHARMM is
00047    * returned and an attempt is made to read as CHARMM parameter file.
00048    */
00049   enum { MDIO_PARAM_XPLOR = 1, MDIO_PARAM_CHARMM = 2 };
00050 
00051 
00056   typedef struct mdio_Param_t {
00057     mdio_File file;
00058     adt_List atomprm;
00059     adt_List bondprm;
00060     adt_List angleprm;
00061     adt_List dihedprm;
00062     adt_List imprprm;
00063     adt_List nbfixprm;
00064     adt_Table tokentable;
00065     char *token;
00066     char *buffer;
00067     int bufferlen;
00068     int tokenflags;
00069     char tokenfmt[32];
00070     char *startbuf;
00071     int filetype;
00072   } mdio_Param;
00073 
00074 
00075 /* constructor and destructor */
00076 
00083   mdio_Param *mdio_createParam(void);
00084 
00085 
00094   void mdio_destroyParam(mdio_Param *);
00095 
00096 
00097 /* reading parameter files and obtaining parsed data */
00098 
00111   int mdio_readParam(mdio_Param *, const char *name);
00112 
00113 
00120   MD_AtomPrm *mdio_getAtomParam(mdio_Param *, int *nelems);
00121 
00122 
00129   MD_BondPrm *mdio_getBondParam(mdio_Param *, int *nelems);
00130 
00131 
00138   MD_AnglePrm *mdio_getAngleParam(mdio_Param *, int *nelems);
00139 
00140 
00147   MD_TorsPrm *mdio_getDihedParam(mdio_Param *, int *nelems);
00148 
00149 
00156   MD_TorsPrm *mdio_getImprParam(mdio_Param *, int *nelems);
00157 
00158 
00168   MD_NbfixPrm *mdio_getNbfixParam(mdio_Param *, int *nelems);
00169 
00170 
00171 /* constructor and destructor for preallocated mdio_Param object */
00172 
00178   int mdio_initializeParam(mdio_Param *);
00179 
00180 
00186   void mdio_cleanupParam(mdio_Param *);
00187 
00188 #ifdef __cplusplus
00189 }
00190 #endif
00191 
00192 #endif /* MDIO_PARAM_H */

Generated on Thu Feb 7 18:11:40 2008 for MDX by  doxygen 1.3.9.1