PetscFunctionListFind — PETSc 3.25.4 documentation

Skip to main content
`Ctrl`+`K`

# PetscFunctionListFind

Look up a function pointer in a `PetscFunctionList` by its registered string name

## Synopsis

    #include <petscsys.h>
    PetscErrorCode PetscFunctionListFind(PetscFunctionList list, const char name[], void (**fptr)(void))

Not Collective; No Fortran Support

## Input Parameters

- list - the function list

- name - string under which the function was registered with `PetscFunctionListAdd()`

## Output Parameter

- fptr - the address into which the function pointer is written; set to `NULL` if no function of this name is registered

## Note

The macro casts `fptr` to the internal `PetscErrorCodeFn **` representation before calling `PetscFunctionListFind_Private()` so that any function-pointer type can be supplied without an explicit cast.

## See Also

`PetscFunctionList`, `PetscFunctionListAdd()`, `PetscFunctionListDestroy()`, `PetscObjectQueryFunction()`

## Level

developer

## Location

include/petscsys.h

## Examples

src/ts/tutorials/ex8.c
src/ml/da/tutorials/ex3.c
src/ts/tutorials/ex11.c
src/ts/utils/dmplexlandau/tutorials/ex2.c
src/ts/tutorials/ex9.c
src/ksp/ksp/tutorials/ex74.c

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