35#ifndef NEKTAR_LIB_UTILITIES_BASIC_UTILS_PTSIOHDF5_H
36#define NEKTAR_LIB_UTILITIES_BASIC_UTILS_PTSIOHDF5_H
82 const std::string &fileName,
85 const size_t expectedRows = 0);
106 size_t ChunkRows(
const size_t rowLength,
const size_t expectedRows)
const;
108 const hsize_t row)
const;
110 const hsize_t nRows,
const NekDouble time)
const;
#define LIB_UTILITIES_EXPORT
Writes a time series of point data to a HDF5 file.
bool m_isRoot
True on the process that owns the file.
static constexpr size_t TargetChunkBytes
Target size of a single HDF5 chunk, in bytes. Chunks much smaller than this make the chunk index domi...
std::vector< H5::DataSetSharedPtr > m_fieldData
void Write(const PtsFieldSharedPtr &ptsField, const NekDouble time)
Appends the field values held by ptsField at time time.
void Close()
Flushes and closes the file. Called by the destructor.
LibUtilities::CommSharedPtr m_comm
hsize_t FindRestartRow(const H5::DataSetSharedPtr &dataSet, const hsize_t nRows, const NekDouble time) const
Index of the first row whose time is at or after time.
static constexpr size_t MinChunkRows
Fewest time rows in a chunk. A chunk holding only a handful of rows costs more in index entries than ...
hsize_t m_row
Index of the next row to be written.
NekDouble ReadTime(const H5::DataSetSharedPtr &dataSet, const hsize_t row) const
Reads the time stored in the first column of row row.
const std::string m_fileName
Name of file.
std::vector< NekDouble > m_rowBuffer
Scratch space for one row: time followed by one value per point.
size_t ChunkRows(const size_t rowLength, const size_t expectedRows) const
Number of time rows in a single chunk.
size_t m_nPts
Number of points, fixed when the file is opened.
H5::GroupSharedPtr m_timeGroup
std::shared_ptr< File > FileSharedPtr
std::shared_ptr< Group > GroupSharedPtr
std::shared_ptr< DataSet > DataSetSharedPtr
std::shared_ptr< PtsField > PtsFieldSharedPtr
std::shared_ptr< PtsIOHdf5 > PtsIOHdf5SharedPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.