36 #ifndef HDF5DATAWRITER_HPP_
37 #define HDF5DATAWRITER_HPP_
41 #include "AbstractHdf5Access.hpp"
42 #include "DataWriterVariable.hpp"
43 #include "DistributedVectorFactory.hpp"
50 friend class TestHdf5DataWriter;
134 void CalculateChunkDims(
unsigned targetSize,
unsigned* pChunkSizeInBytes,
bool* pAllOneChunk );
164 const std::string& rDirectory,
165 const std::string& rBaseName,
166 bool cleanDirectory=
true,
167 bool extendData=
false,
168 std::string datasetName=
"Data",
169 bool useCache=
false);
199 void DefineUnlimitedDimension(
const std::string& rVariableName,
const std::string& rVariableUnits,
unsigned estimatedLength = 1);
215 int DefineVariable(
const std::string& rVariableName,
const std::string& rVariableUnits);
303 bool ApplyPermutation(
const std::vector<unsigned>& rPermutation,
bool unsafeExtendingMode=
false);
329 const unsigned& rNodesPerChunk,
330 const unsigned& rVariablesPerChunk);
void ComputeIncompleteOffset()
hsize_t CalculateNumberOfChunks()
bool ApplyPermutation(const std::vector< unsigned > &rPermutation, bool unsafeExtendingMode=false)
bool mUseOptimalChunkSizeAlgorithm
void CheckVariableName(const std::string &rName)
const bool mUseExistingFile
int GetVariableByName(const std::string &rVariableName)
void CalculateChunkDims(unsigned targetSize, unsigned *pChunkSizeInBytes, bool *pAllOneChunk)
void DefineFixedDimensionUsingMatrix(const std::vector< unsigned > &rNodesToOuput, long vecSize)
void SetTargetChunkSize(hsize_t targetSize)
bool mUseMatrixForIncompleteData
bool mIsFixedDimensionSet
const bool mCleanDirectory
void SetFixedChunkSize(const unsigned &rTimestepsPerChunk, const unsigned &rNodesPerChunk, const unsigned &rVariablesPerChunk)
unsigned mEstimatedUnlimitedLength
long unsigned mCacheFirstTimeStep
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)
std::vector< double > mDataCache
void DefineFixedDimension(long dimensionSize)
Hdf5DataWriter(DistributedVectorFactory &rVectorFactory, const std::string &rDirectory, const std::string &rBaseName, bool cleanDirectory=true, bool extendData=false, std::string datasetName="Data", bool useCache=false)
void SetAlignment(hsize_t alignment)
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)