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

Comparing trunk/OOPSE/libmdtools/ReadWrite.hpp (file contents):
Revision 829 by gezelter, Tue Oct 28 16:03:37 2003 UTC vs.
Revision 1074 by tim, Mon Mar 1 20:01:50 2004 UTC

# Line 1 | Line 1
1   #ifndef __READWRITE_H__
2   #define __READWRITE_H__
3  
4 #define _FILE_OFFSET_BITS 64
5
4   #include <iostream>
5   #include <fstream>
6  
# Line 21 | Line 19 | class FilePos{
19   using namespace std;
20  
21   class FilePos{
22 <  
22 >
23   public:
24 <  FilePos(){
24 >  FilePos(){
25      myPos = NULL;
26      next = NULL;
27    }
28 <  FilePos( fpos_t* thePos ) {
29 <    myPos = thePos;
28 >  FilePos( fpos_t* thePos ) {
29 >    myPos = thePos;
30      next = NULL;
31    }
32 <  ~FilePos(){
32 >  ~FilePos(){
33      if( next  != NULL ) delete next;
34      if( myPos != NULL ) delete myPos;
35    }
36 <  
36 >
37    void add( fpos_t *thePos ){
38 <    if( next != NULL )
38 >    if( next != NULL )
39        next->add( thePos );
40      else
41        next = new FilePos( thePos );
42    }
43 <  
43 >
44    FilePos &operator=(fpos_t *thePos){ myPos = thePos; return *this; }
45 <  
45 >
46    void setPos( fpos_t *thePos ){ myPos = thePos; }
47    fpos_t *getPos( void ){ return myPos; }
48 <  
48 >
49    FilePos* getNext( void ) { return next; }
50   private:
51 <  
51 >
52    fpos_t *myPos;
53    FilePos* next;
54 <  
54 >
55   };
56  
57   class DumpWriter{
# Line 63 | Line 61 | class DumpWriter{ (public)
61    ~DumpWriter();
62  
63    void writeDump( double currentTime );
64 <  void writeFinal( double finalTime );
64 >  void writeFinal( double currentTime);
65 >  void writeFrame( vector<ofstream*>& outFile, double finalTime );
66  
67 + #ifdef IS_MPI
68 +  void update();
69 + #endif
70 +
71   private:
72 +
73 + #ifdef IS_MPI
74 +  void sortByGlobalIndex();
75 + #endif
76 +
77    SimInfo* entry_plug;
78 <  ofstream outFile;
79 <  char outName[500];
78 >  ofstream dumpFile;
79 >
80 > #ifdef IS_MPI
81 >  vector<pair<int, int> > indexArray;
82 > #endif
83   };
84  
85   class StatWriter{
# Line 78 | Line 89 | class StatWriter{ (public)
89    ~StatWriter();
90  
91    void writeStat( double currentTime );
92 <  
92 >
93   private:
94 <  
94 >
95    SimInfo* entry_plug;
96    ofstream outFile;
97    char outName[500];
# Line 95 | Line 106 | class InitializeFromFile{ (public)
106    ~InitializeFromFile();
107  
108    void readInit( SimInfo* the_entry_plug );
109 <  
109 >
110   private:
111    char* parseDumpLine(char* line, int atomIndex);
112 <  char* parseBoxLine(char* line, double boxMat[9], double &time );
112 >  char* parseCommentLine(char* line, SimInfo* entry_plug);
113    FILE *c_in_file;
114    char c_in_name[500];
115    SimInfo* simnfo;
# Line 107 | Line 118 | class DumpReader{ (public)
118   class DumpReader{
119  
120   public:
121 <  DumpReader( char *in_name );
121 >  DumpReader(const char *in_name );
122    ~DumpReader();
123  
124    int getNframes();
# Line 125 | Line 136 | class DumpReader{ (public)
136    char inName[500];
137    bool isScanned;
138    int nFrames;
139 <  
139 >
140    FilePos** frameStart;
141    FilePos* headFP;
142  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines