PetscObjectCompose

Associates another PETSc object with a given PETSc object.

Synopsis

int PetscObjectCompose(PetscObject obj,char *name,PetscObject ptr)
Not Collective

Input Parameters

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

Notes

The second objects reference count is automatically increased by one when it iscomposed.

Replaces any previous object that had the same name.

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

See PetscObjectContainerCreate() for how to create an object from a user pointerthat may then be composed with PETSc objects. PetscObjectCompose() can be used with any PETSc object such atMat, Vec, KSP, SNES, etc, or any user provided object.

Keywords

object, composition

See Also

PetscObjectQuery(), PetscObjectContainerCreate()

Location: src/sys/src/objectsinherit.c
System Index
Table of Contents