|
ug4
|
#include <composite_conv_check.h>
Inheritance diagram for ug::CompositeConvCheck< TVector, TDomain >:Classes | |
| struct | CmpInfo |
| struct | NativCmpInfo |
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 | |
| void | disable_rest_check () |
| disables rest check | |
| int | get_offset () const |
| output | |
| bool | iteration_ended () |
| bool | post () |
| void | print_line (std::string line) |
| prints a line using prefixes | |
| number | rate () const |
| number | reduction () const |
| void | set_adaptive (bool adapt) |
| whether or not the underlying approximatioon space is adaptive | |
| void | set_all_component_check (const number minDefect, const number relReduction) |
| sets check for all components in approximation space | |
| void | set_info (std::string info) |
| sets info string | |
| void | set_level (int level) |
| set level of grid, where defect vectors come from | |
| 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_rest_check (number minDefect, number relReduction) |
| sets default values for non-explicitly specified cmps | |
| void | set_supress_unsuccessful (bool bsupress) |
| set whether always to report success when max iter is reached (useful for LIMEX) | |
| 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 | |
| virtual | ~CompositeConvCheck () |
| destructor | |
| CompositeConvCheck (SmartPtr< ApproximationSpace< TDomain > > approx) | |
| CompositeConvCheck (SmartPtr< ApproximationSpace< TDomain > > spApproxSpace, int maxSteps, number minDefect, number relReduction) | |
| void | set_component_check (const std::string &vFctName, const std::vector< number > &vMinDefect, const std::vector< number > &vRelReduction) |
| void | set_component_check (const std::vector< std::string > &vFctName, const std::vector< number > &vMinDefect, const std::vector< number > &vRelReduction) |
| void | set_component_check (const std::vector< std::string > &vFctName, const number minDefect, const number relReduction) |
| void | set_component_check (const std::string &fctName, const number minDefect, const number relReduction) |
| void | set_group_check (const std::vector< std::string > &vFctName, const number minDefect, const number relReduction) |
| void | set_group_check (const std::string &fctNames, const number minDefect, const number relReduction) |
Public Member Functions inherited from ug::IConvergenceCheck< TVector > | |
| virtual | ~IConvergenceCheck () |
| virtual destructor | |
Protected Member Functions | |
| number | defect_all () const |
| returns defect for all components | |
| template<typename TBaseElem > | |
| void | extract_dof_indices (ConstSmartPtr< DoFDistribution > dd) |
| extracts multi-indices for a fct-comp on a element type | |
| void | extract_dof_indices (ConstSmartPtr< DoFDistribution > dd) |
| extracts multi-indices from dof distribution | |
| 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, const std::vector< DoFIndex > &index) |
| calculates the 2-norm of the entries of the vector vec specified by index | |
| void | print_offset () |
| void | update_rest_check () |
Protected Attributes | |
| bool | m_bAdaptive |
| adaptivity flag | |
| bool | m_bCheckRest |
| default Values | |
| bool | m_bTimeMeas |
| enables time measurement | |
| std::vector< CmpInfo > | m_CmpInfo |
| infos for each component | |
| 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 | |
| std::string | m_name |
| name of iteration | |
| size_t | m_numAllDoFs |
| int | m_offset |
| number of spaces inserted before output | |
| number | m_restMinDefect |
| number | m_restRelReduction |
| SmartPtr< ApproximationSpace< TDomain > > | m_spApprox |
| ApproxSpace. | |
| Stopwatch | m_stopwatch |
| a stopwatch | |
| bool | m_supress_unsuccessful |
| whether to always report success once max iter is reached | |
| char | m_symbol |
| symbol for output appearance | |
| bool | m_verbose |
| verbose level | |
| std::vector< NativCmpInfo > | m_vNativCmpInfo |
| info on natural components | |
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::CompositeConvCheck< TVector, TDomain >::CompositeConvCheck | ( | SmartPtr< ApproximationSpace< TDomain > > | approx | ) |
constructors
References ug::CompositeConvCheck< TVector, TDomain >::set_level(), and ug::GridLevel::TOP.
| ug::CompositeConvCheck< TVector, TDomain >::CompositeConvCheck | ( | SmartPtr< ApproximationSpace< TDomain > > | spApproxSpace, |
| int | maxSteps, | ||
| number | minDefect, | ||
| number | relReduction | ||
| ) |
constructors
References ug::CompositeConvCheck< TVector, TDomain >::set_level(), and ug::GridLevel::TOP.
|
inlinevirtual |
destructor
|
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 >.
References ug::CompositeConvCheck< TVector, TDomain >::config_string(), ug::CompositeConvCheck< TVector, TDomain >::m_CmpInfo, and ug::CompositeConvCheck< TVector, TDomain >::m_maxSteps.
Referenced by ug::CompositeConvCheck< TVector, TDomain >::config_string().
|
inlinevirtual |
returns the current defect
Implements ug::IConvergenceCheck< TVector >.
References ug::CompositeConvCheck< TVector, TDomain >::defect_all().
Referenced by ug::CompositeConvCheck< TVector, TDomain >::defect_all(), ug::CompositeConvCheck< TVector, TDomain >::initial_defect_all(), and ug::CompositeConvCheck< TVector, TDomain >::last_defect_all().
|
inlineprotected |
returns defect for all components
References ug::CompositeConvCheck< TVector, TDomain >::defect(), and ug::CompositeConvCheck< TVector, TDomain >::m_vNativCmpInfo.
Referenced by ug::CompositeConvCheck< TVector, TDomain >::avg_rate(), ug::CompositeConvCheck< TVector, TDomain >::defect(), ug::CompositeConvCheck< TVector, TDomain >::rate(), and ug::CompositeConvCheck< TVector, TDomain >::reduction().
|
inline |
disables rest check
References ug::CompositeConvCheck< TVector, TDomain >::m_bCheckRest, and ug::CompositeConvCheck< TVector, TDomain >::update_rest_check().
|
protected |
extracts multi-indices for a fct-comp on a element type
References ug::SurfaceView::ALL, ug::MultiGrid::get_child(), ug::SurfaceView::is_contained(), ug::MultiGrid::num_children(), ug::SurfaceView::SHADOW_RIM_COPY, and ug::SurfaceView::SURFACE_RIM.
|
protected |
extracts multi-indices from dof distribution
References ug::EDGE, ug::FACE, name, ug::VERTEX, and ug::VOLUME.
|
inlineprotected |
|
inlinevirtual |
output
Implements ug::IConvergenceCheck< TVector >.
References ug::CompositeConvCheck< TVector, TDomain >::m_offset.
|
inlineprotected |
returns initial defect for all components
References ug::CompositeConvCheck< TVector, TDomain >::defect(), and ug::CompositeConvCheck< TVector, TDomain >::m_vNativCmpInfo.
Referenced by ug::CompositeConvCheck< TVector, TDomain >::avg_rate(), and ug::CompositeConvCheck< TVector, TDomain >::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::CompositeConvCheck< TVector, TDomain >::CmpInfo::currDefect, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::initDefect, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::minDefect, and ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::relReduction.
|
inlineprotected |
returns last defect for all components
References ug::CompositeConvCheck< TVector, TDomain >::defect(), and ug::CompositeConvCheck< TVector, TDomain >::m_vNativCmpInfo.
Referenced by ug::CompositeConvCheck< TVector, TDomain >::rate().
|
protected |
calculates the 2-norm of the entries of the vector vec specified by index
References pcl::ProcessCommunicator::allreduce(), ug::DoFRef(), PCL_RO_SUM, ug::PST_UNIQUE, and UG_THROW.
|
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::CompositeConvCheck< TVector, TDomain >::CmpInfo::currDefect, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::initDefect, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::minDefect, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::name, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::relReduction, ug::repeat(), and UG_LOG.
|
virtual |
|
protected |
References ug::repeat(), and UG_LOG.
|
inlinevirtual |
|
inlinevirtual |
|
inline |
whether or not the underlying approximatioon space is adaptive
References ug::CompositeConvCheck< TVector, TDomain >::m_bAdaptive.
| void ug::CompositeConvCheck< TVector, TDomain >::set_all_component_check | ( | const number | minDefect, |
| const number | relReduction | ||
| ) |
sets check for all components in approximation space
References name.
| void ug::CompositeConvCheck< TVector, TDomain >::set_component_check | ( | const std::string & | fctName, |
| const number | minDefect, | ||
| const number | relReduction | ||
| ) |
sets check for single component
References ug::TokenizeTrimString().
| void ug::CompositeConvCheck< TVector, TDomain >::set_component_check | ( | const std::string & | vFctName, |
| const std::vector< number > & | vMinDefect, | ||
| const std::vector< number > & | vRelReduction | ||
| ) |
sets check for single component
References ug::TokenizeTrimString().
| void ug::CompositeConvCheck< TVector, TDomain >::set_component_check | ( | const std::vector< std::string > & | vFctName, |
| const number | minDefect, | ||
| const number | relReduction | ||
| ) |
sets check for single component
| void ug::CompositeConvCheck< TVector, TDomain >::set_component_check | ( | const std::vector< std::string > & | vFctName, |
| const std::vector< number > & | vMinDefect, | ||
| const std::vector< number > & | vRelReduction | ||
| ) |
sets check for single component
References UG_THROW.
| void ug::CompositeConvCheck< TVector, TDomain >::set_group_check | ( | const std::string & | fctNames, |
| const number | minDefect, | ||
| const number | relReduction | ||
| ) |
sets check for group of components
References ug::TokenizeTrimString().
| void ug::CompositeConvCheck< TVector, TDomain >::set_group_check | ( | const std::vector< std::string > & | vFctName, |
| const number | minDefect, | ||
| const number | relReduction | ||
| ) |
sets check for group of components
References name, and ug::TrimString().
|
inlinevirtual |
sets info string
Implements ug::IConvergenceCheck< TVector >.
References ug::CompositeConvCheck< TVector, TDomain >::m_info.
| void ug::CompositeConvCheck< TVector, TDomain >::set_level | ( | int | level | ) |
set level of grid, where defect vectors come from
References ug::GridLevel::SURFACE.
Referenced by ug::CompositeConvCheck< TVector, TDomain >::CompositeConvCheck(), and ug::CompositeConvCheck< TVector, TDomain >::CompositeConvCheck().
|
inline |
sets maximum number of iteration steps
References ug::CompositeConvCheck< TVector, TDomain >::m_maxSteps.
|
inlinevirtual |
sets the name of the iteration
Implements ug::IConvergenceCheck< TVector >.
References ug::CompositeConvCheck< TVector, TDomain >::m_name, and name.
|
inlinevirtual |
sets the number of spaces printed before output information
Implements ug::IConvergenceCheck< TVector >.
References ug::CompositeConvCheck< TVector, TDomain >::m_offset.
|
inline |
sets default values for non-explicitly specified cmps
References ug::CompositeConvCheck< TVector, TDomain >::m_bCheckRest, ug::CompositeConvCheck< TVector, TDomain >::m_restMinDefect, ug::CompositeConvCheck< TVector, TDomain >::m_restRelReduction, and ug::CompositeConvCheck< TVector, TDomain >::update_rest_check().
|
inline |
set whether always to report success when max iter is reached (useful for LIMEX)
References ug::CompositeConvCheck< TVector, TDomain >::m_supress_unsuccessful.
|
inlinevirtual |
sets the symbol used for output
Implements ug::IConvergenceCheck< TVector >.
References ug::CompositeConvCheck< TVector, TDomain >::m_symbol.
|
inline |
enables time measurement
References ug::CompositeConvCheck< TVector, TDomain >::m_bTimeMeas.
|
inline |
sets if verbose
References ug::CompositeConvCheck< TVector, TDomain >::m_verbose.
|
virtual |
computes the start defect and set it
Implements ug::IConvergenceCheck< TVector >.
References ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::currDefect, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::initDefect, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::minDefect, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::name, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::relReduction, ug::repeat(), ug::GridLevel::TOP, UG_LOG, UG_THROW, and ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::vFct.
|
virtual |
|
inlinevirtual |
information about current status
Implements ug::IConvergenceCheck< TVector >.
References ug::CompositeConvCheck< TVector, TDomain >::m_currentStep.
|
virtual |
computes the defect and sets it a the next defect value
Implements ug::IConvergenceCheck< TVector >.
References ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::currDefect, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::initDefect, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::lastDefect, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::minDefect, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::name, ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::relReduction, UG_LOG, UG_THROW, and ug::CompositeConvCheck< TVector, TDomain >::CmpInfo::vFct.
|
virtual |
sets the update for the current defect
Implements ug::IConvergenceCheck< TVector >.
References UG_THROW.
|
protected |
References name.
Referenced by ug::CompositeConvCheck< TVector, TDomain >::disable_rest_check(), and ug::CompositeConvCheck< TVector, TDomain >::set_rest_check().
|
protected |
adaptivity flag
Referenced by ug::CompositeConvCheck< TVector, TDomain >::set_adaptive().
|
protected |
default Values
Referenced by ug::CompositeConvCheck< TVector, TDomain >::disable_rest_check(), and ug::CompositeConvCheck< TVector, TDomain >::set_rest_check().
|
protected |
enables time measurement
Referenced by ug::CompositeConvCheck< TVector, TDomain >::set_time_measurement().
|
protected |
infos for each component
Referenced by ug::CompositeConvCheck< TVector, TDomain >::config_string(), and ug::CompositeConvCheck< TVector, TDomain >::fctName().
|
protected |
current step
Referenced by ug::CompositeConvCheck< TVector, TDomain >::avg_rate(), and ug::CompositeConvCheck< TVector, TDomain >::step().
|
protected |
info for iteration (e.g. preconditioner type)
Referenced by ug::CompositeConvCheck< TVector, TDomain >::set_info().
|
protected |
maximum number of steps to be performed
Referenced by ug::CompositeConvCheck< TVector, TDomain >::config_string(), and ug::CompositeConvCheck< TVector, TDomain >::set_maximum_steps().
|
protected |
name of iteration
Referenced by ug::CompositeConvCheck< TVector, TDomain >::set_name().
|
protected |
|
protected |
number of spaces inserted before output
Referenced by ug::CompositeConvCheck< TVector, TDomain >::get_offset(), and ug::CompositeConvCheck< TVector, TDomain >::set_offset().
|
protected |
Referenced by ug::CompositeConvCheck< TVector, TDomain >::set_rest_check().
|
protected |
Referenced by ug::CompositeConvCheck< TVector, TDomain >::set_rest_check().
|
protected |
ApproxSpace.
|
protected |
a stopwatch
|
protected |
whether to always report success once max iter is reached
Referenced by ug::CompositeConvCheck< TVector, TDomain >::set_supress_unsuccessful().
|
protected |
symbol for output appearance
Referenced by ug::CompositeConvCheck< TVector, TDomain >::set_symbol().
|
protected |
verbose level
Referenced by ug::CompositeConvCheck< TVector, TDomain >::set_verbose().
|
protected |
info on natural components
Referenced by ug::CompositeConvCheck< TVector, TDomain >::defect_all(), ug::CompositeConvCheck< TVector, TDomain >::initial_defect_all(), and ug::CompositeConvCheck< TVector, TDomain >::last_defect_all().