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

This class provides a general solver for linear systems Ax = b. More...

`#include <GenericLinearSolver.h>`

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

## Public Member Functions

virtual void | set_operator (std::shared_ptr< const GenericLinearOperator > A)=0
| Set operator (matrix).
virtual void | set_operators (std::shared_ptr< const GenericLinearOperator > A, std::shared_ptr< const GenericLinearOperator > P)
| Set operator (matrix) and preconditioner matrix.
virtual std::size_t | solve (const GenericLinearOperator &A, GenericVector &x, const GenericVector &b)
| Solve linear system Ax = b.
virtual std::size_t | solve (GenericVector &x, const GenericVector &b)=0
| Solve linear system Ax = b.
virtual std::string | parameter_type () const
| Return parameter type: "krylov_solver" or "lu_solver".
virtual void | update_parameters (const Parameters &parameters)
| Update solver parameters (useful for LinearSolver wrapper).
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
virtual std::string | str (bool verbose) const
| Return informal string representation (pretty-print).

## Static Protected Member Functions

static const GenericMatrix & | require_matrix (const GenericLinearOperator &A)
static std::shared_ptr< const GenericMatrix > | require_matrix (std::shared_ptr< const GenericLinearOperator > A)

## Additional Inherited Members

Public Attributes inherited from dolfin::Variable
Parameters | parameters
| Parameters.

## Detailed Description

This class provides a general solver for linear systems Ax = b.

## Member Function Documentation

## parameter_type()

virtual std::string dolfin::GenericLinearSolver::parameter_type | ( |  | ) | const

inline virtual

Return parameter type: "krylov_solver" or "lu_solver".

Reimplemented in dolfin::Amesos2LUSolver, dolfin::BelosKrylovSolver, dolfin::EigenKrylovSolver, dolfin::EigenLUSolver, dolfin::KrylovSolver, dolfin::LinearSolver, dolfin::LUSolver, dolfin::PETScKrylovSolver, and dolfin::PETScLUSolver.

## require_matrix() [1/2]

const GenericMatrix & GenericLinearSolver::require_matrix | ( | const GenericLinearOperator & | A | ) |

static protected

Down-cast GenericLinearOperator to GenericMatrix when an actual matrix is required, not only a linear operator. This is the const reference version of the down-cast.

## require_matrix() [2/2]

std::shared_ptr< const GenericMatrix > GenericLinearSolver::require_matrix | ( | std::shared_ptr< const GenericLinearOperator > | A | ) |

static protected

Down-cast GenericLinearOperator to GenericMatrix when an actual matrix is required, not only a linear operator. This is the const reference version of the down-cast.

## set_operator()

virtual void dolfin::GenericLinearSolver::set_operator | ( | std::shared_ptr< const GenericLinearOperator > | A | ) |

pure virtual

Set operator (matrix).

Implemented in dolfin::Amesos2LUSolver, dolfin::BelosKrylovSolver, dolfin::EigenKrylovSolver, dolfin::EigenLUSolver, dolfin::KrylovSolver, dolfin::LinearSolver, dolfin::LUSolver, dolfin::PETScKrylovSolver, and dolfin::PETScLUSolver.

## set_operators()

virtual void dolfin::GenericLinearSolver::set_operators | ( | std::shared_ptr< const GenericLinearOperator > | A,
|  | std::shared_ptr< const GenericLinearOperator > | P )

inline virtual

Set operator (matrix) and preconditioner matrix.

Reimplemented in dolfin::BelosKrylovSolver, dolfin::EigenKrylovSolver, dolfin::KrylovSolver, dolfin::LinearSolver, and dolfin::PETScKrylovSolver.

## solve() [1/2]

virtual std::size_t dolfin::GenericLinearSolver::solve | ( | const GenericLinearOperator & | A,
|  | GenericVector & | x,
|  | const GenericVector & | b )

inline virtual

Solve linear system Ax = b.

Reimplemented in dolfin::Amesos2LUSolver, dolfin::BelosKrylovSolver, dolfin::EigenKrylovSolver, dolfin::EigenLUSolver, dolfin::KrylovSolver, dolfin::LinearSolver, dolfin::LUSolver, dolfin::PETScKrylovSolver, and dolfin::PETScLUSolver.

## solve() [2/2]

virtual std::size_t dolfin::GenericLinearSolver::solve | ( | GenericVector & | x,
|  | const GenericVector & | b )

pure virtual

Solve linear system Ax = b.

Implemented in dolfin::Amesos2LUSolver, dolfin::BelosKrylovSolver, dolfin::EigenKrylovSolver, dolfin::EigenLUSolver, dolfin::KrylovSolver, dolfin::LinearSolver, dolfin::LUSolver, dolfin::PETScKrylovSolver, and dolfin::PETScLUSolver.

## update_parameters()

virtual void dolfin::GenericLinearSolver::update_parameters | ( | const Parameters & | parameters | ) |

inline virtual

Update solver parameters (useful for LinearSolver wrapper).

Reimplemented in dolfin::KrylovSolver, dolfin::LinearSolver, and dolfin::LUSolver.

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

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