forked from martinjrobins/SPH-DEM
-
Notifications
You must be signed in to change notification settings - Fork 1
/
io_data_vtk.h
executable file
·70 lines (60 loc) · 2.25 KB
/
io_data_vtk.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef IO_DATA_VTK_H
#define IO_DATA_VTK_H
#include "customConstants.h"
#include "particle.h"
#include "globalVars.h"
#include "customSimBase.h"
#include "ioGlobals.h"
#include "ioDomain.h"
#include <vector>
#include <string>
/*
* upper level I/O class. Contains globals and domain I/O functionality, as
* well as adding the ability to read/write particle data using the VTK file format
*/
class Cio_data_vtk: public CioGlobals, public CioDomain {
public:
/*
* constructor sets filename
*/
Cio_data_vtk(string _filename,CglobalVars *g): CioGlobals(_filename,g),CioDomain(_filename,g) {
filename = _filename;
};
/*
* read/write restart datafile (used to restart a simulation from scratch)
*/
void readRestart(int timestep,particleContainer *outPs,CglobalVars *globals);
void writeRestart(int timestep,particleContainer &ps,CglobalVars *globals);
/*
* read/write regular output file
*/
void readOutput(int timestep,particleContainer *outPs,CglobalVars *globals);
void writeOutput(int timestep,particleContainer &ps,CcustomSimBase &customSim,CglobalVars *globals);
/*
* read output file using CSIRO format
*/
void readCSIRO(int timestep,particleContainer *outPs,CglobalVars *globals);
void writeAux(int timestep,particleContainer &ps,vector<double> theData,const char *name,CglobalVars *globals);
void writeAuxNoData(int timestep,particleContainer &ps,const char *name,CglobalVars *globals);
void writeGrid(int timestep,particleContainer &ps,vectInt &gridDims,CglobalVars *globals);
/*
* set/get base filename.
* filenames for regular output datafile is:
* "baseNameNNNNNNN.pvtu" where NNNNNNN is the output timestep number
* and baseName is the base filename
*
* for a restart file, the total filename is:
* "baseNameRestartNNNNNNN.pvtu"
*/
void setFilename(string _filename,CglobalVars *g) {
CioGlobals::setFilename(_filename,g);
CioDomain::setFilename(_filename,g);
filename = _filename;
};
string getFilename() { return filename; }
private:
string filename;
char *dimNames[3];
char *vdimNames[3];
};
#endif