2016년 10월 5일 수요일 오전 1시 17분 31초 UTC+9, Wolfgang Bangerth 님의 말: > > On 10/04/2016 09:12 AM, hank...@gmail.com <javascript:> wrote: > > > > template <int dim> > > void Step6<dim>::get_profile () > > { > > const QGauss<dim> quadrature_formula(3); > > FEValues<dim> fe_values (fe, quadrature_formula, > > update_values | update_gradients | > > update_quadrature_points | > update_JxW_values); > > const unsigned int dofs_per_cell = fe.dofs_per_cell; > > const unsigned int n_q_points = quadrature_formula.size(); > > > > std::vector<types::global_dof_index> local_dof_indices > (dofs_per_cell); > > > > > > typename DoFHandler<dim>::active_cell_iterator > > cell = dof_handler.begin_active(), > > endc = dof_handler.end(); > > f.reinit (dof_handler.n_dofs()); //f is already declared as private > > like solution > > > > for (; cell!=endc; ++cell) > > { > > fe_values.reinit (cell); > > > > for (unsigned int q_index=0; q_index<n_q_points; ++q_index) > > { > > const Point<dim> &p=fe_values.quadrature_point(q_index); > > > > f[q_index]=p(0)*solution[q_index]+p(1); > > 'solution' is a global vector of the values for each degree of freedom. > But you index it with the quadrature point number. That makes no sense. > > What you need to do is evaluate the solution at the quadrature points. > This is done using the > FEValues::get_function_values() > function. Several example programs use it, so you will find use cases > there. > > Best > W. > > -- > ------------------------------------------------------------------------ > Wolfgang Bangerth email: bang...@colostate.edu > <javascript:> > www: http://www.math.colostate.edu/~bangerth/ >
First of all, Thank you very much indeed for your kind reply. I'm sorry to have bothered you... But, Could I have one more question...?? In your lecture 31.65, you used the gradient of previous solution in the assemble_system() by using of previous_solution_gradient[q_index]. So,like you used previous_solution_gradient[q_index], I also wanted to use previous_solution[q_index] in the assemble_system() But, according to what you mentioned above, what I have done with previous_solution[q_index] is wrong....(Because previous_solution is declared as global vector like solution) So, my question is that If I want to use previous solution in the assemble_system, Do I have to use FEValues::get_function_values() not previous_solution[ ] that is global vector? 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 dealii+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.