24#ifndef _GEMA_HDF5_MODEL_WRITER_H_
25#define _GEMA_HDF5_MODEL_WRITER_H_
72 bool addGeometryNodeCoordinates (
int n,
int d,
const double* values,
int nghost = 0);
73 bool addGeometryCells (
int ncells,
int size,
const int* data);
74 bool addGeometryCellGhostNodes (
int ncells,
int size,
const int* data);
75 bool addGeometryIndexTable (
GroupType group,
QString tableName,
int n,
const int* values);
76 bool addGeometryBorderTable (
GroupType group,
QString tableName,
int n,
const int* values);
77 bool addInitialData (
GroupType group,
QString attributeName,
int n,
int d,
const double* values,
bool hasFunctions,
int history = -1);
79 bool addBoundaryConditionProperty(
QString bcName,
QString propertyName,
int n,
int d,
const double* values,
bool hasFunctions);
81 bool addDiscontinuityPolyline (
QString dsName,
int index,
int n,
int d,
const double* coordinates);
82 bool addDiscontinuitySurface (
QString dsName,
int index,
int n,
const double* coordinates,
int ntri,
const int* triangles);
83 bool addDiscontinuityEdgeList (
QString dsName,
int index,
int n,
const int* borderData);
84 bool addDiscontinuityFaceList (
QString dsName,
int index,
int n,
const int* borderData);
87 bool cellVectorBuildBegin(
int npsets,
int expectedSize);
88 bool cellVectorAddCell (
GmCellType type,
const int* propertyIndices,
const int* nodeIndices);
89 const int* cellVectorBuildEnd (
int* size);
91 bool cellGhostNodesVectorBuildBegin(
int expectedSize);
92 bool cellGhostNodesVectorAddCell (
int cellId,
int numGhostNodes,
const int* nodeIndices);
93 const int* cellGhostNodesVectorBuildEnd (
int* size);
98 assert(index < (
unsigned)_dictionaries[GM_HDF5MODEL_FUNCTIONS].size());
111 bool buildAndSaveFunctionsDictionary (
const GmModelData* data);
112 bool buildAndSavePropertySetsDictionary(
const GmCellMesh* mesh);
113 bool buildAndSaveCellGroupsDictionary (
const GmCellMesh* mesh);
114 bool buildAndSaveNodeSetsDictionary (
const GmMesh* mesh);
115 bool buildAndSaveCellBordersDictionary (
const GmCellMesh* mesh);
117 bool saveMeshGeometryNodes (
const GmMesh* mesh);
118 bool saveMeshGeometryNodeSets (
const GmMesh* mesh);
119 bool saveMeshGeometryCells (
const GmCellMesh* mesh);
120 bool saveMeshGeometryBoundaries(
const GmCellMesh* mesh);
121 bool saveInitialData (
const GmMesh* mesh);
122 bool saveBoundaryConditions (
const GmMesh* mesh);
126 int* cellGhostNodesVectorAddCell(
int cellId,
int numGhostNodes);
129 bool addDataTable(GroupType group,
QString subGroup,
QString tableName,
int n,
int d,
const T* values);
131 template <
class T,
class A>
132 bool addDataTableWithAttributes(GroupType group,
QString subGroup,
QString tableName,
int n,
int d,
const T* values,
142 bool createGroupIfNecessary(
QString groupName);
144 void initSavedAttributeLists(
const GmMesh* mesh);
147 template<
class T> T* getBuffer(
int n);
149 double* getFilledDataBuffer(
GmValueAccessor* ac,
const GmMesh* mesh,
bool* bufferHasFunctions = NULL);
BcType
Boundary condition type defining where a BC is applied (node, edge or face)
Definition gmBoundaryCondition.h:62
This class stores a set of cell edges or cell faces that together form a piece of the boundary of a m...
Definition gmCellBoundary.h:44
Base interface class for CellMesh type plugins.
Definition gmCellMesh.h:40
DiscontinuityType
Discontinuity type (defining how the disc. geometry is defined)
Definition gmDiscontinuitySet.h:63
A helper class with enums and methods common to GmHdf5ModelWriter & GmHdf5ModelReader.
Definition gmHdf5Model.h:36
DictionaryType
Definition gmHdf5Model.h:40
QString groupName(QString meshName, GroupType group, QString subGroupName) const
Returns the group name for the given mesh / group type. If type is GM_HDF5MODEL_BC_GROUP or GM_HDF5MO...
Definition gmHdf5Model.cpp:61
GroupType
Definition gmHdf5Model.h:58
A class used to export parts of a GeMA model to an HDF5 file. Its API includes both GeMA centric func...
Definition gmHdf5ModelWriter.h:58
bool _userDefinedAttributes
Set to true if setInitialData() was called. Defines if the _savedXxxAttribtes vectors where user give...
Definition gmHdf5ModelWriter.h:157
QMap< const GmCellBoundary *, int > _edgeMap
Map for converting boundary edges to their associated dictionary entry.
Definition gmHdf5ModelWriter.h:179
double nanToCanonicNan(double v) const
If v is not a Quiet nan value, returns v. Otherwise, returns the canonical Quiet NA.
Definition gmHdf5ModelWriter.h:108
QString _fileName
The saved file name.
Definition gmHdf5ModelWriter.h:151
QMap< const GmCellBoundary *, int > _faceMap
Map for converting boundary faces to their associated dictionary entry.
Definition gmHdf5ModelWriter.h:180
QString _currentMesh
The name of the current mesh being saved.
Definition gmHdf5ModelWriter.h:170
const GmLogCategory & _logger
The logger used to emmit error messages.
Definition gmHdf5ModelWriter.h:152
QMap< const GmNodeSet *, int > _nodeSetMap
Map for converting node sets to their associated dictionary entry.
Definition gmHdf5ModelWriter.h:178
QVector< QPair< QString, int > > _savedCellAttributes
Like _savedNodeAttributes for cell attributes.
Definition gmHdf5ModelWriter.h:164
GmPODVector< char, size_t, GmPODVectorTightGrow > _saveBuffer
An auxiliar buffer that is used by save routines to build temporary data vectors.
Definition gmHdf5ModelWriter.h:167
QString groupName(GroupType group, QString subGroupName) const
Returns the group name for the given group type.If type is GM_HDF5MODEL_BC_GROUP or GM_HDF5MODEL_DS_G...
Definition gmHdf5ModelWriter.h:140
H5::H5File * _fileh
The hdf5 file handle.
Definition gmHdf5ModelWriter.h:169
QVector< QPair< QString, int > > _savedGaussAttributes
Like _savedNodeAttributes for Gauss attributes.
Definition gmHdf5ModelWriter.h:165
int _npsets
The number of property sets currently stored in the Property set dictionary.
Definition gmHdf5ModelWriter.h:175
QVector< QStringList > _dictionaries
The set of saved dictionaries. Indexed by DictionaryType.
Definition gmHdf5ModelWriter.h:173
double dindexToNan(unsigned index) const
Encodes a dictionary index into a nan entry.
Definition gmHdf5ModelWriter.h:96
QVector< QPair< QString, int > > _savedNodeAttributes
Either the user given or the auto defined set of node attributes & state vars whose values should be ...
Definition gmHdf5ModelWriter.h:163
QMap< QString, int > _userFunctionMap
Map for converting user functions to their associated dictionary entry.
Definition gmHdf5ModelWriter.h:177
QVector< const GmBoundaryCondition * > _currentMeshBcs
The set of boundary conditions associated with the current mesh.
Definition gmHdf5ModelWriter.h:171
QSet< QString > _fileGroups
A set used by ensureGroupExists to control the set of groups already created on the file.
Definition gmHdf5ModelWriter.h:174
Class representing a category with multiple logging levels.
Definition gmLog.h:58
Base interface class for Mesh type plugins.
Definition gmMesh.h:48
Auxiliar class used to store the complete set of model data for a simulation.
Definition gmModelData.h:53
A helper class to store an usigned index as the boxed nan value.
Definition gmNanBoxedValue.h:78
This class stores a set of nodes belonging to a mesh. The nodes can belong to the mesh boundary but t...
Definition gmNodeSet.h:34
A simple vector for Plain Old Data (POD) types with the control size variable type parameterized to a...
Definition gmPODVector.h:88
Class used to store the definition of a user function and its parameters.
Definition gmUserFunction.h:82
Interface class for accessing and setting values from an "indexable" collection of values.
Definition gmValueAccessor.h:60
Declaration of the GmBoundaryCondition class.
Declaration of the GmCellType enum.
GmCellType
Mesh Cell types. Don't change type orders or add types without reading comments below.
Definition gmCellType.h:31
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
Implementation of the GmDiscontinuitySet class.
Declaration of the GmHdf5Model class.
Declaration of support functions and macros for information logging.
Declaration of the GmNanBoxedValue class.
Implementation of the GmPODVector template class.