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

PetscObjectCompose

Associates another PETSc object with a given PETSc object.

Synopsis

#include "petscsys.h"    
PetscErrorCode  PetscObjectCompose(PetscObject obj,const char name[],PetscObject ptr)
Not Collective Many br

Input Parameters

obj - the PETSc object; this must be cast with (PetscObject), for example, Many brPetscObjectCompose((PetscObject)mat,...); Many br
name - name associated with the child object Many br
ptr - the other PETSc object to associate with the PETSc object; this must also be Many brcast with (PetscObject) Many br

Many br

Notes

The second objects reference count is automatically increased by one when it is Many brcomposed. Many br

Replaces any previous object that had the same name. Many br

If ptr is null and name has previously been composed using an object, then that Many brentry is removed from the obj. Many br

PetscObjectCompose() can be used with any PETSc object (such as Many brMat, Vec, KSP, SNES, etc.) or any user-provided object. See Many brPetscContainerCreate() for info on how to create an object from a Many bruser-provided pointer that may then be composed with PETSc objects. Many br

See Also

PetscObjectQuery(), 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/snes/examples/tutorials/ex12.c.html
src/snes/examples/tutorials/ex48.c.html
src/snes/examples/tutorials/ex62.c.html
src/snes/examples/tutorials/ex77.c.html