Skip to main content
`Ctrl`+`K`

# PetscObject

any PETSc object, for example: `PetscViewer`, `Mat`, `Vec`, `KSP`, `DM`

## Synopsis

    typedef struct _p_PetscObject *PetscObject;

## Notes

This is the base class from which all PETSc objects are derived.

In certain situations one can cast an object, for example a `Vec`, to a `PetscObject` with (`PetscObject`)vec

## See Also

`PetscObjectDestroy()`, `PetscObjectView()`, `PetscObjectGetName()`, `PetscObjectSetName()`, `PetscObjectReference()`, `PetscObjectDereference()`

## Level

beginner

## Location

include/petscsystypes.h

## Examples

src/sys/tutorials/ex7.c
src/snes/tutorials/ex69.c
src/snes/tutorials/ex77.c
src/dm/impls/plex/tutorials/ex4f90.F90
src/sys/tutorials/ex6.c
src/ksp/ksp/tutorials/ex43.c
src/ts/tutorials/ex46.c
src/snes/tutorials/ex62.c
src/snes/tutorials/ex56.c
src/snes/tutorials/ex63.c

## Implementations

_p_PetscObject in include/petsc/private/petscimpl.h

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages