PETScMatrix

class dolfin.cpp.la.PETScMatrix(*args)

Bases: dolfin.cpp.la.GenericMatrix, dolfin.cpp.la.PETScBaseMatrix

This class provides a simple matrix class based on PETSc. It is a wrapper for a PETSc matrix pointer (Mat) implementing the GenericMatrix interface.

The interface is intentionally simple. For advanced usage, access the PETSc Mat pointer using the function mat() and use the standard PETSc interface.

Overloaded versions

  • PETScMatrix()

    Create empty matrix

  • PETScMatrix(A)

    Create a wrapper around a PETSc Mat pointer

  • PETScMatrix(A)

    Copy constructor

assign()

Overloaded versions

  • operator=(A)

    Assignment operator

  • operator=(A)

    Assignment operator

binary_dump()

Dump matrix to PETSc binary format

get_options_prefix()

Returns the prefix used by PETSc when searching the options database

set_nullspace()

Attach nullspace to matrix

set_options_prefix()

Sets the prefix used by PETSc when searching the options database

thisown

The membership flag

zero()

Overloaded versions

  • zero()

    Set all entries to zero and keep any sparse structure

  • zero(m, rows)

    Set given rows (global row indices) to zero