3#include <deal.II/base/convergence_table.h>
7 template <
typename number>
28 add_n_dofs(
const std::string label,
const unsigned int n_dofs)
38 ptr->second.n_calls += 1;
39 ptr->second.dofs_accumulated += n_dofs;
40 ptr->second.dofs_min = std::min(ptr->second.dofs_min, n_dofs);
41 ptr->second.dofs_max = std::max(ptr->second.dofs_max, n_dofs);
45 template <
typename StreamType>
49 dealii::ConvergenceTable table;
53 table.add_value(
"label", entry.first);
54 table.add_value(
"no. calls", entry.second.n_calls);
55 table.add_value(
"n_dof avg",
56 static_cast<number
>(entry.second.dofs_accumulated) /
57 entry.second.n_calls);
58 table.set_precision(
"n_dof avg", 2);
59 table.add_value(
"n_dof min", entry.second.dofs_min);
60 table.add_value(
"n_dof max", entry.second.dofs_max);
64 table.write_text(ss.get_stream(), dealii::TableHandler::TextOutputFormat::org_mode_table);
69 inline static std::map<std::string, DoFStatistics>
stat_dofs;
Definition dof_monitor.hpp:9
static std::map< std::string, DoFStatistics > stat_dofs
Definition dof_monitor.hpp:69
static void print(StreamType &ss)
Definition dof_monitor.hpp:47
static void add_n_dofs(const std::string label, const unsigned int n_dofs)
Definition dof_monitor.hpp:28
Interface for a general preconditioner.
Definition boundary_condition_functions.hpp:17
Definition dof_monitor.hpp:12
unsigned int n_calls
Definition dof_monitor.hpp:20
unsigned int dofs_max
Definition dof_monitor.hpp:23
unsigned int dofs_accumulated
Definition dof_monitor.hpp:21
DoFStatistics(const unsigned int n_dofs=0)
Definition dof_monitor.hpp:13
unsigned int dofs_min
Definition dof_monitor.hpp:22