ug4
|
#include <composite_conv_check.h>
Classes | |
struct | CmpInfo |
struct | NativCmpInfo |
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... | |
void | disable_rest_check () |
disables rest check More... | |
int | get_offset () const |
output 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_adaptive (bool adapt) |
whether or not the underlying approximatioon space is adaptive More... | |
void | set_all_component_check (const number minDefect, const number relReduction) |
sets check for all components in approximation space More... | |
void | set_info (std::string info) |
sets info string More... | |
void | set_level (int level) |
set level of grid, where defect vectors come from 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_rest_check (number minDefect, number relReduction) |
sets default values for non-explicitly specified cmps More... | |
void | set_supress_unsuccessful (bool bsupress) |
set whether always to report success when max iter is reached (useful for LIMEX) 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... | |
virtual | ~CompositeConvCheck () |
destructor More... | |
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 More... | |
Protected Member Functions | |
number | defect_all () const |
returns defect for all components More... | |
template<typename TBaseElem > | |
void | extract_dof_indices (ConstSmartPtr< DoFDistribution > dd) |
extracts multi-indices for a fct-comp on a element type More... | |
void | extract_dof_indices (ConstSmartPtr< DoFDistribution > dd) |
extracts multi-indices from dof distribution 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, const std::vector< DoFIndex > &index) |
calculates the 2-norm of the entries of the vector vec specified by index More... | |
void | print_offset () |
void | update_rest_check () |
Protected Attributes | |
bool | m_bAdaptive |
adaptivity flag More... | |
bool | m_bCheckRest |
default Values More... | |
bool | m_bTimeMeas |
enables time measurement More... | |
std::vector< CmpInfo > | m_CmpInfo |
infos for each component 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... | |
std::string | m_name |
name of iteration More... | |
size_t | m_numAllDoFs |
int | m_offset |
number of spaces inserted before output More... | |
number | m_restMinDefect |
number | m_restRelReduction |
SmartPtr< ApproximationSpace< TDomain > > | m_spApprox |
ApproxSpace. More... | |
Stopwatch | m_stopwatch |
a stopwatch More... | |
bool | m_supress_unsuccessful |
whether to always report success once max iter is reached More... | |
char | m_symbol |
symbol for output appearance More... | |
bool | m_verbose |
verbose level More... | |
std::vector< NativCmpInfo > | m_vNativCmpInfo |
info on natural components 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::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 >::m_CmpInfo, and ug::CompositeConvCheck< TVector, TDomain >::m_maxSteps.
|
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().
|
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().