PetscFunctionListAdd#

Add a function pointer to a PetscFunctionList, under a string name

Synopsis#

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

Not Collective

Input Parameters#

  • list - the function list; if *list is NULL, a new list is created

  • name - string under which to register the function

  • fptr - the function pointer; if NULL, any previous registration under name is removed

Notes#

Users who wish to register new classes for use by a particular PETSc component (e.g., SNES) should generally call the registration routine for that particular component (e.g., SNESRegister()) instead of calling PetscFunctionListAdd() directly.

The macro casts fptr to the internal PetscErrorCodeFn * representation before calling PetscFunctionListAdd_Private() so that any error-code-returning function-pointer type may be supplied without an explicit cast.

See Also#

PetscFunctionList, PetscFunctionListFind(), PetscFunctionListDestroy(), PetscFunctionListDuplicate(), PetscFunctionListView(), PetscObjectComposeFunction(), SNESRegister(), KSPRegister(), PCRegister(), TSRegister()

Level#

developer

Location#

include/petscsys.h

Examples#

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


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