Thank you for all the repliers! All of you gave me a good advice that I may consider deeply when I write my code from now I have figured out what was wrong. Seeing at Step 20 code, I realized that I have to select component of solution before going to compare the difference.
const ComponentSelectFunction<dim> pressure_mask (dim, dim+1); const ComponentSelectFunction<dim> velocity_mask(std::make_pair(0, dim), dim+1); Solution<dim> exact_solution; Vector<double> cellwise_errors (triangulation.n_active_cells()); QTrapez<1> q_trapez; QIterated<dim> quadrature (q_trapez, degree+2); // With this, we can then let the library compute the errors and output // them to the screen: VectorTools::integrate_difference (dof_handler, solution, exact_solution, cellwise_errors, quadrature, VectorTools::L2_norm, &pressure_mask); const double p_l2_error = cellwise_errors.l2_norm(); VectorTools::integrate_difference (dof_handler, solution, exact_solution, cellwise_errors, quadrature, VectorTools::L2_norm, &velocity_mask); const double u_l2_error = cellwise_errors.l2_norm(); -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.