1 #ifndef _pf_verification_h_
2 #define _pf_verification_h_
5 void Phaseflow<dim>::append_verification_table()
7 assert(this->params.verification.enabled);
9 Vector<float> difference_per_cell(triangulation.n_active_cells());
11 VectorTools::integrate_difference(
14 this->exact_solution_function,
17 VectorTools::L2_norm);
19 double L2_norm_error = difference_per_cell.l2_norm();
21 VectorTools::integrate_difference(
24 this->exact_solution_function,
27 VectorTools::L1_norm);
29 double L1_norm_error = difference_per_cell.l1_norm();
31 this->verification_table.add_value(
"cells", this->triangulation.n_active_cells());
32 this->verification_table.add_value(
"dofs", this->dof_handler.n_dofs());
33 this->verification_table.add_value(
"L1_norm_error", L1_norm_error);
34 this->verification_table.add_value(
"L2_norm_error", L2_norm_error);
39 void Phaseflow<dim>::write_verification_table()
41 const int precision = 14;
43 this->verification_table.set_precision(
"cells", precision);
44 this->verification_table.set_scientific(
"cells",
true);
46 this->verification_table.set_precision(
"dofs", precision);
47 this->verification_table.set_scientific(
"dofs",
true);
49 this->verification_table.set_precision(
"L2_norm_error", precision);
50 this->verification_table.set_scientific(
"L2_norm_error",
true);
52 this->verification_table.set_precision(
"L1_norm_error", precision);
53 this->verification_table.set_scientific(
"L1_norm_error",
true);
55 std::ofstream out_file(this->verification_table_file_name, std::fstream::app);
56 assert(out_file.good());
57 this->verification_table.write_text(out_file);