36 #ifndef HDF5DATAWRITER_HPP_
37 #define HDF5DATAWRITER_HPP_
43 #define H5_USE_16_API 1
48 #include "AbstractHdf5Access.hpp"
49 #include "DataWriterVariable.hpp"
50 #include "DistributedVectorFactory.hpp"
134 void CalculateChunkDims(
unsigned targetSize,
unsigned* pChunkSizeInBytes,
bool* pAllOneChunk );
161 const std::string& rDirectory,
162 const std::string& rBaseName,
163 bool cleanDirectory=
true,
164 bool extendData=
false,
165 std::string datasetName=
"Data");
195 void DefineUnlimitedDimension(
const std::string& rVariableName,
const std::string& rVariableUnits,
unsigned estimatedLength = 1);
211 int DefineVariable(
const std::string& rVariableName,
const std::string& rVariableUnits);
288 bool ApplyPermutation(
const std::vector<unsigned>& rPermutation,
bool unsafeExtendingMode=
false);
314 const unsigned& rNodesPerChunk,
315 const unsigned& rVariablesPerChunk);
void ComputeIncompleteOffset()
hsize_t CalculateNumberOfChunks()
bool ApplyPermutation(const std::vector< unsigned > &rPermutation, bool unsafeExtendingMode=false)
Hdf5DataWriter(DistributedVectorFactory &rVectorFactory, const std::string &rDirectory, const std::string &rBaseName, bool cleanDirectory=true, bool extendData=false, std::string datasetName="Data")
bool mUseOptimalChunkSizeAlgorithm
void CheckVariableName(const std::string &rName)
int GetVariableByName(const std::string &rVariableName)
void CalculateChunkDims(unsigned targetSize, unsigned *pChunkSizeInBytes, bool *pAllOneChunk)
void DefineFixedDimensionUsingMatrix(const std::vector< unsigned > &rNodesToOuput, long vecSize)
bool mUseMatrixForIncompleteData
bool mIsFixedDimensionSet
void SetFixedChunkSize(const unsigned &rTimestepsPerChunk, const unsigned &rNodesPerChunk, const unsigned &rVariablesPerChunk)
unsigned mEstimatedUnlimitedLength
void AdvanceAlongUnlimitedDimension()
DistributedVectorFactory & mrVectorFactory
hsize_t mFixedChunkSize[DATASET_DIMS]
int DefineVariable(const std::string &rVariableName, const std::string &rVariableUnits)
Mat mDoubleIncompleteOutputMatrix
void PutVector(int variableID, Vec petscVector)
void DefineFixedDimension(long dimensionSize)
virtual ~Hdf5DataWriter()
Mat mSingleIncompleteOutputMatrix
void CheckUnitsName(const std::string &rName)
void PutStripedVector(std::vector< int > variableIDs, Vec petscVector)
std::vector< DataWriterVariable > mVariables
void PutUnlimitedVariable(double value)
static const unsigned DATASET_DIMS
unsigned mDataFixedDimensionSize
long unsigned mCurrentTimeStep
hsize_t mChunkSize[DATASET_DIMS]
unsigned mFileFixedDimensionSize
virtual void EndDefineMode()
void DefineUnlimitedDimension(const std::string &rVariableName, const std::string &rVariableUnits, unsigned estimatedLength=1)