:orphan:
# PetscUseTypeMethod
Call a method on a `PetscObject`, that is a function in the objects function table `obj->ops`, error if the method does not exist 
## Synopsis
```
#include "petsc/private/petscimpl.h"
PetscUseTypeMethod(obj, method, other_args)
```

## Input Parameters

- ***obj -*** the object, for example a `Mat`, that does not need to be cast to `PetscObject`
- ***method -*** the name of the method, for example, mult for the PETSc routine `MatMult()`
- ***other_args -*** the other arguments for the method, `obj` is the first argument





## Note
This does not return an error code, it is a macro that returns with an error code on error.

Use `PetscUseMethod()` or `PetscTryMethod()` to call functions that have been composed to an object with `PetscObjectComposeFunction()`


## See Also
 `PetscTryMethod()`, `PetscUseMethod()`, `PetscCall()`, `PetscCheck()`, `PetscTryTypeMethod()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petsc/private/petscimpl.h.html#PetscUseTypeMethod">include/petsc/private/petscimpl.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petsc/private/petscimpl.h)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
