ug4
|
#include <algebra_conv_check.h>
Classes | |
struct | CmpInfo |
Public Member Functions | |
number | avg_rate () const |
virtual SmartPtr< IConvergenceCheck< TVector > > | clone () |
clones this instance | |
virtual std::string | config_string () const |
returns information about configuration parameters | |
number | defect () const |
returns the current defect | |
int | get_offset () const |
output | |
void | get_statistics (double *first, double *last, int &niter) const |
statistics | |
bool | iteration_ended () |
bool | post () |
void | print_line (std::string line) |
prints a line using prefixes | |
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 | |
void | set_component_checks (const number abs, const number red) |
sets check for all components | |
void | set_info (std::string info) |
sets info string | |
void | set_maximum_steps (int maxSteps) |
sets maximum number of iteration steps | |
void | set_name (std::string name) |
sets the name of the iteration | |
void | set_offset (int offset) |
sets the number of spaces printed before output information | |
void | set_symbol (char symbol) |
sets the symbol used for output | |
void | set_time_measurement (bool yesOrNo) |
enables time measurement | |
void | set_verbose (bool level) |
sets if verbose | |
void | start (const TVector &d) |
computes the start defect and set it | |
void | start_defect (number initialDefect) |
defect control | |
int | step () const |
information about current status | |
void | update (const TVector &d) |
computes the defect and sets it a the next defect value | |
void | update_defect (number newDefect) |
sets the update for the current defect | |
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) | |
![]() | |
virtual | ~IConvergenceCheck () |
virtual destructor | |
Protected Member Functions | |
number | defect_all () const |
returns defect for all components | |
const std::string & | fctName (size_t i) |
number | initial_defect_all () const |
returns initial defect for all components | |
bool | is_valid_number (number value) |
number | last_defect_all () const |
returns last defect for all components | |
number | norm (const TVector &vec, size_t cmp) |
calculates the 2-norm of the entries of the vector vec specified by index | |
void | print_offset () |
Protected Attributes | |
bool | m_bTimeMeas |
enables time measurement | |
int | m_currentStep |
current step | |
std::string | m_info |
info for iteration (e.g. preconditioner type) | |
int | m_maxSteps |
maximum number of steps to be performed | |
number | m_minDefect |
Minimal required Defect of component. | |
std::string | m_name |
name of iteration | |
int | m_offset |
number of spaces inserted before output | |
number | m_relReduction |
Relative reduction required for component. | |
Stopwatch | m_stopwatch |
a stopwatch | |
char | m_symbol |
symbol for output appearance | |
std::vector< CmpInfo > | m_vCmpInfo |
info on components | |
bool | m_verbose |
verbose level | |
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().