Loading...
Searching...
No Matches
dolfin::LinearOperator Class Referenceabstract

`#include <LinearOperator.h>`

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

## Public Member Functions

| LinearOperator ()
| Create linear operator.
| LinearOperator (const GenericVector &x, const GenericVector &y)
virtual | ~LinearOperator ()
| Destructor.
virtual std::size_t | size (std::size_t dim) const =0
| Return size of given dimension.
virtual void | mult (const GenericVector &x, GenericVector &y) const =0
| Compute matrix-vector product y = Ax.
virtual MPI_Comm | mpi_comm () const
| Return the MPI communicator.
std::string | str (bool verbose) const
| Return informal string representation (pretty-print).
virtual const GenericLinearOperator * | instance () const
| Return concrete instance / unwrap (const version).
virtual GenericLinearOperator * | instance ()
| Return concrete instance / unwrap (non-const version).
virtual std::shared_ptr< const LinearAlgebraObject > | shared_instance () const
| Return concrete instance / unwrap (const shared pointer version).
virtual std::shared_ptr< LinearAlgebraObject > | shared_instance ()
| Return concrete instance / unwrap (shared pointer version).
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

## Additional Inherited Members

Public Attributes inherited from dolfin::Variable
Parameters | parameters
| Parameters.
Protected Member Functions inherited from dolfin::GenericLinearOperator
virtual void | init_layout (const GenericVector &x, const GenericVector &y, GenericLinearOperator *wrapper)

## Detailed Description

This class defines an interface for linear operators defined only in terms of their action (matrix-vector product) and can be used for matrix-free solution of linear systems. The linear algebra backend is decided at run-time based on the present value of the "linear_algebra_backend" parameter.

To define a linear operator, users need to inherit from this class and overload the function mult(x, y) which defines the action of the matrix on the vector x as y = Ax.

## Constructor & Destructor Documentation

## LinearOperator()

LinearOperator::LinearOperator | ( | const GenericVector & | x,
|  | const GenericVector & | y )

Create linear operator to match parallel layout of vectors x and y for product y = Ax.

## Member Function Documentation

## instance() [1/2]

GenericLinearOperator * LinearOperator::instance | ( |  | ) |

virtual

Return concrete instance / unwrap (non-const version).

Reimplemented from dolfin::LinearAlgebraObject.

## instance() [2/2]

const GenericLinearOperator * LinearOperator::instance | ( |  | ) | const

virtual

Return concrete instance / unwrap (const version).

Reimplemented from dolfin::LinearAlgebraObject.

## mpi_comm()

virtual MPI_Comm dolfin::LinearOperator::mpi_comm | ( |  | ) | const

inline virtual

Return the MPI communicator.

Implements dolfin::LinearAlgebraObject.

## mult()

virtual void dolfin::LinearOperator::mult | ( | const GenericVector & | x,
|  | GenericVector & | y ) const

pure virtual

Compute matrix-vector product y = Ax.

Implements dolfin::GenericLinearOperator.

## shared_instance() [1/2]

std::shared_ptr< LinearAlgebraObject > LinearOperator::shared_instance | ( |  | ) |

virtual

Return concrete instance / unwrap (shared pointer version).

Reimplemented from dolfin::LinearAlgebraObject.

## shared_instance() [2/2]

std::shared_ptr< const LinearAlgebraObject > LinearOperator::shared_instance | ( |  | ) | const

virtual

Return concrete instance / unwrap (const shared pointer version).

Reimplemented from dolfin::LinearAlgebraObject.

## size()

virtual std::size_t dolfin::LinearOperator::size | ( | std::size_t | dim | ) | const

pure virtual

Return size of given dimension.

Implements dolfin::GenericLinearOperator.

## str()

std::string LinearOperator::str | ( | bool | verbose | ) | const

virtual

Return informal string representation (pretty-print).

Implements dolfin::GenericLinearOperator.

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

- /build/dolfin-wwk1CC/dolfin-2019.2.0~legacy20240219.1c52e83/dolfin/la/LinearOperator.h
- /build/dolfin-wwk1CC/dolfin-2019.2.0~legacy20240219.1c52e83/dolfin/la/LinearOperator.cpp