PetscObjectCompose

Associates another PETSc object with a given PETSc object.

Synopsis

int PetscObjectCompose(PetscObject obj,const char name[],PetscObject ptr)
Not Collective

Input Parameters

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

Notes

The second object's reference count is automatically increased by one when it is composed.

Replaces any previous object that had the same name.

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

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

Keywords

object, composition

See Also

PetscObjectQuery(), PetscObjectContainerCreate()

Level:advanced
Location:src/sys/src/objects/inherit.c
System Index
Table of Contents