ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/ReadWrite.hpp
(Generate patch)

Comparing:
branches/mmeineke/OOPSE/libmdtools/ReadWrite.hpp (file contents), Revision 377 by mmeineke, Fri Mar 21 17:42:12 2003 UTC vs.
trunk/OOPSE/libmdtools/ReadWrite.hpp (file contents), Revision 829 by gezelter, Tue Oct 28 16:03:37 2003 UTC

# Line 1 | Line 1
1   #ifndef __READWRITE_H__
2   #define __READWRITE_H__
3  
4 + #define _FILE_OFFSET_BITS 64
5 +
6   #include <iostream>
7   #include <fstream>
8  
9 < #include <cstring>
10 < #include <cstdio>
11 < #include <cstdlib>
9 > #include <string.h>
10 > #include <stdio.h>
11 > #include <stdlib.h>
12 > #include <unistd.h>
13 > #include <sys/types.h>
14 > #include <sys/stat.h>
15  
16 +
17   #include "Atom.hpp"
18   #include "SimInfo.hpp"
19   #include "Thermo.hpp"
20  
21   using namespace std;
22  
23 + class FilePos{
24 +  
25 + public:
26 +  FilePos(){
27 +    myPos = NULL;
28 +    next = NULL;
29 +  }
30 +  FilePos( fpos_t* thePos ) {
31 +    myPos = thePos;
32 +    next = NULL;
33 +  }
34 +  ~FilePos(){
35 +    if( next  != NULL ) delete next;
36 +    if( myPos != NULL ) delete myPos;
37 +  }
38 +  
39 +  void add( fpos_t *thePos ){
40 +    if( next != NULL )
41 +      next->add( thePos );
42 +    else
43 +      next = new FilePos( thePos );
44 +  }
45 +  
46 +  FilePos &operator=(fpos_t *thePos){ myPos = thePos; return *this; }
47 +  
48 +  void setPos( fpos_t *thePos ){ myPos = thePos; }
49 +  fpos_t *getPos( void ){ return myPos; }
50 +  
51 +  FilePos* getNext( void ) { return next; }
52 + private:
53 +  
54 +  fpos_t *myPos;
55 +  FilePos* next;
56 +  
57 + };
58 +
59   class DumpWriter{
60  
61   public:
# Line 21 | Line 63 | class DumpWriter{ (public)
63    ~DumpWriter();
64  
65    void writeDump( double currentTime );
66 <  void writeFinal( void );
66 >  void writeFinal( double finalTime );
67  
68   private:
69    SimInfo* entry_plug;
# Line 52 | Line 94 | class InitializeFromFile{ (public)
94    InitializeFromFile( char *in_name );
95    ~InitializeFromFile();
96  
97 <  void read_xyz( SimInfo* the_entry_plug );
97 >  void readInit( SimInfo* the_entry_plug );
98    
99   private:
100    char* parseDumpLine(char* line, int atomIndex);
101 +  char* parseBoxLine(char* line, double boxMat[9], double &time );
102    FILE *c_in_file;
103    char c_in_name[500];
104 <  SimInfo* entry_plug;
104 >  SimInfo* simnfo;
105   };
106  
107 + class DumpReader{
108  
109 + public:
110 +  DumpReader( char *in_name );
111 +  ~DumpReader();
112  
113 +  int getNframes();
114 +  void scanFile( void );
115 +
116 +  void getNextFrame() {}
117 +  void readFrame(SimInfo* the_simnfo, int whichFrame);
118 +
119 + private:
120 +
121 +  void readSet( int whichFrame );
122 +  char* parseDumpLine(char* line, int atomIndex);
123 +  char* parseCommentLine(char* line, double &time, double boxMat[9] );
124 +  FILE *inFile;
125 +  char inName[500];
126 +  bool isScanned;
127 +  int nFrames;
128 +  
129 +  FilePos** frameStart;
130 +  FilePos* headFP;
131 +
132 +  SimInfo *simnfo;
133 + };
134 +
135 +
136 +
137   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines