dune-istl  2.8.0
Classes | Public Types | Public Member Functions | List of all members
Dune::Amg::TwoLevelMethod< FO, CSP, S > Class Template Referenceabstract

#include <dune/istl/paamg/twolevelmethod.hh>

Inheritance diagram for Dune::Amg::TwoLevelMethod< FO, CSP, S >:
Inheritance graph

Public Types

typedef CSP CoarseLevelSolverPolicy
 The type of the policy for constructing the coarse level solver. More...
 
typedef CoarseLevelSolverPolicy::CoarseLevelSolver CoarseLevelSolver
 The type of the coarse level solver. More...
 
typedef FO FineOperatorType
 The linear operator of the finel level system. Has to be derived from AssembledLinearOperator. More...
 
typedef FineOperatorType::range_type FineRangeType
 The type of the range of the fine level operator. More...
 
typedef FineOperatorType::domain_type FineDomainType
 The type of the domain of the fine level operator. More...
 
typedef CSP::Operator CoarseOperatorType
 The linear operator of the finel level system. Has to be derived from AssembledLinearOperator. More...
 
typedef CoarseOperatorType::range_type CoarseRangeType
 The type of the range of the coarse level operator. More...
 
typedef CoarseOperatorType::domain_type CoarseDomainType
 The type of the domain of the coarse level operator. More...
 
typedef S SmootherType
 The type of the fine level smoother. More...
 
typedef FO::domain_type domain_type
 The domain type of the preconditioner. More...
 
typedef FO::range_type range_type
 The range type of the preconditioner. More...
 
typedef X::field_type field_type
 The field type of the preconditioner. More...
 

Public Member Functions

 TwoLevelMethod (const FineOperatorType &op, std::shared_ptr< SmootherType > smoother, const LevelTransferPolicy< FineOperatorType, CoarseOperatorType > &policy, CoarseLevelSolverPolicy &coarsePolicy, std::size_t preSteps=1, std::size_t postSteps=1)
 Constructs a two level method. More...
 
 TwoLevelMethod (const TwoLevelMethod &other)
 
 ~TwoLevelMethod ()
 
void pre (FineDomainType &x, FineRangeType &b)
 
void post ([[maybe_unused]] FineDomainType &x)
 
void apply (FineDomainType &v, const FineRangeType &d)
 
virtual SolverCategory::Category category () const
 Category of the preconditioner (see SolverCategory::Category) More...
 
virtual void pre (FO::domain_type &x, FO::range_type &b)=0
 Prepare the preconditioner. More...
 
virtual void apply (FO::domain_type &v, const FO::range_type &d)=0
 Apply one step of the preconditioner to the system A(v)=d. More...
 
virtual void post (FO::domain_type &x)=0
 Clean up. More...
 

Detailed Description

template<class FO, class CSP, class S>
class Dune::Amg::TwoLevelMethod< FO, CSP, S >

Template Parameters
FOThe type of the fine level linear operator.
CSPThe type of the coarse level solver policy.
SThe type of the fine level smoother used.

Member Typedef Documentation

◆ CoarseDomainType

template<class FO , class CSP , class S >
typedef CoarseOperatorType::domain_type Dune::Amg::TwoLevelMethod< FO, CSP, S >::CoarseDomainType

The type of the domain of the coarse level operator.

◆ CoarseLevelSolver

template<class FO , class CSP , class S >
typedef CoarseLevelSolverPolicy::CoarseLevelSolver Dune::Amg::TwoLevelMethod< FO, CSP, S >::CoarseLevelSolver

The type of the coarse level solver.

◆ CoarseLevelSolverPolicy

template<class FO , class CSP , class S >
typedef CSP Dune::Amg::TwoLevelMethod< FO, CSP, S >::CoarseLevelSolverPolicy

The type of the policy for constructing the coarse level solver.

◆ CoarseOperatorType

template<class FO , class CSP , class S >
typedef CSP::Operator Dune::Amg::TwoLevelMethod< FO, CSP, S >::CoarseOperatorType

The linear operator of the finel level system. Has to be derived from AssembledLinearOperator.

◆ CoarseRangeType

template<class FO , class CSP , class S >
typedef CoarseOperatorType::range_type Dune::Amg::TwoLevelMethod< FO, CSP, S >::CoarseRangeType

The type of the range of the coarse level operator.

◆ domain_type

typedef FO::domain_type Dune::Preconditioner< FO::domain_type , FO::range_type >::domain_type
inherited

The domain type of the preconditioner.

◆ field_type

typedef X::field_type Dune::Preconditioner< FO::domain_type , FO::range_type >::field_type
inherited

The field type of the preconditioner.

◆ FineDomainType

template<class FO , class CSP , class S >
typedef FineOperatorType::domain_type Dune::Amg::TwoLevelMethod< FO, CSP, S >::FineDomainType

The type of the domain of the fine level operator.

◆ FineOperatorType

template<class FO , class CSP , class S >
typedef FO Dune::Amg::TwoLevelMethod< FO, CSP, S >::FineOperatorType

The linear operator of the finel level system. Has to be derived from AssembledLinearOperator.

◆ FineRangeType

template<class FO , class CSP , class S >
typedef FineOperatorType::range_type Dune::Amg::TwoLevelMethod< FO, CSP, S >::FineRangeType

The type of the range of the fine level operator.

◆ range_type

typedef FO::range_type Dune::Preconditioner< FO::domain_type , FO::range_type >::range_type
inherited

The range type of the preconditioner.

◆ SmootherType

template<class FO , class CSP , class S >
typedef S Dune::Amg::TwoLevelMethod< FO, CSP, S >::SmootherType

The type of the fine level smoother.

Constructor & Destructor Documentation

◆ TwoLevelMethod() [1/2]

template<class FO , class CSP , class S >
Dune::Amg::TwoLevelMethod< FO, CSP, S >::TwoLevelMethod ( const FineOperatorType op,
std::shared_ptr< SmootherType smoother,
const LevelTransferPolicy< FineOperatorType, CoarseOperatorType > &  policy,
CoarseLevelSolverPolicy coarsePolicy,
std::size_t  preSteps = 1,
std::size_t  postSteps = 1 
)
inline

Constructs a two level method.

Template Parameters
CoarseSolverPolicyThe policy for constructing the coarse solver, e.g. OneStepAMGCoarseSolverPolicy
Parameters
opThe fine level operator.
smootherThe fine level smoother.
policyThe level transfer policy.
coarsePolicyThe policy for constructing the coarse level solver.
preStepsThe number of smoothing steps to apply before the coarse level correction.
preStepsThe number of smoothing steps to apply after the coarse level correction.

◆ TwoLevelMethod() [2/2]

template<class FO , class CSP , class S >
Dune::Amg::TwoLevelMethod< FO, CSP, S >::TwoLevelMethod ( const TwoLevelMethod< FO, CSP, S > &  other)
inline

◆ ~TwoLevelMethod()

template<class FO , class CSP , class S >
Dune::Amg::TwoLevelMethod< FO, CSP, S >::~TwoLevelMethod ( )
inline

Member Function Documentation

◆ apply() [1/2]

template<class FO , class CSP , class S >
void Dune::Amg::TwoLevelMethod< FO, CSP, S >::apply ( FineDomainType v,
const FineRangeType d 
)
inline

◆ apply() [2/2]

virtual void Dune::Preconditioner< FO::domain_type , FO::range_type >::apply ( FO::domain_type &  v,
const FO::range_type &  d 
)
pure virtualinherited

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 $ v = M^{-1} d $ where $ M $ is the approximate inverse of the operator $ A $ characterizing the preconditioner.

Parameters
[out]vThe update to be computed
dThe current defect.

◆ category()

template<class FO , class CSP , class S >
virtual SolverCategory::Category Dune::Amg::TwoLevelMethod< FO, CSP, S >::category ( ) const
inlinevirtual

◆ post() [1/2]

template<class FO , class CSP , class S >
void Dune::Amg::TwoLevelMethod< FO, CSP, S >::post ( [[maybe_unused] ] FineDomainType x)
inline

◆ post() [2/2]

virtual void Dune::Preconditioner< FO::domain_type , FO::range_type >::post ( FO::domain_type &  x)
pure virtualinherited

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
xThe right hand side of the equation.

◆ pre() [1/2]

template<class FO , class CSP , class S >
void Dune::Amg::TwoLevelMethod< FO, CSP, S >::pre ( FineDomainType x,
FineRangeType b 
)
inline

◆ pre() [2/2]

virtual void Dune::Preconditioner< FO::domain_type , FO::range_type >::pre ( FO::domain_type &  x,
FO::range_type &  b 
)
pure virtualinherited

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 mangement.
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
Parameters
xThe left hand side of the equation.
bThe right hand side of the equation.

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