5 * Created by Toshi Nagata on 09/01/20.
6 * Copyright 2009 Toshi Nagata. All rights reserved.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation version 2 of the License.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
34 typedef float SFloat32;
36 typedef struct DcdRecord {
37 int fd; /* File descripter */
38 int reverse_endian; /* Need to reverse endian? */
39 Int32 natoms; /* Number of atoms */
40 Int32 nframes; /* Number of frames */
41 Int32 nstart; /* Start timestep */
42 Int32 ninterval; /* Number of timesteps between frames */
43 Int32 nend; /* Last timestep */
44 Int32 with_unitcell; /* Has a unit cell information? */
45 SFloat32 delta; /* Step time */
46 SFloat32 globalcell[6]; /* cell size and origin; used when with_unitcell == 0 */
47 off_t header_size; /* Header size */
50 int DcdOpen(const char *name, DcdRecord *dr);
51 int DcdCreate(const char *name, DcdRecord *dr);
52 int DcdClose(DcdRecord *dr);
53 int DcdReadFrame(DcdRecord *dr, int index, SFloat32 *xp, SFloat32 *yp, SFloat32 *zp, SFloat32 *cellp);
54 int DcdWriteFrame(DcdRecord *dr, int index, const SFloat32 *xp, const SFloat32 *yp, const SFloat32 *zp, const SFloat32 *cellp);
60 #endif /* __DCD_H__ */