From dea9be91131e452919d5c1aada3eb2ba808b7a27 Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 17 Dec 2008 15:51:23 +0000 Subject: [PATCH] Use get_function_laplacians for the residual. git-svn-id: https://svn.dealii.org/trunk@17974 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-14/step-14.cc | 32 +++++++++++++---------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/deal.II/examples/step-14/step-14.cc b/deal.II/examples/step-14/step-14.cc index 61573c98b9..6626b0621f 100644 --- a/deal.II/examples/step-14/step-14.cc +++ b/deal.II/examples/step-14/step-14.cc @@ -2447,7 +2447,7 @@ namespace LaplaceSolver std::vector cell_residual; std::vector rhs_values; std::vector dual_weights; - typename std::vector > cell_grad_grads; + std::vector cell_laplacians; CellData (const FiniteElement &fe, const Quadrature &quadrature, const Function &right_hand_side); @@ -2541,20 +2541,16 @@ namespace LaplaceSolver const Function &right_hand_side) : fe_values (fe, quadrature, - update_values | + update_values | update_hessians | - update_quadrature_points | + update_quadrature_points | update_JxW_values), - right_hand_side (&right_hand_side) - { - const unsigned int n_q_points - = quadrature.size(); - - cell_residual.resize(n_q_points); - rhs_values.resize(n_q_points); - dual_weights.resize(n_q_points); - cell_grad_grads.resize(n_q_points); - } + right_hand_side (&right_hand_side), + cell_residual (quadrature.size()), + rhs_values (quadrature.size()), + dual_weights (quadrature.size()), + cell_laplacians (quadrature.size()) + {} @@ -3284,8 +3280,8 @@ namespace LaplaceSolver // The tasks to be done are what // appears natural from looking // at the error estimation - // formula: first compute the the - // right hand side and the + // formula: first get the + // right hand side and // Laplacian of the numerical // solution at the quadrature // points for the cell residual, @@ -3293,8 +3289,8 @@ namespace LaplaceSolver cell_data.right_hand_side ->value_list (cell_data.fe_values.get_quadrature_points(), cell_data.rhs_values); - cell_data.fe_values.get_function_2nd_derivatives (primal_solution, - cell_data.cell_grad_grads); + cell_data.fe_values.get_function_laplacians (primal_solution, + cell_data.cell_laplacians); // ...then get the dual weights... cell_data.fe_values.get_function_values (dual_weights, @@ -3306,7 +3302,7 @@ namespace LaplaceSolver // cell: double sum = 0; for (unsigned int p=0; p