From: Wolfgang Bangerth Date: Wed, 8 Apr 1998 13:20:16 +0000 (+0000) Subject: Clean out computation of errors (put into a new test case). X-Git-Tag: v8.0.0~23094 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c26676599d4a95b7998d365979fe56b173e8b514;p=dealii.git Clean out computation of errors (put into a new test case). git-svn-id: https://svn.dealii.org/trunk@160 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/Attic/examples/poisson/problem.cc b/deal.II/deal.II/Attic/examples/poisson/problem.cc index 6bf93f118f..93b15092da 100644 --- a/deal.II/deal.II/Attic/examples/poisson/problem.cc +++ b/deal.II/deal.II/Attic/examples/poisson/problem.cc @@ -85,18 +85,6 @@ class RHSPoly : public Function { -template -class Solution : public Function { - public: - /** - * Return the value of the function - * at the given point. - */ - virtual double operator () (const Point &p) const; -}; - - - @@ -159,15 +147,6 @@ double RHSPoly::operator () (const Point &p) const { }; -template -double Solution::operator () (const Point &p) const { - double ret_val = 1; - for (unsigned int i=0; i::run (ParameterHandler &prm) { cout << " Writing to file <" << prm.get("Output file") << ">..." << endl; - Solution sol; - dVector l1_error_per_cell, l2_error_per_cell, linfty_error_per_cell; - QGauss4 q; - - cout << " Calculating L1 error... "; - integrate_difference (sol, l1_error_per_cell, q, fe, L1_norm); - cout << l1_error_per_cell.l1_norm() << endl; - - cout << " Calculating L2 error... "; - integrate_difference (sol, l2_error_per_cell, q, fe, L2_norm); - cout << l2_error_per_cell.l2_norm() << endl; - - cout << " Calculating L-infinity error... "; - integrate_difference (sol, linfty_error_per_cell, q, fe, Linfty_norm); - cout << linfty_error_per_cell.linfty_norm() << endl; - - dVector l1_error_per_dof, l2_error_per_dof, linfty_error_per_dof; - dof->distribute_cell_to_dof_vector (l1_error_per_cell, l1_error_per_dof); - dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof); - dof->distribute_cell_to_dof_vector (linfty_error_per_cell, linfty_error_per_dof); - DataOut out; String o_filename = prm.get ("Output file"); ofstream gnuplot(o_filename); fill_data (out); - out.add_data_vector (l1_error_per_dof, "L1-Error"); - out.add_data_vector (l2_error_per_dof, "L2-Error"); - out.add_data_vector (linfty_error_per_dof, "L3-Error"); out.write_gnuplot (gnuplot); gnuplot.close (); - cout << "Errors: " - << dof->n_dofs() << " " - << l1_error_per_cell.l1_norm() << " " - << l2_error_per_cell.l2_norm() << " " - << linfty_error_per_cell.linfty_norm() << endl; - - - cout << endl; }; diff --git a/tests/big-tests/poisson/problem.cc b/tests/big-tests/poisson/problem.cc index 6bf93f118f..93b15092da 100644 --- a/tests/big-tests/poisson/problem.cc +++ b/tests/big-tests/poisson/problem.cc @@ -85,18 +85,6 @@ class RHSPoly : public Function { -template -class Solution : public Function { - public: - /** - * Return the value of the function - * at the given point. - */ - virtual double operator () (const Point &p) const; -}; - - - @@ -159,15 +147,6 @@ double RHSPoly::operator () (const Point &p) const { }; -template -double Solution::operator () (const Point &p) const { - double ret_val = 1; - for (unsigned int i=0; i::run (ParameterHandler &prm) { cout << " Writing to file <" << prm.get("Output file") << ">..." << endl; - Solution sol; - dVector l1_error_per_cell, l2_error_per_cell, linfty_error_per_cell; - QGauss4 q; - - cout << " Calculating L1 error... "; - integrate_difference (sol, l1_error_per_cell, q, fe, L1_norm); - cout << l1_error_per_cell.l1_norm() << endl; - - cout << " Calculating L2 error... "; - integrate_difference (sol, l2_error_per_cell, q, fe, L2_norm); - cout << l2_error_per_cell.l2_norm() << endl; - - cout << " Calculating L-infinity error... "; - integrate_difference (sol, linfty_error_per_cell, q, fe, Linfty_norm); - cout << linfty_error_per_cell.linfty_norm() << endl; - - dVector l1_error_per_dof, l2_error_per_dof, linfty_error_per_dof; - dof->distribute_cell_to_dof_vector (l1_error_per_cell, l1_error_per_dof); - dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof); - dof->distribute_cell_to_dof_vector (linfty_error_per_cell, linfty_error_per_dof); - DataOut out; String o_filename = prm.get ("Output file"); ofstream gnuplot(o_filename); fill_data (out); - out.add_data_vector (l1_error_per_dof, "L1-Error"); - out.add_data_vector (l2_error_per_dof, "L2-Error"); - out.add_data_vector (linfty_error_per_dof, "L3-Error"); out.write_gnuplot (gnuplot); gnuplot.close (); - cout << "Errors: " - << dof->n_dofs() << " " - << l1_error_per_cell.l1_norm() << " " - << l2_error_per_cell.l2_norm() << " " - << linfty_error_per_cell.linfty_norm() << endl; - - - cout << endl; };