36#ifndef HDF5DATAWRITER_HPP_
37#define HDF5DATAWRITER_HPP_
41#include "AbstractHdf5Access.hpp"
42#include "DataWriterVariable.hpp"
43#include "DistributedVectorFactory.hpp"
50 friend class TestHdf5DataWriter;
130 void CalculateChunkDims(
unsigned targetSize,
unsigned* pChunkSizeInBytes,
bool* pAllOneChunk );
160 const std::string& rDirectory,
161 const std::string& rBaseName,
162 bool cleanDirectory=
true,
163 bool extendData=
false,
164 std::string datasetName=
"Data",
165 bool useCache=
false);
186 void DefineFixedDimension(
const std::vector<unsigned>& rNodesToOuputOriginalIndices,
const std::vector<unsigned>& rNodesToOuputPermutedIndices,
long vecSize);
196 void DefineUnlimitedDimension(
const std::string& rVariableName,
const std::string& rVariableUnits,
unsigned estimatedLength = 1);
212 int DefineVariable(
const std::string& rVariableName,
const std::string& rVariableUnits);
300 bool ApplyPermutation(
const std::vector<unsigned>& rPermutation,
bool unsafeExtendingMode=
false);
317 const unsigned& rNodesPerChunk,
318 const unsigned& rVariablesPerChunk);
static const unsigned DATASET_DIMS
void CheckVariableName(const std::string &rName)
std::vector< double > mDataCache
void SetTargetChunkSize(hsize_t targetSize)
hsize_t mChunkSize[DATASET_DIMS]
void ComputeIncompleteOffset()
void DefineUnlimitedDimension(const std::string &rVariableName, const std::string &rVariableUnits, unsigned estimatedLength=1)
DistributedVectorFactory & mrVectorFactory
bool mIsFixedDimensionSet
void PutUnlimitedVariable(double value)
void AdvanceAlongUnlimitedDimension()
std::vector< unsigned > mIncompletePermIndices
long unsigned mCurrentTimeStep
bool mUseOptimalChunkSizeAlgorithm
const bool mUseExistingFile
unsigned mEstimatedUnlimitedLength
unsigned mFileFixedDimensionSize
int GetVariableByName(const std::string &rVariableName)
bool ApplyPermutation(const std::vector< unsigned > &rPermutation, bool unsafeExtendingMode=false)
std::vector< DataWriterVariable > mVariables
long unsigned mCacheFirstTimeStep
void DefineFixedDimension(long dimensionSize)
unsigned mDataFixedDimensionSize
virtual ~Hdf5DataWriter()
int DefineVariable(const std::string &rVariableName, const std::string &rVariableUnits)
virtual void EndDefineMode()
void PutVector(int variableID, Vec petscVector)
void CalculateChunkDims(unsigned targetSize, unsigned *pChunkSizeInBytes, bool *pAllOneChunk)
void SetAlignment(hsize_t alignment)
void SetFixedChunkSize(const unsigned &rTimestepsPerChunk, const unsigned &rNodesPerChunk, const unsigned &rVariablesPerChunk)
void CheckUnitsName(const std::string &rName)
hsize_t CalculateNumberOfChunks()
void PutStripedVector(std::vector< int > variableIDs, Vec petscVector)
hsize_t mFixedChunkSize[DATASET_DIMS]
const bool mCleanDirectory