From 95797eca962d1ebe09991e976229e2b792f7c3c0 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 5 May 1998 08:52:01 +0000 Subject: [PATCH] Example update. git-svn-id: https://svn.dealii.org/trunk@246 0785d39b-7218-0410-832d-ea1e28bc413d --- .../error-estimation/error-estimation.cc | 27 ++++++++++--------- .../error-estimation/error-estimation.cc | 27 ++++++++++--------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc b/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc index c530fc2001..6c5813ac3c 100644 --- a/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc +++ b/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc @@ -279,7 +279,7 @@ void PoissonProblem::run (const unsigned int start_level, QGauss3 quadrature; unsigned int refine_step = 0; - while (tria->n_active_cells() < 5000) + while (tria->n_active_cells() < 6000) { cout << "Refinement step " << refine_step << ", using " << tria->n_active_cells() << " active cells." @@ -323,10 +323,11 @@ void PoissonProblem::run (const unsigned int start_level, cout << " Estimating H1 error... "; KellyErrorEstimator ee; QSimpson eq; -// ee.estimate_error (*dof, eq, fe, boundary, -// KellyErrorEstimator::FunctionMap(), -// solution, -// estimated_error_per_cell); +// + ee.estimate_error (*dof, eq, fe, boundary, + KellyErrorEstimator::FunctionMap(), + solution, + estimated_error_per_cell); cout << estimated_error_per_cell.l2_norm() << endl; estimated_error.push_back (estimated_error_per_cell.l2_norm()); @@ -336,8 +337,9 @@ void PoissonProblem::run (const unsigned int start_level, dof->distribute_cell_to_dof_vector (linfty_error_per_cell, linfty_error_per_dof); dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof); -// dof->distribute_cell_to_dof_vector (estimated_error_per_cell, -// estimated_error_per_dof); +// + dof->distribute_cell_to_dof_vector (estimated_error_per_cell, + estimated_error_per_dof); DataOut out; @@ -345,9 +347,10 @@ void PoissonProblem::run (const unsigned int start_level, out.add_data_vector (l2_error_per_dof, "L2-Error"); out.add_data_vector (linfty_error_per_dof, "Linfty-Error"); out.add_data_vector (h1_error_per_dof, "H1-Error"); -// out.add_data_vector (estimated_error_per_dof, "Estimated Error"); - string filename = "gnuplot."; -// string filename = "ee."; +// + out.add_data_vector (estimated_error_per_dof, "Estimated Error"); +// string filename = "gnuplot."; + string filename = "ee."; switch (refine_mode) { case global: @@ -387,11 +390,11 @@ void PoissonProblem::run (const unsigned int start_level, break; }; cout << endl << endl; - cout << endl; ++refine_step; }; print_history (refine_mode); + cout << endl << endl << endl; }; @@ -459,7 +462,7 @@ int main () { PoissonProblem<2> problem; problem.run (2, PoissonProblem<2>::global); - problem.run (2, PoissonProblem<2>::true_error); +// problem.run (2, PoissonProblem<2>::true_error); return 0; }; diff --git a/tests/big-tests/error-estimation/error-estimation.cc b/tests/big-tests/error-estimation/error-estimation.cc index c530fc2001..6c5813ac3c 100644 --- a/tests/big-tests/error-estimation/error-estimation.cc +++ b/tests/big-tests/error-estimation/error-estimation.cc @@ -279,7 +279,7 @@ void PoissonProblem::run (const unsigned int start_level, QGauss3 quadrature; unsigned int refine_step = 0; - while (tria->n_active_cells() < 5000) + while (tria->n_active_cells() < 6000) { cout << "Refinement step " << refine_step << ", using " << tria->n_active_cells() << " active cells." @@ -323,10 +323,11 @@ void PoissonProblem::run (const unsigned int start_level, cout << " Estimating H1 error... "; KellyErrorEstimator ee; QSimpson eq; -// ee.estimate_error (*dof, eq, fe, boundary, -// KellyErrorEstimator::FunctionMap(), -// solution, -// estimated_error_per_cell); +// + ee.estimate_error (*dof, eq, fe, boundary, + KellyErrorEstimator::FunctionMap(), + solution, + estimated_error_per_cell); cout << estimated_error_per_cell.l2_norm() << endl; estimated_error.push_back (estimated_error_per_cell.l2_norm()); @@ -336,8 +337,9 @@ void PoissonProblem::run (const unsigned int start_level, dof->distribute_cell_to_dof_vector (linfty_error_per_cell, linfty_error_per_dof); dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof); -// dof->distribute_cell_to_dof_vector (estimated_error_per_cell, -// estimated_error_per_dof); +// + dof->distribute_cell_to_dof_vector (estimated_error_per_cell, + estimated_error_per_dof); DataOut out; @@ -345,9 +347,10 @@ void PoissonProblem::run (const unsigned int start_level, out.add_data_vector (l2_error_per_dof, "L2-Error"); out.add_data_vector (linfty_error_per_dof, "Linfty-Error"); out.add_data_vector (h1_error_per_dof, "H1-Error"); -// out.add_data_vector (estimated_error_per_dof, "Estimated Error"); - string filename = "gnuplot."; -// string filename = "ee."; +// + out.add_data_vector (estimated_error_per_dof, "Estimated Error"); +// string filename = "gnuplot."; + string filename = "ee."; switch (refine_mode) { case global: @@ -387,11 +390,11 @@ void PoissonProblem::run (const unsigned int start_level, break; }; cout << endl << endl; - cout << endl; ++refine_step; }; print_history (refine_mode); + cout << endl << endl << endl; }; @@ -459,7 +462,7 @@ int main () { PoissonProblem<2> problem; problem.run (2, PoissonProblem<2>::global); - problem.run (2, PoissonProblem<2>::true_error); +// problem.run (2, PoissonProblem<2>::true_error); return 0; }; -- 2.39.5