# Evaluating the solution of FEM on the selected points

**URL:** <https://fenicsproject.discourse.group/t/evaluating-the-solution-of-fem-on-the-selected-points/14904>\
**Category:** General\
**Created:** [June 6, 2024, 6:36am UTC](https://fenicsproject.discourse.group/t/evaluating-the-solution-of-fem-on-the-selected-points/14904 "2024-06-06T06:36:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chensek](https://avatars.discourse-cdn.com/v4/letter/c/439d5e/32.png) [@chensek](https://fenicsproject.discourse.group/u/chensek)\
**Post date:** [June 6, 2024, 6:36am UTC](https://fenicsproject.discourse.group/t/evaluating-the-solution-of-fem-on-the-selected-points/14904/1 "2024-06-06T06:36:54Z")

</div>

Hello,

I solved the problem (curl-curl equations) using Nedelec basis functions and obtained a (number of edges x 1) solution as expected. For example, assume that, I have 1584 edges in total, after I convert FEM solution to numpy array, I obtained 1584x1 vector. Now, I want to calculate the value of the solution (FEM solution) on the selected points (for instance, quadrature points). In my case, I have 1024 triangles and 3 quadrature points per triangle, I have totally 3072 points. I want to calculat ethe value of the FEM solution on these points, I want to obtain (3072,1) solution matrix obtained from the selected points. How can I project my solution (edge-based Nedelec basis functions are used) selected points.

I read different question from the forum and tutorial but I think, my question is not answered because in my case, I cannot obtain the solution of (number of pointsx1) that I expected to obtain as a result of the solution matrix (number of edgesx1) and projection to the selected points in any of the explained methods. What approach should I take? Are there any functions or code blocks that I can use to do this?

Thank you very much for your help

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [June 6, 2024, 6:43am UTC](https://fenicsproject.discourse.group/t/evaluating-the-solution-of-fem-on-the-selected-points/14904/2 "2024-06-06T06:43:10Z")

</div>

Are you using legacy DOLFIN or DOLFINx?

With either code, you could interpolate your solution into a quadrature space, and then in turn tabulate the dof coordinates to get the quadrature points. Note that a nedelec function-space is a vector space, i.e. the basis is vector valued, by evaluating at a point you will get out a vector of size geometric dimension of the mesh per point.

---

<div class="post-metadata">

**Author:** ![chensek](https://avatars.discourse-cdn.com/v4/letter/c/439d5e/32.png) [@chensek](https://fenicsproject.discourse.group/u/chensek)\
**Post date:** [June 6, 2024, 6:50am UTC](https://fenicsproject.discourse.group/t/evaluating-the-solution-of-fem-on-the-selected-points/14904/3 "2024-06-06T06:50:34Z")

</div>

> [@dokken](#):
>
> ode, you could interpolate your solution into a quadrature space, and then in turn tabulate the dof coordinates to get the quadrature points. Note that a nedelec function-space is a vector space, i.e.

Thank you, I am using Dolfinx.

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [June 6, 2024, 7:21am UTC](https://fenicsproject.discourse.group/t/evaluating-the-solution-of-fem-on-the-selected-points/14904/4 "2024-06-06T07:21:48Z")

</div>

Then interpolate into a quadrature space, use tabulate dof coordinates and access the underlying dof data from u\_interpolated.x.array.
