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;
35 typedef double SFloat64;
37 typedef struct DcdRecord {
38 int fd; /* File descripter */
39 int reverse_endian; /* Need to reverse endian? */
40 Int32 natoms; /* Number of atoms */
41 Int32 nframes; /* Number of frames */
42 Int32 nstart; /* Start timestep */
43 Int32 ninterval; /* Number of timesteps between frames */
44 Int32 nend; /* Last timestep */
45 Int32 nfix; /* Number of fixed atoms */
46 Int32 n4dim; /* Charmm 4th dimension */
47 Int32 ncharmver; /* Charmm version */
48 Int32 nextra; /* Has Charmm extra block */
49 SFloat32 delta; /* Step time */
50 SFloat32 globalcell[6]; /* cell size and origin; used when with_unitcell == 0 */
51 off_t header_size; /* Header size */
52 off_t block_size; /* Block size (set after reading/writing the first frame) */
55 int DcdOpen(const char *name, DcdRecord *dr);
56 int DcdCreate(const char *name, DcdRecord *dr);
57 int DcdClose(DcdRecord *dr);
58 int DcdReadFrame(DcdRecord *dr, int index, SFloat32 *xp, SFloat32 *yp, SFloat32 *zp, SFloat32 *cellp);
59 int DcdWriteFrame(DcdRecord *dr, int index, const SFloat32 *xp, const SFloat32 *yp, const SFloat32 *zp, const SFloat32 *cellp);
65 #endif /* __DCD_H__ */