PetscObjectGetType — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# PetscObjectGetType

Gets the object type of any `PetscObject`.

## Synopsis

    #include "petscsys.h"
    PetscErrorCode PetscObjectGetType(PetscObject obj, const char *type[])

Not Collective

## Input Parameter

- obj - any PETSc object, for example a `Vec`, `Mat` or `KSP`. It must be cast with a (`PetscObject`), for example, `PetscObjectGetType`((`PetscObject`)mat,&type);

## Output Parameter

- type - the object type, for example, `MATSEQAIJ`

## See Also

`PetscObject`, `PetscClassId`, `PetscObjectGetClassName()`, `PetscObjectGetClassId()`

## Level

advanced

## Location

src/sys/objects/gtype.c

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