DOLFIN
DOLFIN C++ interface
Public Member Functions | Protected Attributes | List of all members
dolfin::PETScBaseMatrix Class Reference

#include <PETScBaseMatrix.h>

Inheritance diagram for dolfin::PETScBaseMatrix:
Inheritance graph
[legend]
Collaboration diagram for dolfin::PETScBaseMatrix:
Collaboration graph
[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 Variableoperator= (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.


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