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

# PetscObjectComposeFunction

Associates a function with a given PETSc object.

### Synopsis

    #include <petscsys.h>
    PetscErrorCode PetscObjectComposeFunction(PetscObject obj,const char name[],void (*fptr)(void))

Logically Collective on PetscObject Many br

### Input Parameters

| obj | - the PETSc object; this must be cast with a (PetscObject), for example, Many brPetscObjectCompose((PetscObject)mat,...); Many br
| name | - name associated with the child function Many br
| fname | - name of the function Many br
| fptr | - function pointer Many br

Many br

### Notes

To remove a registered routine, pass in NULL for fptr(). Many br

PetscObjectComposeFunction() can be used with any PETSc object (such as Many brMat, Vec, KSP, SNES, etc.) or any user-provided object. Many br

### See Also

PetscObjectQueryFunction(), PetscContainerCreate()

Level:advanced
Location:src/sys/objects/inherit.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/mat/examples/tutorials/ex8.c.html