Just to make sure that I chose a reasonable approach:
//create FEValues object whenever I need it, that is,
'number_of_cells*number_of_qps_per_cell' times
FEValues<2> fe_values(dof_handler.get_fe(),
Quadrature<2>(my_point_in_ref_coords),
update_gradients);
fe_values.reinit(cell);
//evaluate, say, the gradient of the second shape function in real coords
at "my_point_in_ref_coords"
Tensor<1,2> shape_gradient_real_second = fe_values.shape_grad(1, 0);
Without measuring the time but based on your intuition - the approach using
FEPointEvaluation would not be much faster, would it?
Best
Simon
Am Do., 7. Juli 2022 um 03:45 Uhr schrieb Wolfgang Bangerth <
[email protected]>:
> On 7/5/22 09:28, Simon Wiesheier wrote:
> >
> > What is the approach to achieve this?
> > My only idea is to create a new FEValues object for each quadrature
> point and
> > pass an appropriate Quadrature object. But seems to be very inefficient.
>
> This is basically what the VectorTools::point_value() and
> VectorTools::point_gradient() functions do. You might want to read through
> their implementations to see how this is done.
>
> The only other approach is with classes like FEPointEvaluation. If you
> read
> through their implementation, you might be able to understand how they can
> also be used to evaluate just a single shape function. In the end, the
> values
> and gradients of a single shape function correspond to the values and
> gradients of a finite element field that corresponds to a solution vector
> with
> one 1.0 and the rest of the elements set to zero.
>
> Best
> W.
>
>
> --
> ------------------------------------------------------------------------
> Wolfgang Bangerth email: [email protected]
> www: http://www.math.colostate.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 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/6527dccb-aebc-f424-5217-1c19a9b8b3c2%40colostate.edu
> .
>
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/CAM50jEsJh_oDF%3DzZFvnq69rVbcn5GQmBvji8u2oLyeU8SbfK6A%40mail.gmail.com.