# PetscViewerHDF5HasObject
Check whether a dataset with the same name as given object exists in the HDF5 file under current group 
## Synopsis
```
#include "petscviewerhdf5.h" 
PetscErrorCode PetscViewerHDF5HasObject(PetscViewer viewer, PetscObject obj, PetscBool *has)
```
Collective


## Input Parameters

- ***viewer -*** The `PETSCVIEWERHDF5` viewer
- ***obj    -*** The named object



## Output Parameter

- ***has    -*** Flag for dataset existence



## Notes
If the object is unnamed, an error occurs.

If the path current_group/object_name exists but is not a dataset, has is set to `PETSC_FALSE` as well.




## See Also
 [](sec_viewers), `PETSCVIEWERHDF5`, `PetscViewerHDF5Open()`, `PetscViewerHDF5HasDataset()`, `PetscViewerHDF5HasAttribute()`, `PetscViewerHDF5PushGroup()`, `PetscViewerHDF5PopGroup()`, `PetscViewerHDF5GetGroup()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/hdf5/hdf5v.c.html#PetscViewerHDF5HasObject">src/sys/classes/viewer/impls/hdf5/hdf5v.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex27.c.html">src/ksp/ksp/tutorials/ex27.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/impls/hdf5/hdf5v.c)


[Index of all Viewer routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
