ug4
|
#include <algebra_conv_check.h>
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< CmpInfo > | m_vCmpInfo |
info on components More... | |
bool | m_verbose |
verbose level More... | |
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.
ug::AlgebraicConvCheck< TVector >::AlgebraicConvCheck | ( | size_t | ncmp | ) |
constructors
ug::AlgebraicConvCheck< TVector >::AlgebraicConvCheck | ( | size_t | ncmp, |
int | maxSteps, | ||
number | minDefect, | ||
number | relReduction | ||
) |
constructors
ug::AlgebraicConvCheck< TVector >::AlgebraicConvCheck | ( | size_t | ncmp, |
int | maxSteps, | ||
number | minDefect, | ||
number | relReduction, | ||
bool | verbose | ||
) |
constructors
|
inlinevirtual |
|
virtual |
clones this instance
Implements ug::IConvergenceCheck< TVector >.
|
inlinevirtual |
returns information about configuration parameters
this should return necessary information about parameters and possibly calling config_string of subcomponents.
Implements ug::IConvergenceCheck< TVector >.
|
inlinevirtual |
returns the current defect
Implements ug::IConvergenceCheck< TVector >.
References ug::AlgebraicConvCheck< TVector >::defect_all().
Referenced by ug::AlgebraicConvCheck< TVector >::defect_all(), ug::AlgebraicConvCheck< TVector >::initial_defect_all(), and ug::AlgebraicConvCheck< TVector >::last_defect_all().
|
inlineprotected |
returns defect for all components
References ug::AlgebraicConvCheck< TVector >::defect(), and ug::AlgebraicConvCheck< TVector >::m_vCmpInfo.
Referenced by ug::AlgebraicConvCheck< TVector >::avg_rate(), ug::AlgebraicConvCheck< TVector >::defect(), ug::AlgebraicConvCheck< TVector >::rate(), and ug::AlgebraicConvCheck< TVector >::reduction().
|
inlineprotected |
References ug::AlgebraicConvCheck< TVector >::m_vCmpInfo.
|
inlinevirtual |
output
Implements ug::IConvergenceCheck< TVector >.
References ug::AlgebraicConvCheck< TVector >::m_offset.
|
inline |
|
inlineprotected |
returns initial defect for all components
References ug::AlgebraicConvCheck< TVector >::defect(), and ug::AlgebraicConvCheck< TVector >::m_vCmpInfo.
Referenced by ug::AlgebraicConvCheck< TVector >::avg_rate(), and ug::AlgebraicConvCheck< TVector >::reduction().
|
protected |
|
virtual |
iteration_ended
Checks if the iteration must be ended. This can be due to convergence or divergence.
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.
|
inlineprotected |
returns last defect for all components
References ug::AlgebraicConvCheck< TVector >::defect(), and ug::AlgebraicConvCheck< TVector >::m_vCmpInfo.
Referenced by ug::AlgebraicConvCheck< TVector >::rate().
|
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().
|
virtual |
post
post-processes the iteration. Some informative outputs of the status of the iteration after finishing the iteration can be placed here
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.
|
virtual |
|
protected |
References ug::repeat(), and UG_LOG.
|
inlinevirtual |
|
inlinevirtual |
|
inline |
sets check for single component
References ug::AlgebraicConvCheck< TVector >::m_vCmpInfo.
Referenced by ug::AlgebraicConvCheck< TVector >::set_component_checks().
|
inline |
sets check for all components
References ug::AlgebraicConvCheck< TVector >::m_vCmpInfo, and ug::AlgebraicConvCheck< TVector >::set_component_check().
|
inlinevirtual |
sets info string
Implements ug::IConvergenceCheck< TVector >.
References ug::AlgebraicConvCheck< TVector >::m_info.
|
inline |
sets maximum number of iteration steps
References ug::AlgebraicConvCheck< TVector >::m_maxSteps.
|
inlinevirtual |
sets the name of the iteration
Implements ug::IConvergenceCheck< TVector >.
References ug::AlgebraicConvCheck< TVector >::m_name, and name.
|
inlinevirtual |
sets the number of spaces printed before output information
Implements ug::IConvergenceCheck< TVector >.
References ug::AlgebraicConvCheck< TVector >::m_offset.
|
inlinevirtual |
sets the symbol used for output
Implements ug::IConvergenceCheck< TVector >.
References ug::AlgebraicConvCheck< TVector >::m_symbol.
|
inline |
enables time measurement
References ug::AlgebraicConvCheck< TVector >::m_bTimeMeas.
|
inline |
sets if verbose
References ug::AlgebraicConvCheck< TVector >::m_verbose.
|
virtual |
computes the start defect and set it
Implements ug::IConvergenceCheck< TVector >.
References ug::AlgebraicConvCheck< TVector >::CmpInfo::currDefect, ug::repeat(), and UG_LOG.
|
virtual |
|
inlinevirtual |
information about current status
Implements ug::IConvergenceCheck< TVector >.
References ug::AlgebraicConvCheck< TVector >::m_currentStep.
Referenced by ug::AlgebraicConvCheck< TVector >::get_statistics().
|
virtual |
computes the defect and sets it a the next defect value
Implements ug::IConvergenceCheck< TVector >.
References ug::AlgebraicConvCheck< TVector >::CmpInfo::currDefect, ug::AlgebraicConvCheck< TVector >::CmpInfo::lastDefect, and UG_LOG.
|
virtual |
sets the update for the current defect
Implements ug::IConvergenceCheck< TVector >.
References UG_THROW.
|
protected |
enables time measurement
Referenced by ug::AlgebraicConvCheck< TVector >::set_time_measurement().
|
protected |
current step
Referenced by ug::AlgebraicConvCheck< TVector >::avg_rate(), and ug::AlgebraicConvCheck< TVector >::step().
|
protected |
info for iteration (e.g. preconditioner type)
Referenced by ug::AlgebraicConvCheck< TVector >::set_info().
|
protected |
maximum number of steps to be performed
Referenced by ug::AlgebraicConvCheck< TVector >::set_maximum_steps().
|
protected |
Minimal required Defect of component.
|
protected |
name of iteration
Referenced by ug::AlgebraicConvCheck< TVector >::set_name().
|
protected |
number of spaces inserted before output
Referenced by ug::AlgebraicConvCheck< TVector >::get_offset(), and ug::AlgebraicConvCheck< TVector >::set_offset().
|
protected |
Relative reduction required for component.
|
protected |
a stopwatch
|
protected |
symbol for output appearance
Referenced by ug::AlgebraicConvCheck< TVector >::set_symbol().
|
protected |
info on components
Referenced by ug::AlgebraicConvCheck< TVector >::defect_all(), ug::AlgebraicConvCheck< TVector >::fctName(), ug::AlgebraicConvCheck< TVector >::get_statistics(), ug::AlgebraicConvCheck< TVector >::initial_defect_all(), ug::AlgebraicConvCheck< TVector >::last_defect_all(), ug::AlgebraicConvCheck< TVector >::set_component_check(), and ug::AlgebraicConvCheck< TVector >::set_component_checks().
|
protected |
verbose level
Referenced by ug::AlgebraicConvCheck< TVector >::set_verbose().