-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutput.h
36 lines (30 loc) · 961 Bytes
/
output.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
#include <string>
#include <fstream>
#include <sstream>
#include "FlowField.h"
class Output {
private:
std::ofstream &outputFile_;
std::stringstream velocityStringStream_;
std::stringstream pressureStringStream_;
const Parameters& parameters_;
const FlowField& flowField_;
inline int map(int i, int j){return j+i*(parameters_.get_num_cells(1)+2);}
inline int map(int i, int j, int k){return k+j*parameters_.get_num_cells(2)
+i*(parameters_.get_num_cells(1)+2)*parameters_.get_num_cells(2);}
public:
Output(const Parameters& parameters, FlowField& flowField);
~Output ();
void write (int timeStep, std::string folderName);
std::string getFilename(int timeStep, std::string folderName);
void writeFileHeader();
void writeGrid ();
void writePressure();
void writeVelocity();
void writeHeight();
void writeBathymetry();
void writeQ();
void clearStringStreams();
//@ Debug
void writeDZ();
};