# 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.

    See also

    Working with PETSc options, `setOptionsPrefix`, `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`, `PetscObjectCompose`

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

  decRef()

    Decrement the object reference count.

    Logically collective.

    See also

    `getRefCount`, `PetscObjectDereference`

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

    Return type:

      int

  destroy()

    Destroy the object.

    Collective.

    See also

    `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`, `PetscObjectDestroyOptionsHandlers`

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

    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:408

    Parameters:

      name (str)

    Return type:

      object

  getClassId()

    Return the class identifier of the object.

    Not collective.

    See also

    `PetscObjectGetClassId`

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

    Return type:

      int

  getClassName()

    Return the class name of the object.

    Not collective.

    See also

    `PetscObjectGetClassName`

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

    Return type:

      str

  getComm()

    Return the communicator of the object.

    Not collective.

    See also

    `PetscObjectGetComm`

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

    Return type:

      Comm

  getDict()

    Return the dictionary of attributes.

    Not collective.

    See also

    `setAttr`, `getAttr`

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

    Return type:

      dict

  getId()

    Return the unique identifier of the object.

    Not collective.

    See also

    `PetscObjectGetId`

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

    Return type:

      int

  getName()

    Return the name of the object.

    Not collective.

    See also

    `PetscObjectGetName`

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

    Return type:

      str

  getOptionsPrefix()

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

    Not collective.

    See also

    Working with PETSc options, `setOptionsPrefix`, `PetscObjectGetOptionsPrefix`

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

    Return type:

      str

  getRefCount()

    Return the reference count of the object.

    Not collective.

    See also

    `PetscObjectGetReference`

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

    Return type:

      int

  getTabLevel()

    Return the PETSc object tab level.

    Not collective.

    See also

    `setTabLevel`, `incrementTabLevel`, `PetscObjectGetTabLevel`

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

    Return type:

      None

  getType()

    Return the object type name.

    Not collective.

    See also

    `PetscObjectGetType`

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

    Return type:

      str

  incRef()

    Increment the object reference count.

    Logically collective.

    See also

    `getRefCount`, `PetscObjectReference`

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

    Return type:

      int

  incrementTabLevel(tab, parent=None)

    Increment the PETSc object tab level.

    Logically collective.

    See also

    `setTabLevel`, `getTabLevel`, `PetscObjectIncrementTabLevel`

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

    Parameters:

      - tab (int)

      - parent (Object | None)

    Return type:

      None

  query(name)

    Query for the PETSc object associated with a key string.

    Not collective.

    See also

    `compose`, `PetscObjectQuery`

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

    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:422

    Parameters:

      - name (str)

      - attr (object)

    Return type:

      None

  setFromOptions()

    Configure the object from the options database.

    Collective.

    Classes that do not implement `setFromOptions` use this method that, in turn, calls `PetscObjectSetFromOptions`.

    See also

    Working with PETSc options, `PetscObjectSetFromOptions`

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

    Return type:

      None

  setName(name)

    Associate a name to the object.

    Not collective.

    See also

    `PetscObjectSetName`

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

    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 a `setFromOptions` invocation for the given class.

    Return type:

      None

    See also

    Working with PETSc options, `Mat.setFromOptions`, `KSP.setFromOptions`, `PetscObjectAddOptionsHandler`

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

  setOptionsPrefix(prefix)

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

    Logically collective.

    See also

    Working with PETSc options, `getOptionsPrefix`, `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`, `PetscObjectSetTabLevel`

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

    Parameters:

      level (int)

    Return type:

      None

  stateGet()

    Return the PETSc object state.

    Not collective.

    See also

    `stateSet`, `stateIncrease`, `PetscObjectStateGet`

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

    Return type:

      int

  stateIncrease()

    Increment the PETSc object state.

    Logically collective.

    See also

    `stateGet`, `stateSet`, `PetscObjectStateIncrease`

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

    Return type:

      None

  stateSet(state)

    Set the PETSc object state.

    Logically collective.

    See also

    `stateIncrease`, `stateGet`, `PetscObjectStateSet`

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

    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

    See also

    Working with PETSc options, `PetscObjectViewFromOptions`

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

  Attributes Documentation

  classid

    The class identifier.

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

  comm

    The object communicator.

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

  fortran

    Fortran handle.

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

  handle

    Handle for ctypes support.

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

  id

    The object identifier.

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

  klass

    The class name.

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

  name

    The object name.

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

  prefix

    Options prefix.

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

  refcount

    Reference count.

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

  type

    Object type.

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