ug4
ug::AlgebraicConvCheck< TVector > Class Template Reference

#include <algebra_conv_check.h>

+ Inheritance diagram for ug::AlgebraicConvCheck< TVector >:

Classes

struct  CmpInfo
 

Public Member Functions

number avg_rate () const
 
virtual SmartPtr< IConvergenceCheck< TVector > > clone ()
 clones this instance More...
 
virtual std::string config_string () const
 returns information about configuration parameters More...
 
number defect () const
 returns the current defect More...
 
int get_offset () const
 output More...
 
void get_statistics (double *first, double *last, int &niter) const
 statistics More...
 
bool iteration_ended ()
 
bool post ()
 
void print_line (std::string line)
 prints a line using prefixes More...
 
number rate () const
 
number reduction () const
 
void set_component_check (const size_t cmp, const number abs, const number red)
 sets check for single component More...
 
void set_component_checks (const number abs, const number red)
 sets check for all components More...
 
void set_info (std::string info)
 sets info string More...
 
void set_maximum_steps (int maxSteps)
 sets maximum number of iteration steps More...
 
void set_name (std::string name)
 sets the name of the iteration More...
 
void set_offset (int offset)
 sets the number of spaces printed before output information More...
 
void set_symbol (char symbol)
 sets the symbol used for output More...
 
void set_time_measurement (bool yesOrNo)
 enables time measurement More...
 
void set_verbose (bool level)
 sets if verbose More...
 
void start (const TVector &d)
 computes the start defect and set it More...
 
void start_defect (number initialDefect)
 defect control More...
 
int step () const
 information about current status More...
 
void update (const TVector &d)
 computes the defect and sets it a the next defect value More...
 
void update_defect (number newDefect)
 sets the update for the current defect More...
 
 AlgebraicConvCheck (size_t ncmp)
 
 AlgebraicConvCheck (size_t ncmp, int maxSteps, number minDefect, number relReduction)
 
 AlgebraicConvCheck (size_t ncmp, int maxSteps, number minDefect, number relReduction, bool verbose)
 
- Public Member Functions inherited from ug::IConvergenceCheck< TVector >
virtual ~IConvergenceCheck ()
 virtual destructor More...
 

Protected Member Functions

number defect_all () const
 returns defect for all components More...
 
const std::string & fctName (size_t i)
 
number initial_defect_all () const
 returns initial defect for all components More...
 
bool is_valid_number (number value)
 
number last_defect_all () const
 returns last defect for all components More...
 
number norm (const TVector &vec, size_t cmp)
 calculates the 2-norm of the entries of the vector vec specified by index More...
 
void print_offset ()
 

Protected Attributes

bool m_bTimeMeas
 enables time measurement More...
 
int m_currentStep
 current step More...
 
std::string m_info
 info for iteration (e.g. preconditioner type) More...
 
int m_maxSteps
 maximum number of steps to be performed More...
 
number m_minDefect
 Minimal required Defect of component. More...
 
std::string m_name
 name of iteration More...
 
int m_offset
 number of spaces inserted before output More...
 
number m_relReduction
 Relative reduction required for component. More...
 
Stopwatch m_stopwatch
 a stopwatch More...
 
char m_symbol
 symbol for output appearance More...
 
std::vector< CmpInfom_vCmpInfo
 info on components More...
 
bool m_verbose
 verbose level More...
 

Detailed Description

template<class TVector>
class ug::AlgebraicConvCheck< TVector >

AlgebraicConvCheck

This is an implementation of the convergence check interface, that makes it possible to define required defect reductions on the individual functions constituting the overall solution.

Constructor & Destructor Documentation

◆ AlgebraicConvCheck() [1/3]

template<class TVector >
ug::AlgebraicConvCheck< TVector >::AlgebraicConvCheck ( size_t  ncmp)

constructors

◆ AlgebraicConvCheck() [2/3]

template<class TVector >
ug::AlgebraicConvCheck< TVector >::AlgebraicConvCheck ( size_t  ncmp,
int  maxSteps,
number  minDefect,
number  relReduction 
)

constructors

◆ AlgebraicConvCheck() [3/3]

template<class TVector >
ug::AlgebraicConvCheck< TVector >::AlgebraicConvCheck ( size_t  ncmp,
int  maxSteps,
number  minDefect,
number  relReduction,
bool  verbose 
)

constructors

Member Function Documentation

◆ avg_rate()

◆ clone()

template<class TVector >
SmartPtr< IConvergenceCheck< TVector > > ug::AlgebraicConvCheck< TVector >::clone
virtual

clones this instance

Implements ug::IConvergenceCheck< TVector >.

◆ config_string()

template<class TVector >
virtual std::string ug::AlgebraicConvCheck< TVector >::config_string ( ) const
inlinevirtual

returns information about configuration parameters

this should return necessary information about parameters and possibly calling config_string of subcomponents.

Returns
std::string necessary information about configuration parameters

Implements ug::IConvergenceCheck< TVector >.

◆ defect()

◆ defect_all()

◆ fctName()

template<class TVector >
const std::string& ug::AlgebraicConvCheck< TVector >::fctName ( size_t  i)
inlineprotected

◆ get_offset()

template<class TVector >
int ug::AlgebraicConvCheck< TVector >::get_offset ( ) const
inlinevirtual

◆ get_statistics()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::get_statistics ( double *  first,
double *  last,
int &  niter 
) const
inline

◆ initial_defect_all()

template<class TVector >
number ug::AlgebraicConvCheck< TVector >::initial_defect_all ( ) const
inlineprotected

◆ is_valid_number()

template<class TVector >
bool ug::AlgebraicConvCheck< TVector >::is_valid_number ( number  value)
protected

◆ iteration_ended()

template<class TVector >
bool ug::AlgebraicConvCheck< TVector >::iteration_ended ( )
virtual

iteration_ended

Checks if the iteration must be ended. This can be due to convergence or divergence.

Returns
true if iteration ended false if iteration can and must be continued until convergence

Implements ug::IConvergenceCheck< TVector >.

References ug::AlgebraicConvCheck< TVector >::CmpInfo::currDefect, ug::AlgebraicConvCheck< TVector >::CmpInfo::initDefect, ug::AlgebraicConvCheck< TVector >::CmpInfo::minDefect, and ug::AlgebraicConvCheck< TVector >::CmpInfo::relReduction.

◆ last_defect_all()

template<class TVector >
number ug::AlgebraicConvCheck< TVector >::last_defect_all ( ) const
inlineprotected

◆ norm()

template<class TVector >
number ug::AlgebraicConvCheck< TVector >::norm ( const TVector &  vec,
size_t  cmp 
)
protected

calculates the 2-norm of the entries of the vector vec specified by index

References PCL_RO_SUM, ug::PST_UNIQUE, UG_THROW, and ug::VecNormSquared().

◆ post()

template<class TVector >
bool ug::AlgebraicConvCheck< TVector >::post ( )
virtual

post

post-processes the iteration. Some informative outputs of the status of the iteration after finishing the iteration can be placed here

Returns
true if iteration was successful false if iteration did not lead to a satisfying result

Implements ug::IConvergenceCheck< TVector >.

References ug::AlgebraicConvCheck< TVector >::CmpInfo::currDefect, ug::AlgebraicConvCheck< TVector >::CmpInfo::initDefect, ug::AlgebraicConvCheck< TVector >::CmpInfo::minDefect, ug::AlgebraicConvCheck< TVector >::CmpInfo::name, ug::AlgebraicConvCheck< TVector >::CmpInfo::relReduction, ug::repeat(), and UG_LOG.

◆ print_line()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::print_line ( std::string  line)
virtual

prints a line using prefixes

Implements ug::IConvergenceCheck< TVector >.

References UG_LOG.

◆ print_offset()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::print_offset
protected

References ug::repeat(), and UG_LOG.

◆ rate()

◆ reduction()

◆ set_component_check()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::set_component_check ( const size_t  cmp,
const number  abs,
const number  red 
)
inline

◆ set_component_checks()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::set_component_checks ( const number  abs,
const number  red 
)
inline

◆ set_info()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::set_info ( std::string  name)
inlinevirtual

◆ set_maximum_steps()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::set_maximum_steps ( int  maxSteps)
inline

sets maximum number of iteration steps

References ug::AlgebraicConvCheck< TVector >::m_maxSteps.

◆ set_name()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::set_name ( std::string  name)
inlinevirtual

sets the name of the iteration

Implements ug::IConvergenceCheck< TVector >.

References ug::AlgebraicConvCheck< TVector >::m_name, and name.

◆ set_offset()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::set_offset ( int  offset)
inlinevirtual

sets the number of spaces printed before output information

Implements ug::IConvergenceCheck< TVector >.

References ug::AlgebraicConvCheck< TVector >::m_offset.

◆ set_symbol()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::set_symbol ( char  symbol)
inlinevirtual

sets the symbol used for output

Implements ug::IConvergenceCheck< TVector >.

References ug::AlgebraicConvCheck< TVector >::m_symbol.

◆ set_time_measurement()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::set_time_measurement ( bool  yesOrNo)
inline

enables time measurement

References ug::AlgebraicConvCheck< TVector >::m_bTimeMeas.

◆ set_verbose()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::set_verbose ( bool  level)
inline

sets if verbose

References ug::AlgebraicConvCheck< TVector >::m_verbose.

◆ start()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::start ( const TVector &  d)
virtual

computes the start defect and set it

Implements ug::IConvergenceCheck< TVector >.

References ug::AlgebraicConvCheck< TVector >::CmpInfo::currDefect, ug::repeat(), and UG_LOG.

◆ start_defect()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::start_defect ( number  initialDefect)
virtual

defect control

Implements ug::IConvergenceCheck< TVector >.

References UG_THROW.

◆ step()

template<class TVector >
int ug::AlgebraicConvCheck< TVector >::step ( ) const
inlinevirtual

◆ update()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::update ( const TVector &  d)
virtual

◆ update_defect()

template<class TVector >
void ug::AlgebraicConvCheck< TVector >::update_defect ( number  defect)
virtual

sets the update for the current defect

Implements ug::IConvergenceCheck< TVector >.

References UG_THROW.

Member Data Documentation

◆ m_bTimeMeas

template<class TVector >
bool ug::AlgebraicConvCheck< TVector >::m_bTimeMeas
protected

enables time measurement

Referenced by ug::AlgebraicConvCheck< TVector >::set_time_measurement().

◆ m_currentStep

template<class TVector >
int ug::AlgebraicConvCheck< TVector >::m_currentStep
protected

◆ m_info

template<class TVector >
std::string ug::AlgebraicConvCheck< TVector >::m_info
protected

info for iteration (e.g. preconditioner type)

Referenced by ug::AlgebraicConvCheck< TVector >::set_info().

◆ m_maxSteps

template<class TVector >
int ug::AlgebraicConvCheck< TVector >::m_maxSteps
protected

maximum number of steps to be performed

Referenced by ug::AlgebraicConvCheck< TVector >::set_maximum_steps().

◆ m_minDefect

template<class TVector >
number ug::AlgebraicConvCheck< TVector >::m_minDefect
protected

Minimal required Defect of component.

◆ m_name

template<class TVector >
std::string ug::AlgebraicConvCheck< TVector >::m_name
protected

name of iteration

Referenced by ug::AlgebraicConvCheck< TVector >::set_name().

◆ m_offset

template<class TVector >
int ug::AlgebraicConvCheck< TVector >::m_offset
protected

number of spaces inserted before output

Referenced by ug::AlgebraicConvCheck< TVector >::get_offset(), and ug::AlgebraicConvCheck< TVector >::set_offset().

◆ m_relReduction

template<class TVector >
number ug::AlgebraicConvCheck< TVector >::m_relReduction
protected

Relative reduction required for component.

◆ m_stopwatch

template<class TVector >
Stopwatch ug::AlgebraicConvCheck< TVector >::m_stopwatch
protected

a stopwatch

◆ m_symbol

template<class TVector >
char ug::AlgebraicConvCheck< TVector >::m_symbol
protected

symbol for output appearance

Referenced by ug::AlgebraicConvCheck< TVector >::set_symbol().

◆ m_vCmpInfo

◆ m_verbose

template<class TVector >
bool ug::AlgebraicConvCheck< TVector >::m_verbose
protected

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