OSDN Git Service

The DISPATOM parameters are renamed to ELEMENT, to avoid confusion. The Ruby commands...
[molby/Molby.git] / MolLib / Dcd.h
1 /*
2  *  Dcd.h
3  *  Molby
4  *
5  *  Created by Toshi Nagata on 09/01/20.
6  *  Copyright 2009 Toshi Nagata. All rights reserved.
7  *
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.
11  
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.
16  */
17
18 #ifndef __DCD_H__
19 #define __DCD_H__
20
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include <unistd.h>
25 #include <fcntl.h>
26 #include <ctype.h>
27 #include <math.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32                 
33 typedef int Int32;
34 typedef float SFloat32;
35
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  */
48 } DcdRecord;
49
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);
55
56 #ifdef __cplusplus
57 }
58 #endif
59
60 #endif /* __DCD_H__ */