From 978dfee739649dd3cc32f19561f070e9a8249a09 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 6 Apr 1998 17:33:00 +0000 Subject: [PATCH] Example update. git-svn-id: https://svn.dealii.org/trunk@150 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/Attic/examples/poisson/problem.cc | 25 +++++++++++-------- tests/big-tests/poisson/problem.cc | 25 +++++++++++-------- 2 files changed, 30 insertions(+), 20 deletions(-) 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; }; -- 2.39.5