PETScBaseMatrix

class dolfin.cpp.la.PETScBaseMatrix(*args, **kwargs)

Bases: dolfin.cpp.la.PETScObject, dolfin.cpp.common.Variable

This class is a base class for matrices that can be used in PETScKrylovSolver.

init_vector()

Initialize vector to be compatible with the matrix-vector product y = Ax. In the parallel case, both size and layout are important.

Arguments
dim (int)
The dimension (axis): dim = 0 –> z = y, dim = 1 –> z = x
local_range()

Return local range along dimension dim

mat()

Return petsc4py representation of PETSc Mat

mpi_comm()

Return the MPI communicator

size()

Overloaded versions

  • size(dim)

    Return number of rows (dim = 0) or columns (dim = 1)

  • size()

    Return number of rows and columns (num_rows, num_cols). PETSc returns -1 if size has not been set.

thisown

The membership flag