33 #ifndef __H__UG_mg_stats
34 #define __H__UG_mg_stats
43 template <
typename TDomain,
typename TAlgebra>
112 const char* stageNames[] = {
"BEFORE_PRE_SMOOTH",
114 "BEFORE_POST_SMOOTH",
117 return stageNames[stage];
122 const char* stageNames[] = {
"|bef pre smth|",
127 return stageNames[stage];
represents numerical solutions on a grid using an algebraic vector
Definition: grid_function.h:121
Records statistics on how individual parts of a multigrid method worked.
Definition: mg_stats.h:44
void set_exit_on_error(bool exitOnError)
If enabled, a deterioration of the norm of the defect leads to an error.
Definition: mg_stats_impl.hpp:59
void set_write_err_vecs(bool writeErrVecs)
If enabled, involved defects are written to file if the defect deteriorates.
Definition: mg_stats_impl.hpp:67
bool m_writeErrVecs
Definition: mg_stats.h:150
bool m_writeErrDiffs
Definition: mg_stats.h:151
void save_stats_to_file()
saves current stats to filenamePrefix.log
Definition: mg_stats_impl.hpp:103
void clear()
clears the current stats
Definition: mg_stats_impl.hpp:136
void set_active_stages(const std::vector< int > &activeStages)
sets the active stages. All other stages will be ignored.
Definition: mg_stats_impl.hpp:88
std::vector< FuncEntry > m_funcs
Definition: mg_stats.h:142
MGStats()
Definition: mg_stats_impl.hpp:43
void level_required(int lvl)
Definition: mg_stats_impl.hpp:248
const char * stage_norm_name(Stage stage)
returns the name of the norm of a given stage as a string
Definition: mg_stats.h:121
GridFunction< TDomain, TAlgebra > grid_func_t
Definition: mg_stats.h:46
void write_header(int maxLvl)
Definition: mg_stats_impl.hpp:257
StringTable m_stats
Definition: mg_stats.h:144
Stage
Defines at which stage data is recorded in a given multigrid cycle.
Definition: mg_stats.h:51
@ AFTER_PRE_SMOOTH
Definition: mg_stats.h:53
@ BEFORE_PRE_SMOOTH
Definition: mg_stats.h:52
@ AFTER_POST_SMOOTH
Definition: mg_stats.h:55
@ INVALID
Definition: mg_stats.h:56
@ BEFORE_POST_SMOOTH
Definition: mg_stats.h:54
static const int NUM_STAGES
Definition: mg_stats.h:59
bool m_exitOnError
Definition: mg_stats.h:149
int m_maxLvl
Definition: mg_stats.h:147
int m_statsRow
Definition: mg_stats.h:145
void set_defect(grid_func_t &gf, int lvl, Stage stage)
set the defect on a certain level for a given stage
Definition: mg_stats_impl.hpp:144
bool m_stageIsActive[NUM_STAGES]
Definition: mg_stats.h:143
SmartPtr< grid_func_t > sp_grid_func_t
Definition: mg_stats.h:47
void set_filename_prefix(const char *filename)
sets the prefix with which files are written
Definition: mg_stats_impl.hpp:81
void set_write_err_diffs(bool writeErrDiffs)
If enabled, a diff bettween defects involved is written to file if the defect deteriorates.
Definition: mg_stats_impl.hpp:74
void print()
prints the current stats
Definition: mg_stats_impl.hpp:129
const char * stage_name(Stage stage)
returns the name of a given stage as a string
Definition: mg_stats.h:111
int m_lastLvlWritten
Definition: mg_stats.h:146
std::string m_filenamePrefix
Definition: mg_stats.h:148
double number
Definition: types.h:124
Definition: mg_stats.h:134
FuncEntry()
Definition: mg_stats.h:135
number norm
Definition: mg_stats.h:139
Stage stage
Definition: mg_stats.h:138
sp_grid_func_t func
Definition: mg_stats.h:136
sp_grid_func_t tmpFunc
Definition: mg_stats.h:137