You are right. I only need values or grad values at the quadrature points. Thanks a lot.
--Junchao Zhang On Fri, Jul 22, 2016 at 6:52 PM, Wolfgang Bangerth <bange...@tamu.edu> wrote: > On 07/22/2016 05:10 PM, Junchao Zhang wrote: > >> In matrix assembly, I need to access solution values of the previous >> time-step at DoFs of the current cell. Is my following code correct? I >> could >> not find an example. Thanks. >> >> std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell); >> ... >> for(; cell!=endc; ++cell) { >> if (cell->is_locally_owned()) { >> cell->get_dof_indices (local_dof_indices); >> fe_values.reinit (cell); >> ... += old_locally_relevant_solution(local_dof_indices[i]); >> } >> } >> > > No. You typically need to access the old solution at *quadrature points*, > not at the node points. You can find how this is typically done in many > tutorial programs, e.g., in steps 21, 26, 15. To evaluate a solution at the > quadrature points, you'll have to do something like > fe_values.get_function_values (old_solution, > old_solution_values); > > Best > W. > > -- > ------------------------------------------------------------------------ > Wolfgang Bangerth email: bange...@math.tamu.edu > www: http://www.math.tamu.edu/~bangerth/ > > -- > 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 a topic in the > Google Groups "deal.II User Group" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/dealii/Adn9T1mrT2M/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > dealii+unsubscr...@googlegroups.com. > 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 dealii+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.