Loading...
Searching...
No Matches
Dune::Cholmod< Vector, Index > Class Template Reference

Dune wrapper for SuiteSparse/CHOLMOD solver. More...

`#include <dune/istl/cholmod.hh>`

Inheritance diagram for Dune::Cholmod< Vector, Index >:

## Public Types

typedef Vector | domain_type
| Type of the domain of the operator to be inverted.
typedef Vector | range_type
| Type of the range of the operator to be inverted.
typedef Vector::field_type | field_type
| The field type of the operator.
typedef FieldTraits< field_type >::real_type | real_type
| The real type of the field type (is the same if using real numbers, but differs for std::complex).
typedef Simd::Scalar< real_type > | scalar_real_type
| scalar type underlying the field_type

## Public Member Functions

| Cholmod ()
| Default constructor.
| ~Cholmod ()
| Destructor.
| Cholmod (const Cholmod &)=delete
Cholmod & | operator= (const Cholmod &)=delete
void | apply (Vector &x, Vector &b, double reduction, InverseOperatorResult &res) override
| simple forward to apply(X&, Y&, InverseOperatorResult&)
void | apply (Vector &x, Vector &b, InverseOperatorResult &res) override
| solve the linear system Ax=b (possibly with respect to some ignore field)
template<class Matrix>
void | setMatrix (const Matrix &matrix)
| Set matrix without ignore nodes.
template<class Matrix, class Ignore>
void | setMatrix (const Matrix &matrix, const Ignore *ignore)
| Set matrix and ignore nodes.
SolverCategory::Category | category () const override
| Category of the solver (see SolverCategory::Category).
cholmod_common & | cholmodCommonObject ()
| return a reference to the CHOLMOD common object for advanced option settings
cholmod_factor & | cholmodFactor ()
| The CHOLMOD data structure that stores the factorization.
const cholmod_factor & | cholmodFactor () const
| The CHOLMOD data structure that stores the factorization.

## Protected Types

enum |

## Protected Member Functions

void | printHeader (std::ostream &s) const
| helper function for printing header of solver output
void | printOutput (std::ostream &s, const CountType &iter, const DataType &norm, const DataType &norm_old) const
| helper function for printing solver output
void | printOutput (std::ostream &s, const CountType &iter, const DataType &norm) const
| helper function for printing solver output

## Detailed Description

template<class Vector, class Index = int>
class Dune::Cholmod< Vector, Index >

Dune wrapper for SuiteSparse/CHOLMOD solver.

This class implements an InverseOperator between Vector types

Template Parameters

  Vector | Data type for solution and right-hand-side vectors
  Index | Type used by CHOLMOD for indices. Must be either 'int' or 'SuiteSparse_long' (which is usually long int).

## Member Typedef Documentation

## domain_type

typedef Vector Dune::InverseOperator< Vector, Vector >::domain_type

inherited

Type of the domain of the operator to be inverted.

## field_type

typedef Vector::field_type Dune::InverseOperator< Vector, Vector >::field_type

inherited

The field type of the operator.

## range_type

typedef Vector Dune::InverseOperator< Vector, Vector >::range_type

inherited

Type of the range of the operator to be inverted.

## real_type

typedef FieldTraits<field_type>::real_type Dune::InverseOperator< Vector, Vector >::real_type

inherited

The real type of the field type (is the same if using real numbers, but differs for std::complex).

## scalar_real_type

typedef Simd::Scalar<real_type> Dune::InverseOperator< Vector, Vector >::scalar_real_type

inherited

scalar type underlying the field_type

## Member Enumeration Documentation

## anonymous enum

anonymous enum

protected inherited

## Constructor & Destructor Documentation

## Cholmod() [1/2]

template<class Vector, class Index = int>

Dune::Cholmod< Vector, Index >::Cholmod | ( |  | ) |

inline

Default constructor.

Calls the the cholmod runtime, see CHOLMOD doc

## ~Cholmod()

template<class Vector, class Index = int>

Dune::Cholmod< Vector, Index >::~Cholmod | ( |  | ) |

inline

Destructor.

Free space and calls cholmod_finish, see CHOLMOD doc

## Cholmod() [2/2]

template<class Vector, class Index = int>

Dune::Cholmod< Vector, Index >::Cholmod | ( | const Cholmod< Vector, Index > & |  | ) |

delete

## Member Function Documentation

## apply() [1/2]

template<class Vector, class Index = int>

void Dune::Cholmod< Vector, Index >::apply | ( | Vector & | x,
|  | Vector & | b,
|  | double | reduction,
|  | InverseOperatorResult & | res )

inline override virtual

simple forward to apply(X&, Y&, InverseOperatorResult&)

Implements Dune::InverseOperator< Vector, Vector >.

## apply() [2/2]

template<class Vector, class Index = int>

void Dune::Cholmod< Vector, Index >::apply | ( | Vector & | x,
|  | Vector & | b,
|  | InverseOperatorResult & | res )

inline override virtual

solve the linear system Ax=b (possibly with respect to some ignore field)

The method assumes that setMatrix() was called before In the case of a given ignore field the corresponding entries of both in x and b will stay untouched in this method.

Implements Dune::InverseOperator< Vector, Vector >.

## category()

template<class Vector, class Index = int>

SolverCategory::Category Dune::Cholmod< Vector, Index >::category | ( |  | ) | const

inline override virtual

Category of the solver (see SolverCategory::Category).

Implements Dune::InverseOperator< Vector, Vector >.

## cholmodCommonObject()

template<class Vector, class Index = int>

cholmod_common & Dune::Cholmod< Vector, Index >::cholmodCommonObject | ( |  | ) |

inline

return a reference to the CHOLMOD common object for advanced option settings

The CHOLMOD common object stores all parameters and options for the solver to run and can be modified in several ways, see CHOLMOD Userguide for further information.

## cholmodFactor() [1/2]

template<class Vector, class Index = int>

cholmod_factor & Dune::Cholmod< Vector, Index >::cholmodFactor | ( |  | ) |

inline

The CHOLMOD data structure that stores the factorization.

Access to this is necessary for the more advanced features of CHOLMOD. You need to know what you are doing!

## cholmodFactor() [2/2]

template<class Vector, class Index = int>

const cholmod_factor & Dune::Cholmod< Vector, Index >::cholmodFactor | ( |  | ) | const

inline

The CHOLMOD data structure that stores the factorization.

Access to this is necessary for the more advanced features of CHOLMOD. You need to know what you are doing!

## operator=()

template<class Vector, class Index = int>

Cholmod & Dune::Cholmod< Vector, Index >::operator= | ( | const Cholmod< Vector, Index > & |  | ) |

delete

## printHeader()

void Dune::InverseOperator< Vector, Vector >::printHeader | ( | std::ostream & | s | ) | const

inline protected inherited

helper function for printing header of solver output

## printOutput() [1/2]

void Dune::InverseOperator< Vector, Vector >::printOutput | ( | std::ostream & | s,
|  | const CountType & | iter,
|  | const DataType & | norm ) const

inline protected inherited

helper function for printing solver output

## printOutput() [2/2]

void Dune::InverseOperator< Vector, Vector >::printOutput | ( | std::ostream & | s,
|  | const CountType & | iter,
|  | const DataType & | norm,
|  | const DataType & | norm_old ) const

inline protected inherited

helper function for printing solver output

## setMatrix() [1/2]

template<class Vector, class Index = int>
template<class Matrix>

void Dune::Cholmod< Vector, Index >::setMatrix | ( | const Matrix & | matrix | ) |

inline

Set matrix without ignore nodes.

This method forwards a nullptr to the setMatrix method with ignore nodes

## setMatrix() [2/2]

template<class Vector, class Index = int>
template<class Matrix, class Ignore>

void Dune::Cholmod< Vector, Index >::setMatrix | ( | const Matrix & | matrix,
|  | const Ignore * | ignore )

inline

Set matrix and ignore nodes.

The input matrix is copied to CHOLMOD compatible form. It is possible to ignore some degrees of freedom, provided an ignore field is given with same block structure like the BlockVector template of the class.

The ignore field causes the method to ignore both rows and cols of the matrix and therefore operates only on the reduced quadratic matrix. In case of, e.g., Dirichlet values the user has to take care of proper adjusting of the rhs before calling apply().

Decomposing the matrix at the end takes a lot of time

Parameters

  [in] | matrix | Matrix to be decomposed. In BCRS compatible form
  [in] | ignore | Pointer to a compatible BitVector

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

- cholmod.hh