ug4
ug::StdConvCheck< TVector > Class Template Reference

#include <convergence_check.h>

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

Public Member Functions

number avg_rate () const
 
virtual SmartPtr< IConvergenceCheck< TVector > > clone ()
 clone the object More...
 
virtual std::string config_string () const
 returns information about configuration parameters More...
 
number defect () const
 returns the current defect More...
 
number get_defect (size_t i) const
 
const std::vector< numberget_defects () const
 
int get_offset () const
 get the current offset More...
 
bool iteration_ended ()
 
bool post ()
 
number previous_defect () const
 
void print_line (std::string line)
 prints a line More...
 
number rate () const
 
number reduction () const
 
void set_info (std::string info)
 sets info string More...
 
void set_maximum_steps (int maxSteps)
 
void set_minimum_defect (number minDefect)
 
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_reduction (number relReduction)
 
void set_supress_unsuccessful (bool bsupress)
 
void set_symbol (char symbol)
 sets the symbol used for output More...
 
void set_verbose (bool level)
 
void start (const TVector &d)
 computes the start defect and set it More...
 
void start_defect (number initialDefect)
 sets the given start defect More...
 
 StdConvCheck ()
 
 StdConvCheck (int maxSteps, number minDefect, number relReduction)
 
 StdConvCheck (int maxSteps, number minDefect, number relReduction, bool verbose)
 
 StdConvCheck (int maxSteps, number minDefect, number relReduction, bool verbose, bool suppressUnsuccessful)
 
int step () const
 returns the current number of steps 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...
 
- Public Member Functions inherited from ug::IConvergenceCheck< TVector >
virtual ~IConvergenceCheck ()
 virtual destructor More...
 

Protected Member Functions

bool is_valid_number (number value)
 
void print_offset ()
 

Protected Attributes

number m_currentDefect
 
int m_currentStep
 
std::string m_info
 
number m_initialDefect
 
number m_lastDefect
 
int m_maxSteps
 
number m_minDefect
 
std::string m_name
 
int m_offset
 
number m_ratesProduct
 
number m_relReduction
 
bool m_supress_unsuccessful
 
char m_symbol
 
bool m_verbose
 

Private Attributes

std::vector< number_defects
 

Detailed Description

template<typename TVector>
class ug::StdConvCheck< TVector >

StdConvCheck

This is a standard implementation of the convergence check. The function_type must provide the following function:

  • number norm() — giving the two norm of the function

Constructor & Destructor Documentation

◆ StdConvCheck() [1/4]

template<typename TVector >
ug::StdConvCheck< TVector >::StdConvCheck

◆ StdConvCheck() [2/4]

template<typename TVector >
ug::StdConvCheck< TVector >::StdConvCheck ( int  maxSteps,
number  minDefect,
number  relReduction 
)

◆ StdConvCheck() [3/4]

template<typename TVector >
ug::StdConvCheck< TVector >::StdConvCheck ( int  maxSteps,
number  minDefect,
number  relReduction,
bool  verbose 
)

◆ StdConvCheck() [4/4]

template<typename TVector >
ug::StdConvCheck< TVector >::StdConvCheck ( int  maxSteps,
number  minDefect,
number  relReduction,
bool  verbose,
bool  suppressUnsuccessful 
)

Member Function Documentation

◆ avg_rate()

template<typename TVector >
number ug::StdConvCheck< TVector >::avg_rate ( ) const
inlinevirtual

◆ clone()

template<typename TVector >
virtual SmartPtr<IConvergenceCheck<TVector> > ug::StdConvCheck< TVector >::clone ( )
inlinevirtual

clone the object

Implements ug::IConvergenceCheck< TVector >.

Reimplemented in ug::EnergyConvCheck< TVector >.

◆ config_string()

template<typename TVector >
virtual std::string ug::StdConvCheck< 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 >.

Reimplemented in ug::EnergyConvCheck< TVector >.

References ug::StdConvCheck< TVector >::m_maxSteps, ug::StdConvCheck< TVector >::m_minDefect, and ug::StdConvCheck< TVector >::m_relReduction.

◆ defect()

template<typename TVector >
number ug::StdConvCheck< TVector >::defect ( ) const
inlinevirtual

returns the current defect

Implements ug::IConvergenceCheck< TVector >.

References ug::StdConvCheck< TVector >::m_currentDefect.

◆ get_defect()

template<typename TVector >
number ug::StdConvCheck< TVector >::get_defect ( size_t  i) const
inline

◆ get_defects()

template<typename TVector >
const std::vector<number> ug::StdConvCheck< TVector >::get_defects ( ) const
inline

◆ get_offset()

template<typename TVector >
int ug::StdConvCheck< TVector >::get_offset ( ) const
inlinevirtual

get the current offset

Implements ug::IConvergenceCheck< TVector >.

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

◆ is_valid_number()

template<typename TVector >
bool ug::StdConvCheck< TVector >::is_valid_number ( number  value)
protected

◆ iteration_ended()

template<typename TVector >
bool ug::StdConvCheck< 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 >.

◆ post()

template<typename TVector >
bool ug::StdConvCheck< 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::repeat(), and UG_LOG.

◆ previous_defect()

template<typename TVector >
number ug::StdConvCheck< TVector >::previous_defect ( ) const
inline

◆ print_line()

template<typename TVector >
void ug::StdConvCheck< TVector >::print_line ( std::string  line)
virtual

prints a line

Implements ug::IConvergenceCheck< TVector >.

References UG_LOG.

◆ print_offset()

template<typename TVector >
void ug::StdConvCheck< TVector >::print_offset
protected

References ug::repeat(), and UG_LOG.

◆ rate()

template<typename TVector >
number ug::StdConvCheck< TVector >::rate ( ) const
inlinevirtual

◆ reduction()

template<typename TVector >
number ug::StdConvCheck< TVector >::reduction ( ) const
inlinevirtual

◆ set_info()

template<typename TVector >
void ug::StdConvCheck< TVector >::set_info ( std::string  name)
inlinevirtual

◆ set_maximum_steps()

template<typename TVector >
void ug::StdConvCheck< TVector >::set_maximum_steps ( int  maxSteps)
inline

◆ set_minimum_defect()

template<typename TVector >
void ug::StdConvCheck< TVector >::set_minimum_defect ( number  minDefect)
inline

◆ set_name()

template<typename TVector >
void ug::StdConvCheck< TVector >::set_name ( std::string  name)
inlinevirtual

sets the name of the iteration

Implements ug::IConvergenceCheck< TVector >.

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

◆ set_offset()

template<typename TVector >
void ug::StdConvCheck< TVector >::set_offset ( int  offset)
inlinevirtual

sets the number of spaces printed before output information

Implements ug::IConvergenceCheck< TVector >.

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

◆ set_reduction()

template<typename TVector >
void ug::StdConvCheck< TVector >::set_reduction ( number  relReduction)
inline

◆ set_supress_unsuccessful()

template<typename TVector >
void ug::StdConvCheck< TVector >::set_supress_unsuccessful ( bool  bsupress)
inline

◆ set_symbol()

template<typename TVector >
void ug::StdConvCheck< TVector >::set_symbol ( char  symbol)
inlinevirtual

sets the symbol used for output

Implements ug::IConvergenceCheck< TVector >.

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

◆ set_verbose()

template<typename TVector >
void ug::StdConvCheck< TVector >::set_verbose ( bool  level)
inline

◆ start()

template<typename TVector >
void ug::StdConvCheck< TVector >::start ( const TVector &  d)
virtual

computes the start defect and set it

Implements ug::IConvergenceCheck< TVector >.

Reimplemented in ug::EnergyConvCheck< TVector >.

◆ start_defect()

template<typename TVector >
void ug::StdConvCheck< TVector >::start_defect ( number  defect)
virtual

sets the given start defect

Implements ug::IConvergenceCheck< TVector >.

References ug::repeat(), and UG_LOG.

Referenced by ug::EnergyConvCheck< TVector >::start().

◆ step()

template<typename TVector >
int ug::StdConvCheck< TVector >::step ( ) const
inlinevirtual

returns the current number of steps

Implements ug::IConvergenceCheck< TVector >.

References ug::StdConvCheck< TVector >::m_currentStep.

Referenced by ug::StdConvCheck< TVector >::avg_rate().

◆ update()

template<typename TVector >
void ug::StdConvCheck< TVector >::update ( const TVector &  d)
virtual

computes the defect and sets it a the next defect value

Implements ug::IConvergenceCheck< TVector >.

Reimplemented in ug::EnergyConvCheck< TVector >.

◆ update_defect()

template<typename TVector >
void ug::StdConvCheck< TVector >::update_defect ( number  defect)
virtual

sets the update for the current defect

Implements ug::IConvergenceCheck< TVector >.

References UG_LOG.

Referenced by ug::EnergyConvCheck< TVector >::update().

Member Data Documentation

◆ _defects

template<typename TVector >
std::vector<number> ug::StdConvCheck< TVector >::_defects
private

◆ m_currentDefect

template<typename TVector >
number ug::StdConvCheck< TVector >::m_currentDefect
protected

◆ m_currentStep

template<typename TVector >
int ug::StdConvCheck< TVector >::m_currentStep
protected

◆ m_info

template<typename TVector >
std::string ug::StdConvCheck< TVector >::m_info
protected

◆ m_initialDefect

template<typename TVector >
number ug::StdConvCheck< TVector >::m_initialDefect
protected

◆ m_lastDefect

template<typename TVector >
number ug::StdConvCheck< TVector >::m_lastDefect
protected

◆ m_maxSteps

◆ m_minDefect

◆ m_name

template<typename TVector >
std::string ug::StdConvCheck< TVector >::m_name
protected

◆ m_offset

template<typename TVector >
int ug::StdConvCheck< TVector >::m_offset
protected

◆ m_ratesProduct

template<typename TVector >
number ug::StdConvCheck< TVector >::m_ratesProduct
protected

◆ m_relReduction

◆ m_supress_unsuccessful

template<typename TVector >
bool ug::StdConvCheck< TVector >::m_supress_unsuccessful
protected

◆ m_symbol

template<typename TVector >
char ug::StdConvCheck< TVector >::m_symbol
protected

◆ m_verbose

template<typename TVector >
bool ug::StdConvCheck< TVector >::m_verbose
protected

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