ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/ReadWrite.hpp
Revision: 1180
Committed: Thu May 20 20:24:07 2004 UTC (20 years, 1 month ago) by chrisfen
File size: 2050 byte(s)
Log Message:
Several additions... Restraints.cpp and .hpp were included for restraining particles in thermodynamic integration.  By including these, changes were made in Integrator, SimInfo, ForceFeilds, SimSetup, StatWriter, and possibly some other files.  Two bass keywords were also added for performing thermodynamic integration: a lambda value one and a k power one.

File Contents

# Content
1 #ifndef __READWRITE_H__
2 #define __READWRITE_H__
3 #define _LARGEFILE_SOURCE64
4 #define _FILE_OFFSET_BITS 64
5 #include <iostream>
6 #include <fstream>
7 #include <string>
8 #include <string.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <unistd.h>
12 #include <sys/types.h>
13 #include <sys/stat.h>
14
15
16 #include "Atom.hpp"
17 #include "SimInfo.hpp"
18 #include "Thermo.hpp"
19 #include "StuntDouble.hpp"
20
21 using namespace std;
22
23 class DumpWriter{
24
25 public:
26 DumpWriter( SimInfo* the_entry_plug );
27 ~DumpWriter();
28
29 void writeDump( double currentTime );
30 void writeFinal( double currentTime);
31 void writeFrame( vector<ofstream*>& outFile, double finalTime );
32
33 #ifdef IS_MPI
34 void update();
35 #endif
36
37 private:
38
39 #ifdef IS_MPI
40 void sortByGlobalIndex();
41 #endif
42
43 SimInfo* entry_plug;
44 ofstream dumpFile;
45
46 #ifdef IS_MPI
47 vector<pair<int, int> > indexArray;
48 #endif
49 };
50
51 class StatWriter{
52
53 public:
54 StatWriter( SimInfo* the_entry_plug );
55 ~StatWriter();
56
57 void writeStat( double currentTime );
58 void writeRaw( double currentTime );
59
60 private:
61
62 SimInfo* entry_plug;
63 ofstream outFile;
64 ofstream rawFile;
65 char outName[500];
66 char rawName[500];
67 Thermo* tStats;
68
69 };
70
71 class InitializeFromFile{
72
73 public:
74 InitializeFromFile( char *in_name );
75 ~InitializeFromFile();
76
77 void readInit( SimInfo* the_entry_plug );
78
79 private:
80 char* parseDumpLine(char* line, StuntDouble* sd);
81 char* parseCommentLine(char* line, SimInfo* entry_plug);
82 FILE *c_in_file;
83 char c_in_name[500];
84 SimInfo* simnfo;
85 };
86
87 class DumpReader{
88
89 public:
90 DumpReader(const char *in_name );
91 ~DumpReader();
92
93 int getNframes();
94 void scanFile( void );
95
96 void getNextFrame() {}
97 void readFrame(SimInfo* the_simnfo, int whichFrame);
98
99 #ifdef IS_MPI
100 void anonymousNodeDie( void );
101 void nodeZeroError( void );
102 #endif
103 private:
104
105 void readSet( int whichFrame );
106 char* parseDumpLine(char* readLine, StuntDouble* sd);
107 char* parseCommentLine(char* readLine, SimInfo* entry_plug);
108 FILE *inFile;
109 string inFileName;
110 bool isScanned;
111
112 vector<fpos_t*> framePos;
113 SimInfo *simnfo;
114 };
115
116
117
118 #endif