Actual source code: viewerhdf5impl.h
1: #ifndef __VIEWERHDF5IMPL_H
4: #if defined(H5_VERSION)
5: # error "viewerhdf5impl.h must be included *before* any other HDF5 headers"
6: #else
7: # define H5_USE_18_API
8: #endif
9: #include <petscviewerhdf5.h>
10: #include <petsc/private/viewerimpl.h>
12: #if defined(PETSC_HAVE_HDF5)
14: /*
15: HDF5 function specifications usually read:
16: Returns a non-negative value if successful; otherwise returns a negative value.
17: (see e.g. https://support.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-Close)
18: */
19: #define PetscStackCallHDF5(func,args) do { \
20: herr_t _status; \
22: } while (0)
24: #define PetscStackCallHDF5Return(ret,func,args) do { \
26: } while (0)
28: typedef struct PetscViewerHDF5GroupList {
29: const char *name;
30: struct PetscViewerHDF5GroupList *next;
31: } PetscViewerHDF5GroupList;
33: typedef struct {
34: char *filename;
35: PetscFileMode btype;
36: hid_t file_id;
37: hid_t dxpl_id; /* H5P_DATASET_XFER property list controlling raw data transfer (read/write). Properties are modified using H5Pset_dxpl_* functions. */
38: PetscBool timestepping; /* Flag to indicate whether objects are stored by tiem index */
39: PetscInt timestep; /* The time index to look for an object at */
40: PetscBool defTimestepping; /* Default if timestepping attribute is not found. Support for legacy files with no timestepping attribute */
41: PetscViewerHDF5GroupList *groups;
42: PetscBool basedimension2; /* save vectors and DMDA vectors with a dimension of at least 2 even if the bs/dof is 1 */
43: PetscBool spoutput; /* write data in single precision even if PETSc is compiled with double precision PetscReal */
44: PetscBool horizontal; /* store column vectors as blocks (needed for MATDENSE I/O) */
45: } PetscViewer_HDF5;
47: PETSC_EXTERN PetscErrorCode PetscViewerHDF5CheckTimestepping_Internal(PetscViewer, const char[]); /* currently used in src/dm/impls/da/gr2.c so needs to be extern */
48: #endif
49: #endif