From 3891c0dbeda1e09dbde7ea4713f521f34c809a67 Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 5 Aug 2011 20:19:50 +0000 Subject: [PATCH] Also output the error. git-svn-id: https://svn.dealii.org/trunk@24024 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-47/step-47.cc | 37 +++++++++++++++++++---------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/deal.II/examples/step-47/step-47.cc b/deal.II/examples/step-47/step-47.cc index 981905e091..e2b2826546 100644 --- a/deal.II/examples/step-47/step-47.cc +++ b/deal.II/examples/step-47/step-47.cc @@ -157,6 +157,18 @@ void Coefficient::value_list (const std::vector > &points, +template +double exact_solution (const Point &p) +{ + const double r = p.norm(); + + return (r < 0.5 + ? + 1./20 * (-1./4*r*r + 61./16) + : + 1./4 * (1-r*r)); +} + template LaplaceProblem::LaplaceProblem () @@ -959,6 +971,7 @@ std::vector Postprocessor::get_names() const { std::vector solution_names (1, "total_solution"); + solution_names.push_back ("error"); return solution_names; } @@ -977,7 +990,7 @@ Postprocessor:: get_data_component_interpretation () const { std::vector - interpretation (1, + interpretation (2, DataComponentInterpretation::component_is_scalar); return interpretation; } @@ -1007,10 +1020,16 @@ compute_derived_quantities_vector (const std::vector > Assert (computed_quantities[0].size()==n_output_variables(),ExcInternalError()); for (unsigned int q=0; q::compute_error () const for (unsigned int q=0; q