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(use_gpu=false)

    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

thisown

The membership flag

zero()

Overloaded versions

  • zero()

    Set all entries to zero and keep any sparse structure

  • zero(m, rows)

    Set given rows to zero