35 #ifndef OUTPUTHDF5STREAM_H
36 #define OUTPUTHDF5STREAM_H
70 roNONE, roRMS, roMAX, roMIN
91 const char * HDF5_RootObjectName,
94 float * BufferToReuse = NULL)
95 : HDF5_File (HDF5_File),
96 HDF5_RootObjectName(NULL),
97 SourceMatrix (SourceMatrix),
98 ReductionOp (ReductionOp),
99 BufferReuse (BufferToReuse != NULL),
101 StoreBuffer (BufferToReuse)
104 this->HDF5_RootObjectName =
new char[strlen(HDF5_RootObjectName)];
105 strcpy(this->HDF5_RootObjectName, HDF5_RootObjectName);
114 delete [] HDF5_RootObjectName;
118 virtual void Create() = 0;
121 virtual void Reopen() = 0;
124 virtual void Sample() = 0;
127 virtual void PostProcess();
130 virtual void Checkpoint() = 0;
133 virtual void Close() = 0;
144 virtual void AllocateMemory();
146 virtual void FreeMemory();
165 static const size_t ChunkSize_4MB = 1048576;
168 static const size_t MinGridpointsToSampleInParallel = 1048576;
187 const char * HDF5_ObjectName,
191 float * BufferToReuse = NULL);
198 virtual void Create();
201 virtual void Reopen();
204 virtual void Sample();
207 virtual void PostProcess();
210 virtual void Checkpoint();
213 virtual void Close();
218 virtual void FlushBufferToFile();
244 const char * HDF5_GroupName,
248 float * BufferToReuse = NULL);
254 virtual void Create();
257 virtual void Reopen();
260 virtual void Sample();
263 virtual void PostProcess();
266 virtual void Checkpoint();
269 virtual void Close();
286 virtual hid_t CreateCuboidDataset(
const size_t Index);
289 virtual void FlushBufferToFile();
321 const char * HDF5_DatasetName,
324 float * BufferToReuse = NULL);
330 virtual void Create();
333 virtual void Reopen();
336 virtual void Sample();
339 virtual void PostProcess();
342 virtual void Checkpoint();
345 virtual void Close();
349 virtual void FlushBufferToFile();
size_t SampledTimeStep
Time step to store (N/A for aggregated).
std::vector< TCuboidInfo > CuboidsInfo
vector keeping handles and positions of all cuboids
TReductionOperator
How to aggregate data.
char * HDF5_RootObjectName
Dataset name.
Output stream for quantities sampled in the whole domain.
Output stream for quantities sampled by a cuboid corner sensor mask.
const TReductionOperator ReductionOp
Reduction operator.
const TIndexMatrix & SensorMask
Sensor mask to sample data.
The header file containing the class for real matrices.
bool BufferReuse
if true, the container reuses e.g. Temp_1_RS3D, Temp_2_RS3D, Temp_3_RS3D.
The header file containing the HDF5 related classes.
const TIndexMatrix & SensorMask
Sensor mask to sample data.
hid_t HDF5_CuboidId
ID of the dataset storing the given cuboid.
size_t SampledTimeStep
Timestep to store (N/A for aggregated).
float * StoreBuffer
Temporary buffer for store - only if Buffer Reuse = false!
const TRealMatrix & SourceMatrix
Source matrix to be sampled.
Output stream for quantities sampled by an index sensor mask.
The header file containing the class for 64b integer matrices.
Abstract base class for output data streams (sampled data).
TBaseOutputHDF5Stream(THDF5_File &HDF5_File, const char *HDF5_RootObjectName, const TRealMatrix &SourceMatrix, const TReductionOperator ReductionOp, float *BufferToReuse=NULL)
Constructor - there is no sensor mask by default!
The class for real matrices.
This structure information about a HDF5 dataset (one cuboid). Namely, its HDF5_ID, Starting position in a lineup buffer.
The class for 64b unsigned integers (indices). It is used for sensor_mask_index or sensor_corners_mas...
size_t SampledTimeStep
Time step to store (N/A for aggregated).
size_t BufferSize
Buffer size.
size_t StartingPossitionInBuffer
Having a single buffer for all cuboids, where this one starts.
hid_t HDF5_GroupId
Handle to a HDF5 dataset.
virtual ~TBaseOutputHDF5Stream()
Destructor.
hid_t HDF5_DatasetId
Handle to a HDF5 dataset.
hid_t HDF5_DatasetId
Handle to a HDF5 dataset.
THDF5_File & HDF5_File
HDF5 file handle.
Class wrapping the HDF5 routines.