00001
00002
00003
00004
00028 #ifndef MDIO_DCD_H
00029 #define MDIO_DCD_H
00030
00031 #include "mdio/file.h"
00032 #include "mdapi/mdtypes.h"
00033
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037
00041 enum {
00042 MDIO_DCD_UNITCELL = 0x001,
00043 MDIO_DCD_FIXEDCELL = 0x002
00044 };
00045
00048 typedef struct mdio_DcdHeader_t {
00049 double timestep;
00050 int32 natoms;
00051 int32 firststep;
00052 int32 framestepcnt;
00053 int32 cellstatus;
00054 } mdio_DcdHeader;
00055
00058 typedef struct mdio_DcdCell_t {
00059 MD_Dvec vec1;
00060 MD_Dvec vec2;
00061 MD_Dvec vec3;
00062 } mdio_DcdCell;
00063
00068 typedef struct mdio_Dcd_t {
00069 mdio_File file;
00070 struct {
00071 int32 nbhead_begin;
00072 char title[4];
00073 int32 numframes;
00074 int32 firststep;
00075 int32 framestepcnt;
00076 int32 numsteps;
00077 int32 zero5[5];
00078 float timestep;
00079 int32 iscell;
00080 int32 zero8[8];
00081 int32 charmmversion;
00082 int32 nbhead_end;
00083
00084 int32 nbtitle_begin;
00085 int32 numtitle;
00086 char title_str[80];
00087 char create_str[80];
00088 int32 nbtitle_end;
00089
00090 int32 nbnatoms_begin;
00091 int32 natoms;
00092 int32 nbnatoms_end;
00093 } header;
00094 struct {
00095 int32 dummy1;
00096 int32 nbcell_begin;
00097 double unitcell[6];
00098 int32 nbcell_end;
00099 int32 dummy2;
00100 } cell;
00101 int32 *coordbuf;
00102 float *x;
00103 float *y;
00104 float *z;
00105 int32 coordbuflen;
00106 int32 nbcell;
00107 int32 stepnum;
00108 int32 status;
00109 } mdio_Dcd;
00110
00111
00112
00113
00120 mdio_Dcd *mdio_createDcd(void);
00121
00122
00127 void mdio_destroyDcd(mdio_Dcd *);
00128
00129
00130
00131
00140 int mdio_writeBeginDcd(mdio_Dcd *, const char *name);
00141
00142
00152 int mdio_writeHeaderDcd(mdio_Dcd *, const mdio_DcdHeader *header);
00153
00154
00170 int mdio_writeFrameDcd(mdio_Dcd *, const MD_Dvec *coord,
00171 const mdio_DcdCell *cell, int32 stepnum);
00172
00173
00181 int mdio_writeEndDcd(mdio_Dcd *);
00182
00183
00184
00185
00191 int mdio_initializeDcd(mdio_Dcd *);
00192
00193
00199 void mdio_cleanupDcd(mdio_Dcd *);
00200
00201 #ifdef __cplusplus
00202 }
00203 #endif
00204
00205 #endif