petsc4py.PETSc.Object#

class petsc4py.PETSc.Object#

Bases: object

Base class wrapping a PETSc object.

See also

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.

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

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

decRef()#

Decrement the object reference count.

Logically collective.

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

Return type:

int

destroy()#

Destroy the object.

Collective.

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

Return type:

Self

destroyOptionsHandlers()#

Clear all the option handlers.

Collective.

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.

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

Return type:

int

getClassName()#

Return the class name of the object.

Not collective.

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

Return type:

str

getComm()#

Return the communicator of the object.

Not collective.

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

PetscObjectGetId

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

Return type:

int

getName()#

Return the name of the object.

Not collective.

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.

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

Return type:

str

getRefCount()#

Return the reference count of the object.

Not collective.

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

Return type:

int

getTabLevel()#

Return the PETSc object tab level.

Not collective.

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

Return type:

None

getType()#

Return the object type name.

Not collective.

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

Return type:

str

incRef()#

Increment the object reference count.

Logically collective.

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

Return type:

int

incrementTabLevel(tab, parent=None)#

Increment the PETSc object tab level.

Logically collective.

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.

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.

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

Return type:

None

setName(name)#

Associate a name to the object.

Not collective.

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

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

setOptionsPrefix(prefix)#

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

Logically collective.

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.

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

Parameters:

level (int)

Return type:

None

stateGet()#

Return the PETSc object state.

Not collective.

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

Return type:

int

stateIncrease()#

Increment the PETSc object state.

Logically collective.

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

Return type:

None

stateSet(state)#

Set the PETSc object state.

Logically collective.

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

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

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