Hi Michael,
> Does the (1) do all the work that the last two do? I.e., (1) gives the whole 
> chunk of gradient, and the last two extract the scalar and vector parts from 
> the chunk, respectively.
> 
They are very closely related. (1) has no knowledge on the nature of the 
field(s) for which the gradient is being computed, so it just returns the 
gradient of all individual components of the solution field at once, and it's 
up to you to interpret that however you need. For (2) and (3), one is 
interpreting the solution field (or a subset of its components) to have a 
certain nature, and so more context can be given to the gradients that are 
returned. In particular, the gradient of a scalar field is a rank-1 tensor, and 
the gradient of a vector field would be a rank-2 tensor. So the return types 
are in fact different, but essentially encode the some/all information that is 
given by (1). 

Does that make sense?

The great thing about using the FEValuesExtractors/FEValuesViews concept is 
that you are able to achieve a near 1-1 match of the written and programmed 
weak form, which makes implementing things a lot easier. So in most of the more 
recent tutorials we use them, and I’d say that more often than not we’d 
advocate their use.

Best,
Jean-Paul

> On 24. Jun 2021, at 18:20, Michael Lee <[email protected]> wrote:
> 
> After reading the documentation on Handling vector valued problems (The 
> deal.II Library: Handling vector valued problems (dealii.org) 
> <https://www.dealii.org/current/doxygen/deal.II/group__vector__valued.html>), 
> I have the following question.
> 
> What are the differences between the three functions?
> 
> (1) FEValuesBase::get_function_gradients 
> <https://www.dealii.org/current/doxygen/deal.II/classFEValuesBase.html#ad1f4e0deb5d982e8172d82141c634a67>
>  
> 
> (2) FEValuesViews::Scalar::get_function_gradients 
> <https://www.dealii.org/current/doxygen/deal.II/classFEValuesViews_1_1Scalar.html#a8073486fd29629a2e6caa56d7be06fff>
>  
> 
> (3) FEValuesViews::Vector::get_function_gradients 
> <https://www.dealii.org/current/doxygen/deal.II/classFEValuesViews_1_1Vector.html#aa469aee7243e38f768456b05a8508b12>
>  
> 
> 
> 
> Does the (1) do all the work that the last two do? I.e., (1) gives the whole 
> chunk of gradient, and the last two extract the scalar and vector parts from 
> the chunk, respectively.
> 
> 
> 
> 
> -- 
> The deal.II project is located at http://www.dealii.org/ 
> <http://www.dealii.org/>
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en 
> <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] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/89ec12a9-9553-4ee2-9bf0-8900517587c3n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/dealii/89ec12a9-9553-4ee2-9bf0-8900517587c3n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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/97AA7B43-5CF1-4ECE-9238-272250916C76%40gmail.com.

Reply via email to