| 1 | #ifndef __READWRITE_H__ | 
| 2 | #define __READWRITE_H__ | 
| 3 |  | 
| 4 | #include <iostream> | 
| 5 | #include <fstream> | 
| 6 |  | 
| 7 | #include <cstring> | 
| 8 | #include <cstdio> | 
| 9 | #include <cstdlib> | 
| 10 |  | 
| 11 | #include "Atom.hpp" | 
| 12 | #include "SimInfo.hpp" | 
| 13 | #include "Thermo.hpp" | 
| 14 |  | 
| 15 | using namespace std; | 
| 16 |  | 
| 17 | class DumpWriter{ | 
| 18 |  | 
| 19 | public: | 
| 20 | DumpWriter( SimInfo* the_entry_plug ); | 
| 21 | ~DumpWriter(); | 
| 22 |  | 
| 23 | void writeDump( double currentTime ); | 
| 24 | void writeFinal( double finalTime ); | 
| 25 |  | 
| 26 | private: | 
| 27 | SimInfo* entry_plug; | 
| 28 | ofstream outFile; | 
| 29 | char outName[500]; | 
| 30 | }; | 
| 31 |  | 
| 32 | class StatWriter{ | 
| 33 |  | 
| 34 | public: | 
| 35 | StatWriter( SimInfo* the_entry_plug ); | 
| 36 | ~StatWriter(); | 
| 37 |  | 
| 38 | void writeStat( double currentTime ); | 
| 39 |  | 
| 40 | private: | 
| 41 |  | 
| 42 | SimInfo* entry_plug; | 
| 43 | ofstream outFile; | 
| 44 | char outName[500]; | 
| 45 | Thermo* tStats; | 
| 46 |  | 
| 47 | }; | 
| 48 |  | 
| 49 | class InitializeFromFile{ | 
| 50 |  | 
| 51 | public: | 
| 52 | InitializeFromFile( char *in_name ); | 
| 53 | ~InitializeFromFile(); | 
| 54 |  | 
| 55 | void read_xyz( SimInfo* the_entry_plug ); | 
| 56 |  | 
| 57 | private: | 
| 58 | char* parseDumpLine(char* line, int atomIndex); | 
| 59 | char* parseBoxLine(char* line, double boxMat[9] ); | 
| 60 | FILE *c_in_file; | 
| 61 | char c_in_name[500]; | 
| 62 | SimInfo* simnfo; | 
| 63 | }; | 
| 64 |  | 
| 65 |  | 
| 66 |  | 
| 67 | #endif |