KASKADE 7 development version
Classes | Public Types | Public Member Functions | List of all members
Kaskade::Gbit< LinearSpace > Class Template Reference

Iterative solution of a large linear system using an error based termination-criterium. Includes some special termination-criterium options which are used by the giantGbit code. More...

#include <gbit.hh>

Detailed Description

template<class LinearSpace>
class Kaskade::Gbit< LinearSpace >

Iterative solution of a large linear system using an error based termination-criterium. Includes some special termination-criterium options which are used by the giantGbit code.

Template Parameters
LinearSpaceThe underlying linear space of the unknown vector and right-hand-side.

Definition at line 230 of file gbit.hh.

Classes

struct  GbitInfo
 

Public Types

enum  PrintLevel { none =0 , minimum =1 , verbose =2 , debug =3 }
 
typedef Dune::LinearOperator< LinearSpace, LinearSpace > AssembledGalerkinOperator
 
typedef Dune::Preconditioner< LinearSpace, LinearSpace > Precond
 

Public Member Functions

 Gbit (AssembledGalerkinOperator &a_, Precond &precon_, double iteEps_=1.0e-10, int iteSteps_=MAXITER_DEFAULT, int verbosity_=0, int maxRestart_=9)
 The Gbit constructor routine. More...
 
 ~Gbit ()
 
void setTolerance (double tol_)
 Sets the error tolerance which the final approximate solution \(x_k\) must fit. The default value is 1.0e-10. More...
 
void setMaximumNoIterations (int maximumIter_)
 Sets the maximum allowed number of Newton-iterations. The default value is the value of the constructor argument iteSteps_, e.g. MAXITER_DEFAULT, if the iteSteps_ argument is not set. More...
 
void setSafetyFactor (double safetyFactor_)
 Sets the safety factor for the precision control. Must be a positive number <= 1.0 by which the tolerance will be multiplied. The default value is 0.25. More...
 
void setRescaleMode (bool rescale_)
 Sets the rescaling mode. The default value is true. More...
 
void setGiantSimpleTermination (bool giantSimple_)
 Sets the termination-criterium mode. The default value is false. More...
 
void setErrorStream (std::ostream &errorStream_)
 Sets the error-output stream. The default error-output stream is std::cerr. More...
 
void setMonitorStream (std::ostream &monitorStream_)
 Sets the monitor-output stream. The default monitor-output stream is std::cout. More...
 
void setErrorLevel (PrintLevel errorLevel_)
 Sets the error-output level. The default error-output level is verbose. More...
 
void setMonitorLevel (PrintLevel monitorLevel_)
 Sets the monitor-output level. The default monitor-output level is the value of the constructur argument verbosity_ (casted to the corresponding PrintLevel value), e.g. 0, if the verbosity_ argument is not set. More...
 
void setStatistics (bool statistics_)
 Sets the Timings statistics flag. The default Timings statistics flag level is off. More...
 
void setScalingVector (std::vector< double > *scale_)
 Sets a user-defined scaling-threshold vector. More...
 
void apply (LinearSpace &y, LinearSpace const &b, struct GbitInfo &res, Timings &timer=Timings::instance())
 Calls the giantGbit inexact damped Newton-iteration solver. More...
 

Member Typedef Documentation

◆ AssembledGalerkinOperator

template<class LinearSpace >
typedef Dune::LinearOperator<LinearSpace,LinearSpace> Kaskade::Gbit< LinearSpace >::AssembledGalerkinOperator

Definition at line 276 of file gbit.hh.

◆ Precond

template<class LinearSpace >
typedef Dune::Preconditioner<LinearSpace,LinearSpace> Kaskade::Gbit< LinearSpace >::Precond

Definition at line 277 of file gbit.hh.

Member Enumeration Documentation

◆ PrintLevel

template<class LinearSpace >
enum Kaskade::Gbit::PrintLevel
Enumerator
none 

no output

minimum 

summary output

verbose 

detailed output - info about each iterate

debug 

additional debug output - reserved for future use

Definition at line 239 of file gbit.hh.

Constructor & Destructor Documentation

◆ Gbit()

template<class LinearSpace >
Kaskade::Gbit< LinearSpace >::Gbit ( AssembledGalerkinOperator a_,
Precond precon_,
double  iteEps_ = 1.0e-10,
int  iteSteps_ = MAXITER_DEFAULT,
int  verbosity_ = 0,
int  maxRestart_ = 9 
)
inline

The Gbit constructor routine.

Parameters
a_The Dune-istl compatible linear operator A of the linear system \( A \dot x = b \).
precon_The Dune-istl compatible preconditioner.
iteEps_The prescribed precision for the solution. This is an optional argument for Dune-istl compatibility.
iteSteps_The maximum number of allowed iteration-steps. This is an optional argument for Dune-istl compatibility.
verbosity_The int equivalent of the monitor-output level. This is an optional argument for Dune-istl compatibility.
maxRestart_The maximum number of iteration-steps before a restart occurs. Since this parameter mainly determines the amount of storage used by Gbit, there is no alternative set-method for this parameter available.

Definition at line 294 of file gbit.hh.

◆ ~Gbit()

template<class LinearSpace >
Kaskade::Gbit< LinearSpace >::~Gbit ( )
inline

Definition at line 312 of file gbit.hh.

Member Function Documentation

◆ apply()

template<class LinearSpace >
void Kaskade::Gbit< LinearSpace >::apply ( LinearSpace &  y,
LinearSpace const &  b,
struct GbitInfo res,
Timings timer = Timings::instance() 
)
inline

Calls the giantGbit inexact damped Newton-iteration solver.

Parameters
yOn input, the start-vector for the iteration.
On output, the approximate solution vector \( x_k \), which fits the error condition \( \parallel x_k - x\star \parallel <= tol \) , where \( x\star \) denotes the exact solution, and \( \parallel \ldots \parallel \) is a scaled Euclidian norm.
bThe right hand side vector of the linear system to be solved.
resAn instance of type GbitInfo to hold the iteration info on termination of the apply routine.

Definition at line 418 of file gbit.hh.

◆ setErrorLevel()

template<class LinearSpace >
void Kaskade::Gbit< LinearSpace >::setErrorLevel ( PrintLevel  errorLevel_)
inline

Sets the error-output level. The default error-output level is verbose.

Parameters
errorLevel_The desired error-output level.

Definition at line 380 of file gbit.hh.

◆ setErrorStream()

template<class LinearSpace >
void Kaskade::Gbit< LinearSpace >::setErrorStream ( std::ostream &  errorStream_)
inline

Sets the error-output stream. The default error-output stream is std::cerr.

Parameters
errorStream_The desired error-output stream.

Definition at line 366 of file gbit.hh.

◆ setGiantSimpleTermination()

template<class LinearSpace >
void Kaskade::Gbit< LinearSpace >::setGiantSimpleTermination ( bool  giantSimple_)
inline

Sets the termination-criterium mode. The default value is false.

Parameters
giantSimple_The desired termination-criterium mode. If it is set to true, a special termination criterium for computing the simplified Newton correction by giantGbit will be applied.
If set to false, the standard termination-criterium will be applied.

Definition at line 359 of file gbit.hh.

◆ setMaximumNoIterations()

template<class LinearSpace >
void Kaskade::Gbit< LinearSpace >::setMaximumNoIterations ( int  maximumIter_)
inline

Sets the maximum allowed number of Newton-iterations. The default value is the value of the constructor argument iteSteps_, e.g. MAXITER_DEFAULT, if the iteSteps_ argument is not set.

Parameters
maximumIter_The desired maximum number of iterations.

Definition at line 330 of file gbit.hh.

◆ setMonitorLevel()

template<class LinearSpace >
void Kaskade::Gbit< LinearSpace >::setMonitorLevel ( PrintLevel  monitorLevel_)
inline

Sets the monitor-output level. The default monitor-output level is the value of the constructur argument verbosity_ (casted to the corresponding PrintLevel value), e.g. 0, if the verbosity_ argument is not set.

Parameters
monitorLevel_The desired monitor-output level.

Definition at line 389 of file gbit.hh.

◆ setMonitorStream()

template<class LinearSpace >
void Kaskade::Gbit< LinearSpace >::setMonitorStream ( std::ostream &  monitorStream_)
inline

Sets the monitor-output stream. The default monitor-output stream is std::cout.

Parameters
monitorStream_The desired monitor-output stream.

Definition at line 373 of file gbit.hh.

◆ setRescaleMode()

template<class LinearSpace >
void Kaskade::Gbit< LinearSpace >::setRescaleMode ( bool  rescale_)
inline

Sets the rescaling mode. The default value is true.

Parameters
rescale_The desired rescaling mode. If set to true, the scaling values, which are used in the norm computation, will be adjusted at the start and at each restart to the current iterate.
If set to false, the initial scaling values are used unmodified throughout the whole iteration.

Definition at line 350 of file gbit.hh.

◆ setSafetyFactor()

template<class LinearSpace >
void Kaskade::Gbit< LinearSpace >::setSafetyFactor ( double  safetyFactor_)
inline

Sets the safety factor for the precision control. Must be a positive number <= 1.0 by which the tolerance will be multiplied. The default value is 0.25.

Parameters
safetyFactor_The desired safety factor.

Definition at line 338 of file gbit.hh.

◆ setScalingVector()

template<class LinearSpace >
void Kaskade::Gbit< LinearSpace >::setScalingVector ( std::vector< double > *  scale_)
inline

Sets a user-defined scaling-threshold vector.

Parameters
*scale_A pointer to the selected scaling-threshold vector.

Definition at line 401 of file gbit.hh.

◆ setStatistics()

template<class LinearSpace >
void Kaskade::Gbit< LinearSpace >::setStatistics ( bool  statistics_)
inline

Sets the Timings statistics flag. The default Timings statistics flag level is off.

Parameters
statistics_false=off, true=on.

Definition at line 396 of file gbit.hh.

◆ setTolerance()

template<class LinearSpace >
void Kaskade::Gbit< LinearSpace >::setTolerance ( double  tol_)
inline

Sets the error tolerance which the final approximate solution \(x_k\) must fit. The default value is 1.0e-10.

Parameters
tol_The desired error for the solution.

Definition at line 322 of file gbit.hh.


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