From: Wolfgang Bangerth Date: Mon, 6 Apr 1998 17:33:00 +0000 (+0000) Subject: Example update. X-Git-Tag: v8.0.0~23104 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=978dfee739649dd3cc32f19561f070e9a8249a09;p=dealii.git Example update. git-svn-id: https://svn.dealii.org/trunk@150 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 b33cf6f708..917884bae5 100644 --- a/deal.II/deal.II/Attic/examples/poisson/problem.cc +++ b/deal.II/deal.II/Attic/examples/poisson/problem.cc @@ -161,7 +161,7 @@ double RHSPoly::operator () (const Point &p) const { template double Solution::operator () (const Point &p) const { - double ret_val = 0; + double ret_val = 1; for (unsigned int i=0; i::run (ParameterHandler &prm) { cout << " Writing to file <" << prm.get("Output file") << ">..." << endl; - DataOut out; - String o_filename = prm.get ("Output file"); - ofstream gnuplot(o_filename); - fill_data (out); - out.write_gnuplot (gnuplot); - gnuplot.close (); - cout << " Calculation L2 error... "; Solution sol; vector difference; QGauss3 q; integrate_difference (sol, difference, q, fe, L2_norm); - double error = 0; + double error = 0.; for (unsigned int i=0; idistribute_cell_to_dof_vector (difference, error_per_dof); + + DataOut out; + String o_filename = prm.get ("Output file"); + ofstream gnuplot(o_filename); + fill_data (out); + out.add_data_vector (error_per_dof, "Error"); + out.write_gnuplot (gnuplot); + gnuplot.close (); + cout << endl; }; diff --git a/tests/big-tests/poisson/problem.cc b/tests/big-tests/poisson/problem.cc index b33cf6f708..917884bae5 100644 --- a/tests/big-tests/poisson/problem.cc +++ b/tests/big-tests/poisson/problem.cc @@ -161,7 +161,7 @@ double RHSPoly::operator () (const Point &p) const { template double Solution::operator () (const Point &p) const { - double ret_val = 0; + double ret_val = 1; for (unsigned int i=0; i::run (ParameterHandler &prm) { cout << " Writing to file <" << prm.get("Output file") << ">..." << endl; - DataOut out; - String o_filename = prm.get ("Output file"); - ofstream gnuplot(o_filename); - fill_data (out); - out.write_gnuplot (gnuplot); - gnuplot.close (); - cout << " Calculation L2 error... "; Solution sol; vector difference; QGauss3 q; integrate_difference (sol, difference, q, fe, L2_norm); - double error = 0; + double error = 0.; for (unsigned int i=0; idistribute_cell_to_dof_vector (difference, error_per_dof); + + DataOut out; + String o_filename = prm.get ("Output file"); + ofstream gnuplot(o_filename); + fill_data (out); + out.add_data_vector (error_per_dof, "Error"); + out.write_gnuplot (gnuplot); + gnuplot.close (); + cout << endl; };