hdf5_diagnostics.hpp
Go to the documentation of this file.
1 
6 #ifndef HDF5_DIAG
7 #define HDF5_DIAG 1
8 
9 #include <H5Cpp.h>
10 #include <string>
11 #include "hdsim2d.hpp"
12 #include "../../misc/int2str.hpp"
13 #include "diagnostics.hpp"
14 #include "../../tessellation/Delaunay.hpp"
15 
17 class Snapshot
18 {
19 public:
20 
22  Snapshot(void);
23 
26  Snapshot(const Snapshot& source);
27 
32  Snapshot& operator=(const Snapshot& other);
33 
35  vector<Vector2D> mesh_points;
36 
38  vector<ComputationalCell> cells;
39 
41  double time;
42 
44  int cycle;
45 
46 #ifdef RICH_MPI
47  vector<Vector2D> proc_points;
49 #endif
50 
53 };
54 
61 (const string& fname,bool mpioverride=false);
62 
65 {
66 public:
67 
72  virtual vector<double> operator()(const hdsim& sim) const = 0;
73 
77  virtual string getName(void) const = 0;
78 
80  virtual ~DiagnosticAppendix(void);
81 };
82 
89 void write_snapshot_to_hdf5(hdsim const& sim,string const& fname,
90  const vector<DiagnosticAppendix*>& appendices=vector<DiagnosticAppendix*>());
97 void read_hdf5_snapshot(ResetDump &dump,string const& fname,EquationOfState
98  const* eos);
104 void ConvertHDF5toBinary(string const& input, string const& output);
105 
111 void WriteDelaunay(Delaunay const& tri, string const& filename);
112 
120 Snapshot ReDistributeData(string const& filename, Tessellation const& proctess, size_t snapshot_number);
121 
130 Snapshot ReDistributeData2(string const& filename, Tessellation const& proctess, size_t snapshot_number,
131  bool mpioverride = false);
132 
133 
139 void WriteTess(Tessellation const& tess, string const& filename);
140 #endif // HDF5_DIAG
Container for snapshot data.
Snapshot ReDistributeData2(string const &filename, Tessellation const &proctess, size_t snapshot_number, bool mpioverride=false)
Reads an HDF5 snapshot file in order to restart the simulation with a different cpu number...
Abstract class for tessellation.
Snapshot ReDistributeData(string const &filename, Tessellation const &proctess, size_t snapshot_number)
Reads an HDF5 snapshot file in order to restart the simulation with a different cpu number...
Newtonian hydrodynamic simulation.
Definition: hdsim2d.hpp:43
Addition data to be written in a snapshot.
Two dimensional, newtonian simulation.
vector< Vector2D > mesh_points
Mesh points.
Contains function that write simulation data to a file.
void WriteDelaunay(Delaunay const &tri, string const &filename)
Writes the Delaunay triangulation data into an HDF5 file.
double time
Time.
Snapshot & operator=(const Snapshot &other)
Copy operator.
The Delaunay data structure. Gets a set of points and constructs the Delaunay tessellation.
Definition: Delaunay.hpp:30
int cycle
Cycle number.
Base class for equation of state.
void write_snapshot_to_hdf5(hdsim const &sim, string const &fname, const vector< DiagnosticAppendix *> &appendices=vector< DiagnosticAppendix *>())
Writes the simulation data into an HDF5 file.
Class for keeping the names of the tracers and stickers.
void WriteTess(Tessellation const &tess, string const &filename)
Writes the tessellation data into an HDF5 file.
Snapshot(void)
Default constructor.
void ConvertHDF5toBinary(string const &input, string const &output)
Converts an HDF5 snapshot file to the RICH custom reset binary format.
vector< Vector2D > proc_points
Locations of cpus.
TracerStickerNames tracerstickernames
THe names of the tracers and stickers.
vector< ComputationalCell > cells
Computational cells.
Snapshot read_hdf5_snapshot(const string &fname, bool mpioverride=false)
Load snapshot data into memory.
Contains data required to restart a simulation run.
Definition: ResetDump.hpp:32