Skip to main content
`Ctrl`+`K`

# PetscObjectObjectTypeCompare

Determines whether two PETSc objects are of the same type

## Synopsis

    #include "petscsys.h"
    PetscErrorCode PetscObjectObjectTypeCompare(PetscObject obj1, PetscObject obj2, PetscBool *same)

Logically Collective

## Input Parameters

- obj1 - any PETSc object, for example a `Vec`, `Mat` or `KSP`.

- obj2 - another PETSc object

## Output Parameter

- same - `PETSC_TRUE` if they are the same or both unset, else `PETSC_FALSE`

## See Also

`PetscObjectTypeCompare()`, `VecGetType()`, `KSPGetType()`, `PCGetType()`, `SNESGetType()`, `PetscObjectBaseTypeCompare()`, `PetscObjectTypeCompareAny()`, `PetscObjectBaseTypeCompareAny()`

## Level

intermediate

## Location

src/sys/objects/destroy.c

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