const unsigned int n_u = dofs_per_block[0],
n_p = dofs_per_block[1];
- std::cout << " Number of active cells: "
- << triangulation.n_active_cells()
- << std::endl
- << " Number of degrees of freedom: "
- << dof_handler.n_dofs()
- << " (" << n_u << '+' << n_p << ')'
- << std::endl;
+ deallog << " Number of active cells: "
+ << triangulation.n_active_cells()
+ << std::endl
+ << " Number of degrees of freedom: "
+ << dof_handler.n_dofs()
+ << " (" << n_u << '+' << n_p << ')'
+ << std::endl;
{
BlockCompressedSimpleSparsityPattern csp (2,2);
local_dof_indices,
system_matrix, system_rhs);
}
-
- std::cout << " Computing preconditioner..." << std::endl << std::flush;
-
+
A_preconditioner
= std_cxx1x::shared_ptr<typename InnerPreconditioner<dim>::type>(new
typename InnerPreconditioner<dim>::type());
constraints.distribute (solution);
- std::cout << " "
- << solver_control.last_step()
- << " outer CG Schur complement iterations for pressure"
- << std::endl;
-
}
{
sqrt(difference_per_cell.mean_value()*n_active_cells);
divergence_velocity(solution, difference_per_cell, quadrature, false);
- std::cout<<"maximum divergence per cell: "
- <<difference_per_cell.linfty_norm()<<std::endl;
+// std::cout<<"maximum divergence per cell: "
+// <<difference_per_cell.linfty_norm()<<std::endl;
//int_\Omega (f(x)-c)^2 dx is minimized for c=1/|\Omega|\int_\Omega f(x)dx.
//That gives \int_\Omega f(x)^2 dx - 1/|\Omega|(\int_\Omega f(x) dx)^2
double L2_error_pressure = difference_per_cell.l2_norm() *
difference_per_cell.l2_norm();
- std::cout<<"l2 difference "<<L2_error_pressure<<std::endl;
+// std::cout<<"l2 difference "<<L2_error_pressure<<std::endl;
VectorTools::integrate_difference (dof_handler, solution, exactsolution,
difference_per_cell, quadrature,
VectorTools::mean,&pressure_mask);
double integral = difference_per_cell.mean_value()*n_active_cells;
- std::cout<<"mean difference "<<integral *integral<<std::endl;
+ //std::cout<<"mean difference "<<integral *integral<<std::endl;
L2_error_pressure -= integral*integral;
- std::cout<<"Pressure error squared: "<<L2_error_pressure<<std::endl;
+// std::cout<<"Pressure error squared: "<<L2_error_pressure<<std::endl;
L2_error_pressure = (L2_error_pressure>0)?sqrt(L2_error_pressure):0;
/*Vector<double> difference(dim+1);
for (unsigned int refinement_cycle = 0; refinement_cycle<5;
++refinement_cycle)
{
- std::cout << "Refinement cycle " << refinement_cycle << std::endl;
+ deallog << "Refinement cycle " << refinement_cycle << std::endl;
if (refinement_cycle > 0)
triangulation.refine_global(1);
setup_dofs ();
- std::cout << " Assembling..." << std::endl << std::flush;
assemble_system ();
- std::cout << " Solving..." << std::flush;
solve ();
output_results (refinement_cycle);
- std::cout << std::endl;
+ deallog << std::endl;
}
- convergence_table.set_precision("L2_v", 3);
- convergence_table.set_precision("H1_v", 3);
- convergence_table.set_precision("Linfty_v", 3);
- convergence_table.set_precision("L2_div_v", 3);
- convergence_table.set_precision("L2_p", 3);
- convergence_table.set_precision("H1_p", 3);
- convergence_table.set_precision("Linfty_p", 3);
+ convergence_table.set_precision("L2_v", 7);
+ convergence_table.set_precision("H1_v", 7);
+ convergence_table.set_precision("Linfty_v", 7);
+ convergence_table.set_precision("L2_div_v", 7);
+ convergence_table.set_precision("L2_p", 7);
+ convergence_table.set_precision("H1_p", 7);
+ convergence_table.set_precision("Linfty_p", 7);
convergence_table.set_scientific("L2_v", true);
convergence_table.set_scientific("H1_v", true);
//convergence_table.write_text(std::cout);
- std::ostringstream error_filename;
- error_filename << "error-"
- << Utilities::int_to_string (degree, 1)
- << ".tex";
- std::ofstream error_table_file(error_filename.str().c_str());
- //convergence_table.write_tex(error_table_file);
-
-
convergence_table.add_column_to_supercolumn("cycle", "n cells");
convergence_table.add_column_to_supercolumn("cells", "n cells");
DEAL::FESystem<2>[FE_Q<2>(2)^2-FE_Q<2>(1)]:
-n cells L2_v H1_v L2_div_v L2_p H1_p
-0 4 1.026e-02 - 1.188e-01 - 1.134e-01 - 2.512e-01 - 1.522e+00 -
-1 16 4.852e-03 1.08 9.199e-02 0.37 9.664e-02 0.23 1.891e-01 0.41 1.904e+00 -0.32
-2 64 1.820e-03 1.41 6.625e-02 0.47 9.883e-02 -0.03 1.343e-01 0.49 2.623e+00 -0.46
-3 256 6.537e-04 1.48 4.717e-02 0.49 1.556e-01 -0.65 9.498e-02 0.50 3.715e+00 -0.50
-4 1024 2.329e-04 1.49 3.347e-02 0.50 2.986e-01 -0.94 6.716e-02 0.50 5.259e+00 -0.50
+DEAL::Refinement cycle 0
+DEAL:: Number of active cells: 4
+DEAL:: Number of degrees of freedom: 59 (50+9)
+DEAL::
+DEAL::Refinement cycle 1
+DEAL:: Number of active cells: 16
+DEAL:: Number of degrees of freedom: 187 (162+25)
+DEAL::
+DEAL::Refinement cycle 2
+DEAL:: Number of active cells: 64
+DEAL:: Number of degrees of freedom: 659 (578+81)
+DEAL::
+DEAL::Refinement cycle 3
+DEAL:: Number of active cells: 256
+DEAL:: Number of degrees of freedom: 2467 (2178+289)
+DEAL::
+DEAL::Refinement cycle 4
+DEAL:: Number of active cells: 1024
+DEAL:: Number of degrees of freedom: 9539 (8450+1089)
+DEAL::
+n cells L2_v H1_v L2_div_v L2_p H1_p
+0 4 1.0257488e-02 - 1.1883360e-01 - 1.1337000e-01 - 2.5116928e-01 - 1.5218145e+00 -
+1 16 4.8522305e-03 1.08 9.1987033e-02 0.37 9.6638713e-02 0.23 1.8908324e-01 0.41 1.9035333e+00 -0.32
+2 64 1.8197991e-03 1.41 6.6247791e-02 0.47 9.8831135e-02 -0.03 1.3433002e-01 0.49 2.6232196e+00 -0.46
+3 256 6.5368424e-04 1.48 4.7166223e-02 0.49 1.5559425e-01 -0.65 9.4982115e-02 0.50 3.7148898e+00 -0.50
+4 1024 2.3288692e-04 1.49 3.3465911e-02 0.50 2.9862359e-01 -0.94 6.7161411e-02 0.50 5.2588584e+00 -0.50
DEAL::FESystem<2>[FE_Q<2>(2)^2-FE_Q_DG0<2>(1)]:
-n cells L2_v H1_v L2_div_v L2_p H1_p
-0 4 1.267e-03 - 1.783e-02 - 1.017e-02 - 2.085e-02 - 3.231e-01 -
-1 16 1.714e-04 2.89 4.500e-03 1.99 2.991e-03 1.77 5.231e-03 2.00 1.616e-01 1.00
-2 64 2.151e-05 2.99 1.118e-03 2.01 7.756e-04 1.95 1.304e-03 2.00 8.076e-02 1.00
-3 256 2.687e-06 3.00 2.787e-04 2.00 1.960e-04 1.98 3.258e-04 2.00 4.038e-02 1.00
-4 1024 3.357e-07 3.00 6.962e-05 2.00 4.916e-05 2.00 8.146e-05 2.00 2.019e-02 1.00
+DEAL::Refinement cycle 0
+DEAL:: Number of active cells: 4
+DEAL:: Number of degrees of freedom: 63 (50+13)
+DEAL::
+DEAL::Refinement cycle 1
+DEAL:: Number of active cells: 16
+DEAL:: Number of degrees of freedom: 203 (162+41)
+DEAL::
+DEAL::Refinement cycle 2
+DEAL:: Number of active cells: 64
+DEAL:: Number of degrees of freedom: 723 (578+145)
+DEAL::
+DEAL::Refinement cycle 3
+DEAL:: Number of active cells: 256
+DEAL:: Number of degrees of freedom: 2723 (2178+545)
+DEAL::
+DEAL::Refinement cycle 4
+DEAL:: Number of active cells: 1024
+DEAL:: Number of degrees of freedom: 10563 (8450+2113)
+DEAL::
+n cells L2_v H1_v L2_div_v L2_p H1_p
+0 4 1.2669802e-03 - 1.7833656e-02 - 1.0174479e-02 - 2.0853699e-02 - 3.2308487e-01 -
+1 16 1.7136052e-04 2.89 4.5004000e-03 1.99 2.9910109e-03 1.77 5.2310087e-03 2.00 1.6162048e-01 1.00
+2 64 2.1513009e-05 2.99 1.1176338e-03 2.01 7.7557764e-04 1.95 1.3036806e-03 2.00 8.0764333e-02 1.00
+3 256 2.6866587e-06 3.00 2.7868736e-04 2.00 1.9603406e-04 1.98 3.2582672e-04 2.00 4.0380841e-02 1.00
+4 1024 3.3567195e-07 3.00 6.9618561e-05 2.00 4.9160007e-05 2.00 8.1455303e-05 2.00 2.0190410e-02 1.00
DEAL::FESystem<2>[FE_Q<2>(3)^2-FE_Q_DG0<2>(2)]:
-n cells L2_v H1_v L2_div_v L2_p H1_p
-0 4 1.002e-04 - 1.968e-03 - 1.795e-03 - 3.744e-04 - 7.466e-03 -
-1 16 6.154e-06 4.03 2.351e-04 3.07 2.281e-04 2.98 3.963e-05 3.24 1.990e-03 1.91
-2 64 3.815e-07 4.01 2.898e-05 3.02 2.872e-05 2.99 5.187e-06 2.93 5.144e-04 1.95
-3 256 2.378e-08 4.00 3.609e-06 3.01 3.600e-06 3.00 6.610e-07 2.97 1.295e-04 1.99
-4 1024 1.486e-09 4.00 4.506e-07 3.00 4.503e-07 3.00 8.372e-08 2.98 3.244e-05 2.00
+DEAL::Refinement cycle 0
+DEAL:: Number of active cells: 4
+DEAL:: Number of degrees of freedom: 127 (98+29)
+DEAL::
+DEAL::Refinement cycle 1
+DEAL:: Number of active cells: 16
+DEAL:: Number of degrees of freedom: 435 (338+97)
+DEAL::
+DEAL::Refinement cycle 2
+DEAL:: Number of active cells: 64
+DEAL:: Number of degrees of freedom: 1603 (1250+353)
+DEAL::
+DEAL::Refinement cycle 3
+DEAL:: Number of active cells: 256
+DEAL:: Number of degrees of freedom: 6147 (4802+1345)
+DEAL::
+DEAL::Refinement cycle 4
+DEAL:: Number of active cells: 1024
+DEAL:: Number of degrees of freedom: 24067 (18818+5249)
+DEAL::
+n cells L2_v H1_v L2_div_v L2_p H1_p
+0 4 1.0024825e-04 - 1.9676696e-03 - 1.7954006e-03 - 3.7443638e-04 - 7.4657791e-03 -
+1 16 6.1542285e-06 4.03 2.3506098e-04 3.07 2.2807300e-04 2.98 3.9633661e-05 3.24 1.9896142e-03 1.91
+2 64 3.8154455e-07 4.01 2.8980997e-05 3.02 2.8723650e-05 2.99 5.1867039e-06 2.93 5.1437322e-04 1.95
+3 256 2.3776559e-08 4.00 3.6087283e-06 3.01 3.5998645e-06 3.00 6.6100550e-07 2.97 1.2946585e-04 1.99
+4 1024 1.4860041e-09 4.00 4.5064861e-07 3.00 4.5034351e-07 3.00 8.3715487e-08 2.98 3.2442505e-05 2.00