petsc-3.12.5 2020-03-29
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

Input Parameters

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

Notes

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

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

See Also

PetscObjectQueryFunction(), PetscContainerCreate()

Level

advanced

Location

src/sys/objects/inherit.c

Examples

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

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