PetscObjectTypeCompareAny — PETSc 3.22.5 documentation

Skip to main content
`Ctrl`+`K`

# PetscObjectTypeCompareAny

Determines whether a PETSc object is of any of a list of types.

## Synopsis

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

Not Collective

## Input Parameters

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

- type_name - one or more string arguments containing type names, pass the empty string “” as the last argument

## Output Parameter

- match - `PETSC_TRUE` if the type of `obj` matches any in the list, else `PETSC_FALSE`

## See Also

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

## Level

intermediate

## Location

src/sys/objects/destroy.c

## Examples

src/ksp/ksp/tutorials/ex79.c

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