petsc-3.7.1 2016-05-15
Report Typos and Errors

# PetscObjectTypeCompare

Determines whether a PETSc object is of a particular type.

### Synopsis

    #include "petscsys.h"
    PetscErrorCode  PetscObjectTypeCompare(PetscObject obj,const char type_name[],PetscBool  *same)

Not Collective Many br

### Input Parameters

| obj | - any PETSc object, for example a Vec, Mat or KSP. Many brThis must be cast with a (PetscObject), for example, Many brPetscObjectTypeCompare((PetscObject)mat); Many br
| type_name | - string containing a type name Many br

### Output Parameter

same -PETSC_TRUE if they are the same, else PETSC_FALSE Many br

Many br

### See Also

VecGetType(), KSPGetType(), PCGetType(), SNESGetType()

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

### Examples

src/vec/is/is/examples/tutorials/ex3.c.html
src/vec/is/is/examples/tutorials/ex3f90.F.html
src/ksp/ksp/examples/tutorials/ex7.c.html
src/ksp/ksp/examples/tutorials/ex8.c.html
src/ksp/ksp/examples/tutorials/ex42.c.html
src/ksp/ksp/examples/tutorials/ex43.c.html
src/ksp/ksp/examples/tutorials/ex62.c.html
src/snes/examples/tutorials/ex12.c.html
src/ts/examples/tutorials/ex9.c.html
src/ts/examples/tutorials/ex10.c.html