# Re: [deal.II] Accessing nodal values of a FEM solution

```On Thu, Jul 23, 2020 at 12:43 PM Daniel Arndt <d.arndt.m...@gmail.com>
wrote:```
```
> However, I have two more related questions. BTW, I am a newbie in C++
>> programming. So my questions may seem absurd.
>>
>>    1. Now that we have a vector holding all nodal point coordinates, and
>>    another vector holding all nodal point values of the solution. How do we
>>    access every nodal point coordinates, and at the same time, the associated
>>    nodal point value within the same loop?
>>
>> Can you clarify in a short pseudocode example what you are trying to
> achieve?
>

We need to update function v based on solution u in the following loop.

for ( x in vector_of_nodal_points )
v(x) = f(x, u(x))

where v(x) and u(x) are the nodal point value for functions v and u,
respectively, and f() is some function depending on function u as well as
the location of the nodal point. So in this case, we need to access nodal
point coordinates and nodal point values of the solution in the same loop.

>
>>    1. In addition to nodal point values of a solution, are the partial
>>    derivatives (or gradient) of the solution at each nodal point available in
>>    deal.ii?
>>
>> That's basically what DataPostprocessor is doing. In general, you can
> loop over all cells and calculate the derivatives locally. Have a look at
> ).
>
> Well, the above function calculates the gradients of a finite element at
the quadrature points of a cell, not at the nodal points of a cell.
Such a need arises in the following situation.

for ( x in vector_of_nodal_points )
v(x) = g(x, u(x), grad u(x))

--
Stay put, practice social distancing, and be safe!

Best,

--Xuefeng Li, (504)865-3340(phone)
Like floating clouds, the heart rests easy
Like flowing water, the spirit stays free
Loyola University New Orleans
New Orleans, Louisiana (504)865-2051(fax)

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see