Loading...
Searching...
No Matches
Fast (sequential) Algebraic Multigrid
Iterative Solvers Template Library (ISTL) » Iterative Solvers » Preconditioners

An Algebraic Multigrid based on Agglomeration that saves memory bandwidth. More...

Collaboration diagram for Fast (sequential) Algebraic Multigrid:

## Classes

class | Dune::Amg::FastAMG< M, X, PI, A >
| A fast (sequential) algebraic multigrid based on agglomeration that saves memory bandwidth. More...

## Typedefs

typedef M | Dune::Amg::FastAMG< M, X, PI, A >::Operator
| The matrix operator type.
typedef PI | Dune::Amg::FastAMG< M, X, PI, A >::ParallelInformation
| The type of the parallel information. Either OwnerOverlapCommunication or another type describing the parallel data distribution and providing communication methods.
typedef MatrixHierarchy< M, ParallelInformation, A > | Dune::Amg::FastAMG< M, X, PI, A >::OperatorHierarchy
| The operator hierarchy type.
typedef OperatorHierarchy::ParallelInformationHierarchy | Dune::Amg::FastAMG< M, X, PI, A >::ParallelInformationHierarchy
| The parallal data distribution hierarchy type.
typedef X | Dune::Amg::FastAMG< M, X, PI, A >::Domain
| The domain type.
typedef X | Dune::Amg::FastAMG< M, X, PI, A >::Range
| The range type.
typedef InverseOperator< X, X > | Dune::Amg::FastAMG< M, X, PI, A >::CoarseSolver
| the type of the coarse solver.

## Functions

| Dune::Amg::FastAMG< M, X, PI, A >::FastAMG (OperatorHierarchy &matrices, CoarseSolver &coarseSolver, const Parameters &parms, bool symmetric=true)
| Construct a new amg with a specific coarse solver.
template<class C>
| Dune::Amg::FastAMG< M, X, PI, A >::FastAMG (std::shared_ptr< const Operator > fineOperator, const C &criterion, const Parameters &parms=Parameters(), bool symmetric=true, const ParallelInformation &pinfo=ParallelInformation())
| Construct an AMG with an inexact coarse solver based on the smoother.
template<class C>
| Dune::Amg::FastAMG< M, X, PI, A >::FastAMG (const Operator &fineOperator, const C &criterion, const Parameters &parms=Parameters(), bool symmetric=true, const ParallelInformation &pinfo=ParallelInformation())
| Construct an AMG with an inexact coarse solver based on the smoother.
| Dune::Amg::FastAMG< M, X, PI, A >::FastAMG (const FastAMG &amg)
| Copy constructor.
void | Dune::Amg::FastAMG< M, X, PI, A >::pre (Domain &x, Range &b)
| Prepare the preconditioner.
void | Dune::Amg::FastAMG< M, X, PI, A >::apply (Domain &v, const Range &d)
| Apply one step of the preconditioner to the system A(v)=d.
virtual SolverCategory::Category | Dune::Amg::FastAMG< M, X, PI, A >::category () const
| Category of the preconditioner (see SolverCategory::Category).
void | Dune::Amg::FastAMG< M, X, PI, A >::post (Domain &x)
| Clean up.
template<class A1>
void | Dune::Amg::FastAMG< M, X, PI, A >::getCoarsestAggregateNumbers (std::vector< std::size_t, A1 > &cont)
| Get the aggregate number of each unknown on the coarsest level.
std::size_t | Dune::Amg::FastAMG< M, X, PI, A >::levels ()
std::size_t | Dune::Amg::FastAMG< M, X, PI, A >::maxlevels ()
void | Dune::Amg::FastAMG< M, X, PI, A >::recalculateHierarchy ()
| Recalculate the matrix hierarchy.
bool | Dune::Amg::FastAMG< M, X, PI, A >::usesDirectCoarseLevelSolver () const
| Check whether the coarse solver used is a direct solver.

## Variables

OperatorHierarchy::ParallelMatrixHierarchy::ConstIterator | Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::matrix
| The iterator over the matrices.
ParallelInformationHierarchy::Iterator | Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::pinfo
| The iterator over the parallel information.
OperatorHierarchy::RedistributeInfoList::const_iterator | Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::redist
| The iterator over the redistribution information.
OperatorHierarchy::AggregatesMapList::const_iterator | Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::aggregates
| The iterator over the aggregates maps.
Hierarchy< Domain, A >::Iterator | Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::lhs
| The iterator over the left hand side.
Hierarchy< Domain, A >::Iterator | Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::residual
| The iterator over the residuals.
Hierarchy< Range, A >::Iterator | Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::rhs
| The iterator over the right hand sided.
std::size_t | Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::level
| The level index.

## Detailed Description

An Algebraic Multigrid based on Agglomeration that saves memory bandwidth.

## Typedef Documentation

## CoarseSolver

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

typedef InverseOperator<X,X> Dune::Amg::FastAMG< M, X, PI, A >::CoarseSolver

the type of the coarse solver.

## Domain

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

typedef X Dune::Amg::FastAMG< M, X, PI, A >::Domain

The domain type.

## Operator

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

typedef M Dune::Amg::FastAMG< M, X, PI, A >::Operator

The matrix operator type.

## OperatorHierarchy

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

typedef MatrixHierarchy<M, ParallelInformation, A> Dune::Amg::FastAMG< M, X, PI, A >::OperatorHierarchy

The operator hierarchy type.

## ParallelInformation

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

typedef PI Dune::Amg::FastAMG< M, X, PI, A >::ParallelInformation

The type of the parallel information. Either OwnerOverlapCommunication or another type describing the parallel data distribution and providing communication methods.

## ParallelInformationHierarchy

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

typedef OperatorHierarchy::ParallelInformationHierarchy Dune::Amg::FastAMG< M, X, PI, A >::ParallelInformationHierarchy

The parallal data distribution hierarchy type.

## Range

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

typedef X Dune::Amg::FastAMG< M, X, PI, A >::Range

The range type.

## Function Documentation

## apply()

template<class M, class X, class PI, class A>

void Dune::Amg::FastAMG< M, X, PI, A >::apply | ( | Domain & | v,
|  | const Range & | d )

virtual

Apply one step of the preconditioner to the system A(v)=d.

On entry v=0 and d=b-A(x) (although this might not be computed in that way. On exit v contains the update, i.e one step computes where is the approximate inverse of the operator characterizing the preconditioner.

Parameters

  [out] | v | The update to be computed
  | d | The current defect.

Implements Dune::Preconditioner< X, X >.

## category()

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

virtual SolverCategory::Category Dune::Amg::FastAMG< M, X, PI, A >::category | ( |  | ) | const

inline virtual

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

Implements Dune::Preconditioner< X, X >.

## FastAMG() [1/4]

template<class M, class X, class PI, class A>

Dune::Amg::FastAMG< M, X, PI, A >::FastAMG | ( | const FastAMG< M, X, PI, A > & | amg | ) |

Copy constructor.

## FastAMG() [2/4]

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>
template<class C>

Dune::Amg::FastAMG< M, X, PI, A >::FastAMG | ( | const Operator & | fineOperator,
|  | const C & | criterion,
|  | const Parameters & | parms = Parameters(),
|  | bool | symmetric = true,
|  | const ParallelInformation & | pinfo = ParallelInformation() )

inline

Construct an AMG with an inexact coarse solver based on the smoother.

As coarse solver a preconditioned CG method with the smoother as preconditioner will be used. The matrix hierarchy is built automatically.

Parameters

  fineOperator | The operator on the fine level.
  criterion | The criterion describing the coarsening strategy. E. g. SymmetricCriterion or UnsymmetricCriterion, and providing the parameters.
  parms | The parameters for the AMG.

NOTE: This constructor uses the default constructed ParallelInformation.

## FastAMG() [3/4]

template<class M, class X, class PI, class A>

Dune::Amg::FastAMG< M, X, PI, A >::FastAMG | ( | OperatorHierarchy & | matrices,
|  | CoarseSolver & | coarseSolver,
|  | const Parameters & | parms,
|  | bool | symmetric = true )

Construct a new amg with a specific coarse solver.

Parameters

  matrices | The already set-up matrix hierarchy.
  coarseSolver | The set up solver to use on the coarse grid, must match the coarse matrix in the matrix hierarchy.
  parms | The parameters for the AMG.

## FastAMG() [4/4]

template<class M, class X, class PI, class A>
template<class C>

Dune::Amg::FastAMG< M, X, PI, A >::FastAMG | ( | std::shared_ptr< const Operator > | fineOperator,
|  | const C & | criterion,
|  | const Parameters & | parms = Parameters(),
|  | bool | symmetric = true,
|  | const ParallelInformation & | pinfo = ParallelInformation() )

Construct an AMG with an inexact coarse solver based on the smoother.

As coarse solver a preconditioned CG method with the smoother as preconditioner will be used. The matrix hierarchy is built automatically.

Parameters

  fineOperator | The operator on the fine level.
  criterion | The criterion describing the coarsening strategy. E. g. SymmetricCriterion or UnsymmetricCriterion, and providing the parameters.
  parms | The parameters for the AMG.
  pinfo | The information about the parallel distribution of the data.

## getCoarsestAggregateNumbers()

template<class M, class X, class PI, class A>
template<class A1>

void Dune::Amg::FastAMG< M, X, PI, A >::getCoarsestAggregateNumbers | ( | std::vector< std::size_t, A1 > & | cont | ) |

Get the aggregate number of each unknown on the coarsest level.

Parameters

  cont | The random access container to store the numbers in.

## levels()

template<class M, class X, class PI, class A>

std::size_t Dune::Amg::FastAMG< M, X, PI, A >::levels | ( |  | ) |

## maxlevels()

template<class M, class X, class PI, class A>

std::size_t Dune::Amg::FastAMG< M, X, PI, A >::maxlevels | ( |  | ) |

## post()

template<class M, class X, class PI, class A>

void Dune::Amg::FastAMG< M, X, PI, A >::post | ( | Domain & | x | ) |

virtual

Clean up.

This method is called after the last apply call for the linear system to be solved. Memory may be deallocated safely here. x is the solution of the linear equation.

Parameters

  x | The right hand side of the equation.

Implements Dune::Preconditioner< X, X >.

## pre()

template<class M, class X, class PI, class A>

void Dune::Amg::FastAMG< M, X, PI, A >::pre | ( | Domain & | x,
|  | Range & | b )

virtual

Prepare the preconditioner.

A solver solves a linear operator equation A(x)=b by applying one or several steps of the preconditioner. The method pre() is called before the first apply operation. b and x are right hand side and solution vector of the linear system respectively. It may. e.g., scale the system, allocate memory or compute a (I)LU decomposition. Note: The ILU decomposition could also be computed in the constructor or with a separate method of the derived method if several linear systems with the same matrix are to be solved.

Note
  if a preconditioner is copied (e.g. for a second thread) again the pre() method has to be called to ensure proper memory management.

X x(0.0);
Y b = ...; // rhs
Preconditioner<X,Y> prec(...);
prec.pre(x,b); // prepare the preconditioner
prec.apply(x,b); // can be called multiple times now...
prec.post(x); // cleanup internal state
Dune::Preconditioner
Base class for matrix free definition of preconditioners.
Definition preconditioner.hh:33

Parameters

  x | The left hand side of the equation.
  b | The right hand side of the equation.

Implements Dune::Preconditioner< X, X >.

## recalculateHierarchy()

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

void Dune::Amg::FastAMG< M, X, PI, A >::recalculateHierarchy | ( |  | ) |

inline

Recalculate the matrix hierarchy.

It is assumed that the coarsening for the changed fine level matrix would yield the same aggregates. In this case it suffices to recalculate all the Galerkin products for the matrices of the coarser levels.

## usesDirectCoarseLevelSolver()

template<class M, class X, class PI, class A>

bool Dune::Amg::FastAMG< M, X, PI, A >::usesDirectCoarseLevelSolver | ( |  | ) | const

Check whether the coarse solver used is a direct solver.

Returns
  True if the coarse level solver is a direct solver.

## Variable Documentation

## aggregates

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

OperatorHierarchy::AggregatesMapList::const_iterator Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::aggregates

The iterator over the aggregates maps.

## level

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

std::size_t Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::level

The level index.

## lhs

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

Hierarchy<Domain,A>::Iterator Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::lhs

The iterator over the left hand side.

## matrix

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

OperatorHierarchy::ParallelMatrixHierarchy::ConstIterator Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::matrix

The iterator over the matrices.

## pinfo

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

ParallelInformationHierarchy::Iterator Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::pinfo

The iterator over the parallel information.

## redist

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

OperatorHierarchy::RedistributeInfoList::const_iterator Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::redist

The iterator over the redistribution information.

## residual

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

Hierarchy<Domain,A>::Iterator Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::residual

The iterator over the residuals.

## rhs

template<class M, class X, class PI = SequentialInformation, class A = std::allocator<X>>

Hierarchy<Range,A>::Iterator Dune::Amg::FastAMG< M, X, PI, A >::LevelContext::rhs

The iterator over the right hand sided.