KASKADE 7 development version
Public Types | Public Member Functions | List of all members
Kaskade::CGBase< X, Xstar, impl, TimerPolicy, Functor > Class Template Reference

regularized preconditioned conjugate gradient method More...

#include <cgImplementation.hh>

Detailed Description

template<class X, class Xstar, CGImplementationType impl = CGImplementationType::STANDARD, class TimerPolicy = DoNotMeasureTime, class Functor = DoNotAlwaysRegularize>
class Kaskade::CGBase< X, Xstar, impl, TimerPolicy, Functor >

regularized preconditioned conjugate gradient method

This implements a preconditioned IterateType::CG iteration for an operator \( A: X\to x^* \), preconditioned by a preconditioner \( B^{-1}: X^* \to X \). The termination is based on an estimate of the absolute energy error.

The implementation follows Deuflhard/Weiser, Section 5.3.3.

Definition at line 222 of file cgImplementation.hh.

Inheritance diagram for Kaskade::CGBase< X, Xstar, impl, TimerPolicy, Functor >:
Kaskade::DoNotMeasureTime

Public Types

typedef ScalarTraits< typenameGetScalar< X >::type >::Real Real
 the real field type corresponding to X::field_type or X::Scalar More...
 

Public Member Functions

 CGBase (Dune::LinearOperator< X, Xstar > &op_, Dune::Preconditioner< X, Xstar > &prec_, DualPairing< X, Xstar > const &dp_, PCGTerminationCriterion< Real > &terminate_, int verbose_=0, double eps_=1e-15)
 Set up conjugate gradient solver with termination criterion. More...
 
 CGBase (Dune::LinearOperator< X, Xstar > &op_, Dune::Preconditioner< X, Xstar > &prec_, DualPairing< X, Xstar > const &dp_, PCGTerminationCriterion< Real > &terminate_, Functor f_, int verbose_=0, double eps_=1e-15)
 
void apply (X &u, Xstar &b)
 
virtual void apply (X &u, Xstar &b, Real tolerance, Dune::InverseOperatorResult &res)
 
virtual void apply (X &u, Xstar &b, Dune::InverseOperatorResult &res)
 
int cgLoop (X &u, Xstar &b, Dune::InverseOperatorResult &res)
 
bool encounteredNonConvexity () const
 
double getSolutionEnergyNormEstimate ()
 
virtual Dune::SolverCategory::Category category () const override
 returns the category of the operator More...
 
void resumeMVTimer ()
 
void resumeDPTimer ()
 
void resumeAPTimer ()
 
void resumePRTimer ()
 
void stopMVTimer ()
 
void stopDPTimer ()
 
void stopAPTimer ()
 
void stopPRTimer ()
 
void printTimers ()
 

Member Typedef Documentation

◆ Real

template<class X , class Xstar , CGImplementationType impl = CGImplementationType::STANDARD, class TimerPolicy = DoNotMeasureTime, class Functor = DoNotAlwaysRegularize>
typedef ScalarTraits<typenameGetScalar<X>::type>::Real Kaskade::CGBase< X, Xstar, impl, TimerPolicy, Functor >::Real

the real field type corresponding to X::field_type or X::Scalar

Definition at line 233 of file cgImplementation.hh.

Constructor & Destructor Documentation

◆ CGBase() [1/2]

template<class X , class Xstar , CGImplementationType impl = CGImplementationType::STANDARD, class TimerPolicy = DoNotMeasureTime, class Functor = DoNotAlwaysRegularize>
Kaskade::CGBase< X, Xstar, impl, TimerPolicy, Functor >::CGBase ( Dune::LinearOperator< X, Xstar > &  op_,
Dune::Preconditioner< X, Xstar > &  prec_,
DualPairing< X, Xstar > const &  dp_,
PCGTerminationCriterion< Real > &  terminate_,
int  verbose_ = 0,
double  eps_ = 1e-15 
)
inline

Set up conjugate gradient solver with termination criterion.

Parameters
verbose

Definition at line 240 of file cgImplementation.hh.

◆ CGBase() [2/2]

template<class X , class Xstar , CGImplementationType impl = CGImplementationType::STANDARD, class TimerPolicy = DoNotMeasureTime, class Functor = DoNotAlwaysRegularize>
Kaskade::CGBase< X, Xstar, impl, TimerPolicy, Functor >::CGBase ( Dune::LinearOperator< X, Xstar > &  op_,
Dune::Preconditioner< X, Xstar > &  prec_,
DualPairing< X, Xstar > const &  dp_,
PCGTerminationCriterion< Real > &  terminate_,
Functor  f_,
int  verbose_ = 0,
double  eps_ = 1e-15 
)
inline

Definition at line 245 of file cgImplementation.hh.

Member Function Documentation

◆ apply() [1/3]

template<class X , class Xstar , CGImplementationType impl = CGImplementationType::STANDARD, class TimerPolicy = DoNotMeasureTime, class Functor = DoNotAlwaysRegularize>
void Kaskade::CGBase< X, Xstar, impl, TimerPolicy, Functor >::apply ( X &  u,
Xstar &  b 
)
inline

◆ apply() [2/3]

template<class X , class Xstar , CGImplementationType impl = CGImplementationType::STANDARD, class TimerPolicy = DoNotMeasureTime, class Functor = DoNotAlwaysRegularize>
virtual void Kaskade::CGBase< X, Xstar, impl, TimerPolicy, Functor >::apply ( X &  u,
Xstar &  b,
Dune::InverseOperatorResult &  res 
)
inlinevirtual

Definition at line 269 of file cgImplementation.hh.

◆ apply() [3/3]

template<class X , class Xstar , CGImplementationType impl = CGImplementationType::STANDARD, class TimerPolicy = DoNotMeasureTime, class Functor = DoNotAlwaysRegularize>
virtual void Kaskade::CGBase< X, Xstar, impl, TimerPolicy, Functor >::apply ( X &  u,
Xstar &  b,
Real  tolerance,
Dune::InverseOperatorResult &  res 
)
inlinevirtual
Parameters
uinitial guess
bright hand side
tolerancetolerance of the termination criterion
rescontains, number of iterations, residual reduction, ...

Definition at line 263 of file cgImplementation.hh.

◆ category()

template<class X , class Xstar , CGImplementationType impl = CGImplementationType::STANDARD, class TimerPolicy = DoNotMeasureTime, class Functor = DoNotAlwaysRegularize>
virtual Dune::SolverCategory::Category Kaskade::CGBase< X, Xstar, impl, TimerPolicy, Functor >::category ( ) const
inlineoverridevirtual

returns the category of the operator

From the Dune doxygen documentation it is unclear what this is supposed to mean. We return a dummy here.

Definition at line 463 of file cgImplementation.hh.

◆ cgLoop()

template<class X , class Xstar , CGImplementationType impl = CGImplementationType::STANDARD, class TimerPolicy = DoNotMeasureTime, class Functor = DoNotAlwaysRegularize>
int Kaskade::CGBase< X, Xstar, impl, TimerPolicy, Functor >::cgLoop ( X &  u,
Xstar &  b,
Dune::InverseOperatorResult &  res 
)
inline

◆ encounteredNonConvexity()

template<class X , class Xstar , CGImplementationType impl = CGImplementationType::STANDARD, class TimerPolicy = DoNotMeasureTime, class Functor = DoNotAlwaysRegularize>
bool Kaskade::CGBase< X, Xstar, impl, TimerPolicy, Functor >::encounteredNonConvexity ( ) const
inline

Definition at line 454 of file cgImplementation.hh.

◆ getSolutionEnergyNormEstimate()

template<class X , class Xstar , CGImplementationType impl = CGImplementationType::STANDARD, class TimerPolicy = DoNotMeasureTime, class Functor = DoNotAlwaysRegularize>
double Kaskade::CGBase< X, Xstar, impl, TimerPolicy, Functor >::getSolutionEnergyNormEstimate ( )
inline

Definition at line 456 of file cgImplementation.hh.

◆ printTimers()

void Kaskade::DoNotMeasureTime::printTimers ( )
inlineinherited

◆ resumeAPTimer()

void Kaskade::DoNotMeasureTime::resumeAPTimer ( )
inlineinherited

Definition at line 94 of file cgImplementation.hh.

◆ resumeDPTimer()

void Kaskade::DoNotMeasureTime::resumeDPTimer ( )
inlineinherited

Definition at line 93 of file cgImplementation.hh.

◆ resumeMVTimer()

void Kaskade::DoNotMeasureTime::resumeMVTimer ( )
inlineinherited

Definition at line 92 of file cgImplementation.hh.

◆ resumePRTimer()

void Kaskade::DoNotMeasureTime::resumePRTimer ( )
inlineinherited

◆ stopAPTimer()

void Kaskade::DoNotMeasureTime::stopAPTimer ( )
inlineinherited

Definition at line 99 of file cgImplementation.hh.

◆ stopDPTimer()

void Kaskade::DoNotMeasureTime::stopDPTimer ( )
inlineinherited

Definition at line 98 of file cgImplementation.hh.

◆ stopMVTimer()

void Kaskade::DoNotMeasureTime::stopMVTimer ( )
inlineinherited

Definition at line 97 of file cgImplementation.hh.

◆ stopPRTimer()

void Kaskade::DoNotMeasureTime::stopPRTimer ( )
inlineinherited

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