That works ! excellent !! . Thanks a lot, in tons.
On Wednesday, November 16, 2016 at 12:33:22 PM UTC-3, Daniel Arndt wrote: > > Sudarshan, > > template <int dim> >> void Step12<dim>::integrate_cell_term (DoFInfo& dinfo, CellInfo& info) >> { >> const FEValuesBase<dim>& fe_v = info.fe_values(); >> const std::vector<Tensor<1,dim>>& grad = info.gradients[0][0]; >> } >> >> When I call grad[0][0] it gives segmentation fault. >> > It seems that you didn't tell your MeshWorker::IntegrationInfoBox object > that you want to evaluate gradients of a finite element function on a cell. > To do this, you would use something similar to: > > MeshWorker::IntegrationInfoBox<dim> info_box; > const unsigned int n_gauss_points = dof_handler.get_fe().degree+1; > info_box.initialize_gauss_quadrature(n_gauss_points, n_gauss_points, > n_gauss_points); > info_box.initialize_update_flags(); > dealii::UpdateFlags update_flags = ... > info_box.add_update_flags_all(update_flags); > info_box.cell_selector.add("solution", /*values*/ false, /*gradients*/ > true, /*hessians*/ false); > > dealii::AnyData src_data ; > src_data.add<const Vector<double> *>(&solution,"solution"); > info_box.initialize(fe,mapping,src_data, solution); > > If this does not solve your problem, it would be great if you come up with > a minimal example showing your problem. > > Best, > Daniel > -- 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.