petsc4py.PETSc.Object

class petsc4py.PETSc.Object

Bases: object

Base class wrapping a PETSc object.

See also

petsc.PetscObject

Methods Summary

appendOptionsPrefix(prefix)

Append to the prefix used for searching for options in the database.

compose(name, obj)

Associate a PETSc object using a key string.

decRef()

Decrement the object reference count.

destroy()

Destroy the object.

destroyOptionsHandlers()

Clear all the option handlers.

getAttr(name)

Return the attribute associated with a given name.

getClassId()

Return the class identifier of the object.

getClassName()

Return the class name of the object.

getComm()

Return the communicator of the object.

getDict()

Return the dictionary of attributes.

getId()

Return the unique identifier of the object.

getName()

Return the name of the object.

getOptionsPrefix()

Return the prefix used for searching for options in the database.

getRefCount()

Return the reference count of the object.

getTabLevel()

Return the PETSc object tab level.

getType()

Return the object type name.

incRef()

Increment the object reference count.

incrementTabLevel(tab[, parent])

Increment the PETSc object tab level.

query(name)

Query for the PETSc object associated with a key string.

setAttr(name, attr)

Set an the attribute associated with a given name.

setFromOptions()

Configure the object from the options database.

setName(name)

Associate a name to the object.

setOptionsHandler(handler)

Set the callback for processing extra options.

setOptionsPrefix(prefix)

Set the prefix used for searching for options in the database.

setTabLevel(level)

Set the PETSc object tab level.

stateGet()

Return the PETSc object state.

stateIncrease()

Increment the PETSc object state.

stateSet(state)

Set the PETSc object state.

view([viewer])

Display the object.

viewFromOptions(name[, objpre])

View the object via command line options.

Attributes Summary

classid

The class identifier.

comm

The object communicator.

fortran

Fortran handle.

handle

Handle for ctypes support.

id

The object identifier.

klass

The class name.

name

The object name.

prefix

Options prefix.

refcount

Reference count.

type

Object type.

Methods Documentation

appendOptionsPrefix(prefix)

Append to the prefix used for searching for options in the database.

Logically collective.

See also

Working with PETSc options, setOptionsPrefix, petsc.PetscObjectAppendOptionsPrefix

Source code at petsc4py/PETSc/Object.pyx:138

Parameters:

prefix (str | None)

Return type:

None

compose(name, obj)

Associate a PETSc object using a key string.

Logically collective.

Parameters:
  • name (str | None) – The string identifying the object to be composed.

  • obj (Object) – The object to be composed.

Return type:

None

See also

query, petsc.PetscObjectCompose

Source code at petsc4py/PETSc/Object.pyx:324

decRef()

Decrement the object reference count.

Logically collective.

See also

getRefCount, petsc.PetscObjectDereference

Source code at petsc4py/PETSc/Object.pyx:384

Return type:

int

destroy()

Destroy the object.

Collective.

See also

petsc.PetscObjectDestroy

Source code at petsc4py/PETSc/Object.pyx:81

Return type:

Self

destroyOptionsHandlers()

Clear all the option handlers.

Collective.

See also

Working with PETSc options, setOptionsHandler, petsc.PetscObjectDestroyOptionsHandlers

Source code at petsc4py/PETSc/Object.pyx:208

Return type:

None

getAttr(name)

Return the attribute associated with a given name.

Not collective.

See also

setAttr, getDict

Source code at petsc4py/PETSc/Object.pyx:403

Parameters:

name (str)

Return type:

object

getClassId()

Return the class identifier of the object.

Not collective.

See also

petsc.PetscObjectGetClassId

Source code at petsc4py/PETSc/Object.pyx:265

Return type:

int

getClassName()

Return the class name of the object.

Not collective.

See also

petsc.PetscObjectGetClassName

Source code at petsc4py/PETSc/Object.pyx:279

Return type:

str

getComm()

Return the communicator of the object.

Not collective.

See also

petsc.PetscObjectGetComm

Source code at petsc4py/PETSc/Object.pyx:223

Return type:

Comm

getDict()

Return the dictionary of attributes.

Not collective.

See also

setAttr, getAttr

Source code at petsc4py/PETSc/Object.pyx:431

Return type:

dict

getId()

Return the unique identifier of the object.

Not collective.

See also

petsc.PetscObjectGetId

Source code at petsc4py/PETSc/Object.pyx:308

Return type:

int

getName()

Return the name of the object.

Not collective.

See also

petsc.PetscObjectGetName

Source code at petsc4py/PETSc/Object.pyx:237

Return type:

str

getOptionsPrefix()

Return the prefix used for searching for options in the database.

Not collective.

See also

Working with PETSc options, setOptionsPrefix, petsc.PetscObjectGetOptionsPrefix

Source code at petsc4py/PETSc/Object.pyx:124

Return type:

str

getRefCount()

Return the reference count of the object.

Not collective.

See also

petsc.PetscObjectGetReference

Source code at petsc4py/PETSc/Object.pyx:293

Return type:

int

getTabLevel()

Return the PETSc object tab level.

Not collective.

See also

setTabLevel, incrementTabLevel, petsc.PetscObjectGetTabLevel

Source code at petsc4py/PETSc/Object.pyx:513

Return type:

None

getType()

Return the object type name.

Not collective.

See also

petsc.PetscObjectGetType

Source code at petsc4py/PETSc/Object.pyx:94

Return type:

str

incRef()

Increment the object reference count.

Logically collective.

See also

getRefCount, petsc.PetscObjectReference

Source code at petsc4py/PETSc/Object.pyx:367

Return type:

int

incrementTabLevel(tab, parent=None)

Increment the PETSc object tab level.

Logically collective.

See also

setTabLevel, getTabLevel, petsc.PetscObjectIncrementTabLevel

Source code at petsc4py/PETSc/Object.pyx:486

Parameters:
Return type:

None

query(name)

Query for the PETSc object associated with a key string.

Not collective.

See also

compose, petsc.PetscObjectQuery

Source code at petsc4py/PETSc/Object.pyx:347

Parameters:

name (str)

Return type:

Object

setAttr(name, attr)

Set an the attribute associated with a given name.

Not collective.

See also

getAttr, getDict

Source code at petsc4py/PETSc/Object.pyx:417

Parameters:
Return type:

None

setFromOptions()

Configure the object from the options database.

Collective.

See also

Working with PETSc options, petsc.PetscObjectSetFromOptions

Source code at petsc4py/PETSc/Object.pyx:152

Return type:

None

setName(name)

Associate a name to the object.

Not collective.

See also

petsc.PetscObjectSetName

Source code at petsc4py/PETSc/Object.pyx:251

Parameters:

name (str | None)

Return type:

None

setOptionsHandler(handler)

Set the callback for processing extra options.

Logically collective.

Parameters:

handler (PetscOptionsHandlerFunction | None) – The callback function, called at the end of setFromOptions.

Return type:

None

See also

Working with PETSc options, setFromOptions, petsc.PetscObjectAddOptionsHandler

Source code at petsc4py/PETSc/Object.pyx:187

setOptionsPrefix(prefix)

Set the prefix used for searching for options in the database.

Logically collective.

See also

Working with PETSc options, getOptionsPrefix, petsc.PetscObjectSetOptionsPrefix

Source code at petsc4py/PETSc/Object.pyx:110

Parameters:

prefix (str | None)

Return type:

None

setTabLevel(level)

Set the PETSc object tab level.

Logically collective.

See also

incrementTabLevel, getTabLevel, petsc.PetscObjectSetTabLevel

Source code at petsc4py/PETSc/Object.pyx:500

Parameters:

level (int)

Return type:

None

stateGet()

Return the PETSc object state.

Not collective.

See also

stateSet, stateIncrease, petsc.PetscObjectStateGet

Source code at petsc4py/PETSc/Object.pyx:457

Return type:

int

stateIncrease()

Increment the PETSc object state.

Logically collective.

See also

stateGet, stateSet, petsc.PetscObjectStateIncrease

Source code at petsc4py/PETSc/Object.pyx:445

Return type:

None

stateSet(state)

Set the PETSc object state.

Logically collective.

See also

stateIncrease, stateGet, petsc.PetscObjectStateSet

Source code at petsc4py/PETSc/Object.pyx:471

Parameters:

state (int)

Return type:

None

view(viewer=None)

Display the object.

Collective.

Parameters:

viewer (Viewer | None) – A Viewer instance or None for the default viewer.

Return type:

None

See also

petsc.PetscObjectView

Source code at petsc4py/PETSc/Object.pyx:62

viewFromOptions(name, objpre=None)

View the object via command line options.

Collective.

Parameters:
  • name (str) – The command line option.

  • objpre (Object | None) – Optional object that provides prefix.

Return type:

None

See also

Working with PETSc options, petsc.PetscObjectViewFromOptions

Source code at petsc4py/PETSc/Object.pyx:164

Attributes Documentation

classid

The class identifier.

Source code at petsc4py/PETSc/Object.pyx:558

comm

The object communicator.

Source code at petsc4py/PETSc/Object.pyx:545

fortran

Fortran handle.

Source code at petsc4py/PETSc/Object.pyx:588

handle

Handle for ctypes support.

Source code at petsc4py/PETSc/Object.pyx:580

id

The object identifier.

Source code at petsc4py/PETSc/Object.pyx:563

klass

The class name.

Source code at petsc4py/PETSc/Object.pyx:568

name

The object name.

Source code at petsc4py/PETSc/Object.pyx:550

prefix

Options prefix.

Source code at petsc4py/PETSc/Object.pyx:537

refcount

Reference count.

Source code at petsc4py/PETSc/Object.pyx:573

type

Object type.

Source code at petsc4py/PETSc/Object.pyx:529