:orphan:
# PetscObjectQueryFunction
Gets a function associated with a given object. 
## Synopsis
```
#include <petscsys.h>
PetscErrorCode PetscObjectQueryFunction(PetscObject obj,const char name[],void (**fptr)(void))
```
Logically Collective


## Input Parameters

- ***obj -*** the PETSc object; this must be cast with (`PetscObject`), for example,
`PetscObjectQueryFunction`((`PetscObject`)ksp,...);
- ***name -*** name associated with the child function



## Output Parameter

- ***fptr -*** function pointer





## See Also
 `PetscObjectComposeFunction()`, `PetscFunctionListFind()`, `PetscObjectCompose()`, `PetscObjectQuery()`, `PetscObject`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/inherit.c.html#PetscObjectQueryFunction">src/sys/objects/inherit.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/tutorials/ex8.c.html">src/mat/tutorials/ex8.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/inherit.c)


[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)  
