72 bool singlePrecision,
int sequenceNumber);
79 bool adjustTimeInfo(
int sequenceNum,
bool multiTime,
double startTime,
double endTime,
QString timeUnit);
82 GmValueAccessor* nodeAc,
const double* scaleFactor,
const double* offset);
85 GmValueAccessor* nodeAc,
const double* scaleFactor,
const double* offset);
103 const UnitConverter* conv,
const double* scaleFactor,
const double* offset,
104 int* numNodes,
int* numSegments,
int* dataSize);
113 int dimFilter, std::function<
void(
const double*,
int,
double*)> transformFunc);
117 const double* scaleFactor,
const double* offset,
130 const double* scaleFactor,
const double* offset);
141 static void addAttribute(H5::H5Object* obj,
QString name,
unsigned n,
const unsigned* values);
142 static void addAttribute(H5::H5Object* obj,
QString name,
unsigned n,
const double* values);
145 template<
class T>
static void addVectorAttribute(H5::H5Object* obj,
QString name,
const H5::PredType& type,
unsigned n,
const T* values);
Auxiliar class used to store the definition of a value. It can be used to store informations about st...
Definition: gmValueInfo.h:126
bool create(QString fileName, const GmFileFormat *fileFormat, const GmSimulationData *simData, bool singlePrecision, int sequenceNumber)
Creates a new HDF5 file. If it already exists, it will be replaced. The file is initialized with some...
Definition: gmHdf5.cpp:89
GmHdf5(const GmLogCategory &logger)
Constructor.
Definition: gmHdf5.cpp:67
ExtraColumns
The set of extra columns that should be saved on file.
Definition: gmFileIO.h:85
bool saveMeshCellExtraColumn(QString dsName, const GmCellMesh *mesh, const GmFileFilter *filter, GmFileIO::ExtraColumns column, int propertySet)
Saves mesh cell extra column (cell id, type, active or material) data to a new HDF5 data set....
Definition: gmHdf5.cpp:1168
bool saveMeshGaussData(QString dsName, const GmElementMesh *mesh, const GmFileFilter *filter, int ruleIndex, GmGaussAccessor *dataAc, int dimFilter)
Saves mesh Gauss data to a new HDF5 data set. Some basic mesh metadata is also saved in the form of a...
Definition: gmHdf5.cpp:896
bool saveNodeData(QString dsName, const GmMesh *mesh, const GmFileFilter *filter, GmValueAccessor *dataAc, int dimFilter, std::function< void(const double *, int, double *)> transformFunc)
Work horse for both saveMeshNodeCoord() and saveMeshNodeData(). See those method descriptions for an ...
Definition: gmHdf5.cpp:1362
~GmHdf5()
Destructor.
Definition: gmHdf5.cpp:73
void addCellAttributes(H5::H5Object *obj, const GmCellMesh *mesh, const GmFileFilter *filter, int ruleIndex=-1)
Add metadata attributes to obj describing the set of saved cells.
Definition: gmHdf5.cpp:1733
bool saveMeshNodeIdColumn(QString dsName, const GmMesh *mesh, const GmFileFilter *filter)
Saves mesh node ids to a new HDF5 data set. Some basic mesh metadata is also saved in the form of att...
Definition: gmHdf5.cpp:677
The GmGaussAccessor class is a proxy object to a value accesor implementing a more convenient interfa...
Definition: gmGaussAccessor.h:38
Declaration of the GmValueInfo class.
QString _fileName
The hdf5 file name.
Definition: gmHdf5.h:148
Base interface for mesh cells.
Definition: gmCell.h:81
A support class for saving data to a HDF5 file. Hdf5 files are self-describing but do not have a fixe...
Definition: gmHdf5.h:65
Declaration of the GmFileIO class.
static void addAttribute(H5::H5Object *obj, QString name, int value)
Adds an int attribute to the given object.
Definition: gmHdf5.cpp:1847
void addTableAttributes(H5::H5Object *obj, const GmMesh *mesh, const char *type, const GmDiscontinuitySet *discSet=NULL)
Add metadata attributes common to all tables.
Definition: gmHdf5.cpp:1702
const GmFileFormat * _fileFormat
The file format object specifying the desired topology order.
Definition: gmHdf5.h:150
GmStorageType
The desired storage type for the data.
Definition: gmValueInfo.h:53
Interface class for accessing and setting values from an "indexable" collection of values.
Definition: gmValueAccessor.h:59
bool adjustTimeInfo(int sequenceNum, bool multiTime, double startTime, double endTime, QString timeUnit)
Saves to the root metadata the time step information. If sequenceNum is 0, saves the global simulatio...
Definition: gmHdf5.cpp:160
static bool addSequenceInfo(QString fileName, int numSequenceFiles, double startTime, double endTime, QString timeUnit, const GmLogCategory &logger)
Adds to the given existing (and closed) HDF5 file a set of attributes with the total number of sequen...
Definition: gmHdf5.cpp:130
Auxiliar class used to store the complete set of simulation data.
Definition: gmSimulationData.h:51
void addNodeAttributes(H5::H5Object *obj, const GmMesh *mesh, const GmFileFilter *filter)
Add metadata attributes to obj describing the set of saved nodes.
Definition: gmHdf5.cpp:1715
void addDiscSetNodeAttributes(H5::H5Object *obj, const GmDiscontinuitySet *discSet, bool original, const UnitConverter *conv, const double *scaleFactor, const double *offset)
Add metadata attributes describing the discontinuity set nodes.
Definition: gmHdf5.cpp:1799
The GmCellAccessor class is a proxy object to a value accesor implementing a more convenient interfac...
Definition: gmCellAccessor.h:66
Base interface class for CellMesh type plugins.
Definition: gmCellMesh.h:39
bool createGroups(const QStringList &groups)
Adds the given groups to the file. The group list should be ordered in a way that when creating a gro...
Definition: gmHdf5.cpp:189
const char * dataBuffer(GmValueAccessor *ac, const GmValueInfo *info) const
If the given accessor is a tracked accessor with an underlying data buffer and the accessor does NOT ...
Definition: gmHdf5.cpp:1665
static void addScalarAttribute(H5::H5Object *obj, QString name, const H5::PredType &type, T value)
Writes a "generic" attribute to the given object. Template type T must be compatible with the given H...
Definition: gmHdf5.cpp:1931
const GmLogCategory & _logger
The logger used to report errors.
Definition: gmHdf5.h:147
void addDiscSetTopologyAttributes(H5::H5Object *obj, const GmDiscontinuitySet *discSet, bool original)
Add metadata attributes describing the discontinuity set topology.
Definition: gmHdf5.cpp:1832
bool saveMeshPointCloudTopology(QString dsName, const GmMesh *mesh, const GmFileFilter *filter, int ruleIndex=-1)
Saves a simple vector with size equal to the number of mesh nodes / number of gauss points (if ruleIn...
Definition: gmHdf5.cpp:580
const H5::PredType & hdf5Type(GmStorageType type) const
Returns the compatible HDF5 type for the given GmStorageType, obeying the _singlePrecision flag.
Definition: gmHdf5.cpp:1683
bool saveMeshGaussNodeCoord(QString dsName, const GmElementMesh *mesh, const GmFileFilter *filter, int ruleIndex, GmValueAccessor *nodeAc, const double *scaleFactor, const double *offset)
Saves the coordinates of the mesh Gauss points, as if they where mesh nodes, to a new HDF5 data set....
Definition: gmHdf5.cpp:309
Class representing a category with multiple logging levels.
Definition: gmLog.h:58
bool saveMeshCellData(QString dsName, const GmCellMesh *mesh, const GmFileFilter *filter, GmCellAccessor *dataAc, int dimFilter)
Saves mesh cell data to a new HDF5 data set. Some basic mesh metadata is also saved in the form of at...
Definition: gmHdf5.cpp:756
Base interface for FEM (finite element) meshes.
Definition: gmElementMesh.h:40
static void addVectorAttribute(H5::H5Object *obj, QString name, const H5::PredType &type, unsigned n, const T *values)
Writes a "generic" vector attribute to the given object. Template type T must be compatible with the ...
Definition: gmHdf5.cpp:1942
Base interface for providing discontinuity geometry information for spatial indices.
Definition: gmDiscontinuitySet.h:48
bool saveMeshGaussIdColumn(QString dsName, const GmElementMesh *mesh, const GmFileFilter *filter, int ruleIndex)
Saves mesh Gauss point ID data to a new HDF5 data set. Some basic mesh metadata is also saved in the ...
Definition: gmHdf5.cpp:1263
bool fillDiscontinuityPolylineData(const GmDiscontinuitySet *discSet, bool original, const UnitConverter *conv, const double *scaleFactor, const double *offset, QVector< T > &nodes, QVector< int > &topology, int *nsegments) const
Helper function used by saveDiscontinuitySetData() to fill the nodes and topology vectors with the po...
Definition: gmHdf5.cpp:1522
bool createGroup(QString group, double time, QString timeUnit)
Adds the given group to the file, with added time attributes.
Definition: gmHdf5.cpp:211
bool saveMeshNodeCoord(QString dsName, const GmMesh *mesh, const GmFileFilter *filter, GmValueAccessor *nodeAc, const double *scaleFactor, const double *offset)
Saves mesh geometry (node coordinates) to a new HDF5 data set. Some basic mesh metadata is also saved...
Definition: gmHdf5.cpp:254
bool saveMeshTopology(QString dsName, const GmCellMesh *mesh, const GmFileFilter *filter)
Saves mesh topology (cell node incidence list) to a new HDF5 data set. Some basic mesh metadata are a...
Definition: gmHdf5.cpp:443
void addPropertySetAttributes(H5::H5Object *obj, const GmCellMesh *mesh, int propertySet)
Add metadata attributes describing the property set.
Definition: gmHdf5.cpp:1785
void addAcAttributes(H5::H5Object *obj, const GmValueInfo *info, QString unit, int dimFilter, const double *scaleFactor=NULL, const double *offset=NULL)
Add metadata attributes to obj describing the saved data.
Definition: gmHdf5.cpp:1756
Base interface class for Mesh type plugins.
Definition: gmMesh.h:44
H5::H5File * _fileh
The hdf5 file handle.
Definition: gmHdf5.h:149
bool saveDiscontinuitySetData(QString coordDsName, QString cellDsName, const GmDiscontinuitySet *discSet, bool original, const UnitConverter *conv, const double *scaleFactor, const double *offset, int *numNodes, int *numSegments, int *dataSize)
Saves discontinuity set geometry data to a pair of new HDF5 data sets (one for node coordinates.
Definition: gmHdf5.cpp:1046
bool saveMeshNodeData(QString dsName, const GmMesh *mesh, const GmFileFilter *filter, GmValueAccessor *dataAc, int dimFilter)
Saves mesh node data to a new HDF5 data set. Some basic mesh metadata is also saved in the form of at...
Definition: gmHdf5.cpp:646
bool _singlePrecision
Should we force real data to be saved in single precision (floats instead of doubles)?
Definition: gmHdf5.h:151
A generic auxilliary class for managing the various options that can be used to define the set of nod...
Definition: gmFileFilter.h:45