Proper use of fe_values.get_function_values to get values from a vector
29 views
Skip to first unread message
Matthew Rich
unread,
Aug 6, 2022, 9:54:41 AM8/6/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to deal.II User Group
Hi
I am again tinkering with my favorite tutorial step 23 and I am have a question again on how to move forward. What I am attempting to do now is redo this setup but rather than using helper functions to create the system matrix and RHS, I am trying to build the system by looping over the cells.
My question stems from how I get the appropriate local values from vectors to use in the loops. So in step 23 you would want to get values from old_solution_u and old_solution_v. Now I looked at other tutorials and I not 100% sure they had a similar need. In looking over the documentation my guess is that I would use the overloaded get_function_values
Is this correct? Also how would I deal with quadrature points in this instance in this context. Any help would be much appreciated?
Matt
Wolfgang Bangerth
unread,
Aug 7, 2022, 6:51:37 PM8/7/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to dea...@googlegroups.com
On 8/6/22 07:54, Matthew Rich wrote:
>
> My question stems from how I get the appropriate local values from vectors to
> use in the loops. So in step 23 you would want to get values from
> old_solution_u and old_solution_v. Now I looked at other tutorials and I not
> 100% sure they had a similar need. In looking over the documentation my guess
> is that I would use the overloaded get_function_values
>
> void FEValuesBase
Yes, this function will give you the values of the function described by the
first argument (the input vector), at the quadrature points the FEValues
object has been initialized with, and puts these values into the second
(output) argument.
> Is this correct? Also how would I deal with quadrature points in this instance
> in this context. Any help would be much appreciated?
You initialize an FEValues object with a quadrature object. Those are going to
be the points at which you get the values of the solution. (For this
operation, the weights of the quadrature points do not factor in.)