*
* As this class has no information on the space dimension upon which the
* reference column vs. the value column is based upon, it needs to be
- * passed as last argument to this method. The default dimension is two.
+ * passed as last argument to this method. The <i>default dimension for the
+ * reference column</i> is 2, which is appropriate for the number of cells
+ * in 2D. If you work in 3D, set the number to 3. If the reference column is
+ * $1/h$, remember to set the dimension to 1 also when working in 3D to get
+ * correct rates.
*
* The new rate column and the data column will be merged to a
* supercolumn. The tex caption of the supercolumn will be (by default) the
* This method behaves in the following way:
*
* If RateMode is reduction_rate, then the computed output is
- * $ \frac{e_{n-1}/k_{n-1}}{e_n/k_n} $.
- *
- * Where $k$ is the reference column.
+ * $ \frac{e_{n-1}/k_{n-1}}{e_n/k_n}, $
+ * where $k$ is the reference column (no dimension dependence!).
*
* If RateMode is reduction_rate_log2, then the computed output is
* $
* $.
*
* This is useful, for example, if we use as reference key the number of
- * degrees of freedom. Assuming that the error is proportional to $ C
- * (1/\sqrt{k})^r $, then this method will produce the rate $r$ as a result.
+ * degrees of freedom or better, the number of cells. Assuming that the
+ * error is proportional to $ C (1/\sqrt{k})^r $ in 2D, then this method
+ * will produce the rate $r$ as a result.
*
* @note Since this function adds columns to the table after several rows
* have already been filled, it switches off the auto fill mode of the
/**
- * Evaluates the convergence rates of the
- * data column <tt>data_column_key</tt>
- * due to the #RateMode.
- * Be sure that the value types of the
- * table entries of the data column
- * is a number, i.e. double, float,
- * (unsigned) int, and so on.
+ * Evaluates the convergence rates of the data column
+ * <tt>data_column_key</tt> due to the #RateMode. Be sure that the value
+ * types of the table entries of the data column is a number, i.e. double,
+ * float, (unsigned) int, and so on.
*
- * The new rate column and the data column
- * will be merged to a supercolumn. The
- * tex caption of the supercolumn will be
- * (by default) the same as the one of the
- * data column. This may be changed by using
- * the set_tex_supercaption() function
- * of the base class TableHandler.
+ * The new rate column and the data column will be merged to a
+ * supercolumn. The tex caption of the supercolumn will be (by default) the
+ * same as the one of the data column. This may be changed by using the
+ * set_tex_supercaption() function of the base class TableHandler.
*
- * @note Since this function adds columns
- * to the table after several rows have
- * already been filled, it switches off
- * the auto fill mode of the TableHandler
- * base class. If you intend to add
- * further data with auto fill, you will
- * have to re-enable it after calling
- * this function.
+ * @note Since this function adds columns to the table after several rows
+ * have already been filled, it switches off the auto fill mode of the
+ * TableHandler base class. If you intend to add further data with auto
+ * fill, you will have to re-enable it after calling this function.
*/
void
evaluate_convergence_rates (const std::string &data_column_key,
const RateMode rate_mode);
/**
- * Omit this column <tt>key</tt>
- * (not supercolumn!) from the
- * evaluation of the convergence rates
- * of `all' columns (see the following
- * two functions).
+ * Omit this column <tt>key</tt> (not supercolumn!) from the evaluation of
+ * the convergence rates of `all' columns (see the following two functions).
*
- * The Column::flag==1 is reserved for
- * omitting the column from convergence
+ * The Column::flag==1 is reserved for omitting the column from convergence
* rate evalution.
*/
void
omit_column_from_convergence_rate_evaluation(const std::string &key);
/**
- * Evaluates convergence rates
- * due to the <tt>rate_mode</tt>
- * in relation to the reference
- * column
- * <tt>reference_column_key</tt>. This
- * function evaluates the rates
- * of ALL columns except of the
- * columns that are to be omitted
- * (see previous function) and
- * execpt of the columns that are
- * previously evaluated rate
- * columns. This function allows
- * to evaluate the convergence
- * rate for almost all columns of
- * a table without calling
- * evaluate_convergence_rates()
- * for each column separately.
+ * Evaluates convergence rates due to the <tt>rate_mode</tt> in relation to
+ * the reference column <tt>reference_column_key</tt>. This function
+ * evaluates the rates of ALL columns except of the columns that are to be
+ * omitted (see previous function) and execpt of the columns that are
+ * previously evaluated rate columns. This function allows to evaluate the
+ * convergence rate for almost all columns of a table without calling
+ * evaluate_convergence_rates() for each column separately.
*
* Example:
- * Columns like <tt>n cells</tt> or
- * <tt>n dofs</tt> columns may be wanted
- * to be omitted in the evaluation
- * of the convergence rates. Hence they
- * should omitted by calling the
- * omit_column_from_convergence_rate_evaluation().
+ * Columns like <tt>n cells</tt> or <tt>n dofs</tt> columns may be wanted to
+ * be omitted in the evaluation of the convergence rates. Hence they should
+ * omitted by calling the omit_column_from_convergence_rate_evaluation().
*/
void
evaluate_all_convergence_rates(const std::string &reference_column_key,
const RateMode rate_mode);
/**
- * Evaluates convergence rates
- * due to the <tt>rate_mode</tt>. This
- * function evaluates the rates of
- * ALL columns except of the
- * columns that are to be omitted
- * (see previous function)
- * and execpt of the columns that are
- * previously
- * evaluated rate columns.
- * This function allows to evaluate
- * the convergence rate for almost all
- * columns of a table without calling
- * evaluate_convergence_rates()
- * for each column seperately.
+ * Evaluates convergence rates due to the <tt>rate_mode</tt>. This function
+ * evaluates the rates of ALL columns except of the columns that are to be
+ * omitted (see previous function) and execpt of the columns that are
+ * previously evaluated rate columns. This function allows to evaluate the
+ * convergence rate for almost all columns of a table without calling
+ * evaluate_convergence_rates() for each column seperately.
*
* Example:
- * Columns like <tt>n cells</tt> or
- * <tt>n dofs</tt> columns may be wanted
- * to be omitted in the evaluation
- * of the convergence rates. Hence they
- * should omitted by calling the
- * omit_column_from_convergence_rate_evaluation().
+ * Columns like <tt>n cells</tt> or <tt>n dofs</tt> columns may be wanted to
+ * be omitted in the evaluation of the convergence rates. Hence they should
+ * omitted by calling the omit_column_from_convergence_rate_evaluation().
*/
void
evaluate_all_convergence_rates(const RateMode rate_mode);
// reference_column_key and data from various dimension where the reference
// data must be scaled by dimension
+// data generated from a run of step-7 with Q2 elements for 1D, 2D and Q1
+// elements for 3D
+
int main ()
{
std::ofstream logfile("convergence_table_04/output");
ConvergenceTable table_2;
ConvergenceTable table_3;
- deallog.push("1d");
+ deallog << "Testing 1D data" << std::endl;
table_1.add_value("n_cells", 16);
table_1.add_value("error", 4.841e-04);
table_1.add_value("n_cells", 24);
table_1.add_value("n_cells", 128);
table_1.add_value("error", 9.597e-07);
table_1.set_scientific("error", true);
- //table_1.evaluate_convergence_rates("error", "n_cells", ConvergenceTable::reduction_rate);
+ table_1.evaluate_convergence_rates("error", "n_cells", ConvergenceTable::reduction_rate);
table_1.evaluate_convergence_rates("error", "n_cells", ConvergenceTable::reduction_rate_log2, 1);
table_1.write_text(deallog.get_file_stream());
- deallog.pop();
- deallog.push("2d");
+ deallog << std::endl << "Testing 2d data" << std::endl;
table_2.add_value("n_cells", 64);
table_2.add_value("error", 7.755e-03);
table_2.add_value("n_cells", 144);
table_2.add_value("n_cells", 4096);
table_2.add_value("error", 1.587e-05);
table_2.set_scientific("error", true);
- //table_2.evaluate_convergence_rates("error", "n_cells", ConvergenceTable::reduction_rate);
+ table_2.evaluate_convergence_rates("error", "n_cells", ConvergenceTable::reduction_rate);
table_2.evaluate_convergence_rates("error", "n_cells", ConvergenceTable::reduction_rate_log2, 2);
table_2.write_text(deallog.get_file_stream());
- deallog.pop();
- deallog.push("3d");
+ deallog << std::endl << "Testing 3d data" << std::endl;
table_3.add_value("n_cells", 512);
table_3.add_value("error", 5.791e-02);
table_3.add_value("n_cells", 1728);
table_3.add_value("n_cells", 262144);
table_3.add_value("error", 9.275e-04);
table_3.set_scientific("error", true);
- //table_3.evaluate_convergence_rates("error", "n_cells", ConvergenceTable::reduction_rate);
+ table_3.evaluate_convergence_rates("error", "n_cells", ConvergenceTable::reduction_rate);
table_3.evaluate_convergence_rates("error", "n_cells", ConvergenceTable::reduction_rate_log2, 3);
table_3.write_text(deallog.get_file_stream());
- deallog.pop();
}