petsc-3.3-p7 2013-05-11

PetscObjectComposeFunctionDynamic

Associates a function with a given PETSc object.

Synopsis

PetscErrorCode PetscObjectComposeFunctionDynamic(PetscObject obj,const char name[],const char fname[],void *ptr)
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
ptr - function pointer (or PETSC_NULL if using dynamic libraries)

Notes

To remove a registered routine, pass in a PETSC_NULL rname and fnc().

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

The composed function must be wrapped in a EXTERN_C_BEGIN/END for this to work in C++/complex with dynamic link libraries (./configure options --with-shared-libraries --with-dynamic-loading) enabled.

See Also

PetscObjectQueryFunction()

Level:advanced
Location:
include/petscsys.h
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