-
Notifications
You must be signed in to change notification settings - Fork 0
/
fileoperations.h
52 lines (37 loc) · 1.33 KB
/
fileoperations.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef FILEOPERATIONS_H
#define FILEOPERATIONS_H
#include <iostream>
#include <unordered_map>
#include <vector>
#include <fstream>
#include <iomanip>
#include <sys/stat.h>
#include <sys/types.h>
#include "config.h"
class FileOperations {
public:
std::unordered_map<std::string, float> scalars;
std::unordered_map<std::string, std::vector<std::vector<float>>> phaseVectors;
std::ofstream positionFileStream;
std::ofstream velocityFileStream;
std::ofstream scalarFileStream;
std::ofstream phaseVectorFileStream;
std::string folderName;
std::string intermediateFolder;
std::ofstream exchangesFileStream;
std::unordered_map<std::string, float> exchangesScalars;
bool exchangesHeaders;
bool headersWritten;
FileOperations();
void registerScalarData(std::string key, float value);
void registerVectorData(std::string key, std::vector<std::vector<float>> value);
void writeScalarData(float timeStep);
void writeVectorData(float timeStep);
void writeXYZfiles(float timestep);
/* REMD + RENS SCALARS */
void registerExchangesScalars(std::string key, float value);
void writeExchangesScalars(float timeStep);
/* END REMD + RENS SCALARS */
~FileOperations();
};
#endif