Loading...
Searching...
No Matches
dolfin::PETScBaseMatrix Class Reference

`#include <PETScBaseMatrix.h>`

Inheritance diagram for dolfin::PETScBaseMatrix:
[legend]
Collaboration diagram for dolfin::PETScBaseMatrix:
[legend]

## Public Member Functions

| PETScBaseMatrix ()
| Constructor.
| PETScBaseMatrix (Mat A)
| Constructor.
| PETScBaseMatrix (const PETScBaseMatrix &A)
| Copy constructor.
| ~PETScBaseMatrix ()
| Destructor.
std::size_t | size (std::size_t dim) const
| Return number of rows (dim = 0) or columns (dim = 1).
std::pair< std::int64_t, std::int64_t > | size () const
std::pair< std::int64_t, std::int64_t > | local_range (std::size_t dim) const
| Return local range along dimension dim.
void | init_vector (GenericVector &z, std::size_t dim) const
Mat | mat () const
| Return PETSc Mat pointer.
MPI_Comm | mpi_comm () const
| Return the MPI communicator.
virtual std::string | str (bool verbose) const
| Return informal string representation (pretty-print).
Public Member Functions inherited from dolfin::PETScObject
| PETScObject ()
| Constructor. Ensures that PETSc has been initialised.
virtual | ~PETScObject ()
| Destructor.
Public Member Functions inherited from dolfin::Variable
| Variable ()
| Create unnamed variable.
| Variable (const std::string name, const std::string label)
| Create variable with given name and label.
| Variable (const Variable &variable)
| Copy constructor.
virtual | ~Variable ()
| Destructor.
const Variable & | operator= (const Variable &variable)
| Assignment operator.
void | rename (const std::string name, const std::string label)
| Rename variable.
std::string | name () const
| Return name.
std::string | label () const
| Return label (description).
std::size_t | id () const

## Protected Attributes

Mat | _matA

## Additional Inherited Members

Static Public Member Functions inherited from dolfin::PETScObject
static void | petsc_error (int error_code, std::string filename, std::string petsc_function)
| Print error message for PETSc calls that return an error.
Public Attributes inherited from dolfin::Variable
Parameters | parameters
| Parameters.

## Detailed Description

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

## Member Function Documentation

## init_vector()

void PETScBaseMatrix::init_vector | ( | GenericVector & | z,
|  | std::size_t | dim ) const

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

Parameters

  z | (GenericVector&) Vector to initialise
  dim | (std::size_t) The dimension (axis): dim = 0 --> z = y, dim = 1 --> z = x

## size()

std::pair< std::int64_t, std::int64_t > PETScBaseMatrix::size | ( |  | ) | const

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

## str()

virtual std::string dolfin::PETScBaseMatrix::str | ( | bool | verbose | ) | const

inline virtual

Return informal string representation (pretty-print).

Reimplemented from dolfin::Variable.

Reimplemented in dolfin::PETScLinearOperator, dolfin::PETScMatrix, and dolfin::PETScNestMatrix.

The documentation for this class was generated from the following files:

- /build/dolfin-lFBzDh/dolfin-2019.2.0~legacy20240219.1c52e83/dolfin/la/PETScBaseMatrix.h
- /build/dolfin-lFBzDh/dolfin-2019.2.0~legacy20240219.1c52e83/dolfin/la/PETScBaseMatrix.cpp