Hi You are finding maximum at the quadrature points of QGauss(2).
When solution is saved, it is evaluated at uniformly distributed points by build_patches. So the two values may differ. To get same values as in your visualization, you can use a QTrapez and QIterated. This combination is explained for example in step-20. Best praveen On Sun, Nov 6, 2016 at 6:02 PM, <[email protected]> wrote: > Hi all, > > I made the function to get maximum value of solution. > > template <int dim> > void Step6<dim>::get_max_sol() > { > const QGauss<dim> quadrature_formula(2); > FEValues<dim> fe_values (fe, quadrature_formula, > update_values | update_quadrature_points); > > const unsigned int n_q_points = quadrature_formula.size(); > std::vector<double> sol_tmp(n_q_points); > > typename DoFHandler<dim>::active_cell_iterator > cell = dof_handler.begin_active(), > endc = dof_handler.end(); > max_sol=0; > //by Han(To get psi0) > for (; cell!=endc; ++cell) > { > fe_values.reinit (cell); > fe_values.get_function_values(solution,sol_tmp); > for (unsigned int q_index=0; q_index<n_q_points; ++q_index) > { > if(sol_tmp[q_index]>max_sol) > { > max_sol=sol_tmp[q_index]; > } > } > > } > } > > But, It seems that the maximum value is wrong. > > Because, When I print max_sol, the value of it is 0.0502666 > > But, In the picture I attached the maximum value is 0.05123 > > the two values are slightly different. > > So, is it impossible to get maximum value of solution?? > > Or, Did I do anything wrong? > > Thank you. > > Kyusik. > > -- > 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 [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
