How would I use the function get_function_gradients_from_local_dof_values with a vector_extractor? When trying to compile it with the vector shown above (including changing the first value) it fails with a rather long list of template errors. Thanks!
Am Freitag, 25. August 2017 09:51:37 UTC+2 schrieb Jean-Paul Pelteret: > > I suspect that this can be written even more concisely with the current >> development version of deal.II. For example, I'm pretty sure you can >> write >> >> std::vector<Tensor<1,dim,>Sacado::Fad::DFad<double>> >> grad_u (n_q_points); >> >> fe_values.get_function_gradients (solution, grad_u); >> >> or something similar in place of what you do in lines 199, 207-217. >> > > Yes, we now have the functions get_function_*_from_local_dof_values() > <https://www.dealii.org/developer/doxygen/deal.II/classFEValuesViews_1_1Scalar.html#ae4a27051cae75448f41cbf2f3a269d6e> > > in the FEValuesView classes, which can definitely help in this scenario. > One would use them in the following way: > > std::vector<double> local_dof_values(cell->get_fe().dofs_per_cell); > cell->get_dof_values(solution, local_dof_values.begin(), local_dof_values. > end()); > std::vector<Sacado::Fad::DFad<double>> local_dof_values_AD(cell->get_fe(). > dofs_per_cell); > > // ... Setup local_dof_values_AD using local_dof_values, as is done in > step-33 ... > > std::vector<Tensor<1,dim,Sacado::Fad::DFad<double>>> qp_gradients_AD ( > n_q_points_cell); > fe_values[scalar_extractor].get_function_gradients_from_local_dof_values( > local_dof_values_AD, qp_gradients_AD); > // ... use qp_gradients_AD ... > > > Regards, > Jean-Paul > -- 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.