# Evaluating at arbitrary points

**URL:** <https://fenicsproject.discourse.group/t/evaluating-at-arbitrary-points/13188>\
**Category:** dolfinx\
**Created:** [December 31, 2023, 9:13pm UTC](https://fenicsproject.discourse.group/t/evaluating-at-arbitrary-points/13188 "2023-12-31T21:13:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gideonsimpson](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/gideonsimpson/32/561_2.png) [@gideonsimpson](https://fenicsproject.discourse.group/u/gideonsimpson)\
**Post date:** [December 31, 2023, 9:13pm UTC](https://fenicsproject.discourse.group/t/evaluating-at-arbitrary-points/13188/1 "2023-12-31T21:13:18Z")

</div>

I know this is pretty elementary, but after I solve my problem, i.e.,

```auto
problem = LinearProblem(a, L, bcs= my_bcs ,petsc_options=my_opts)
uh = problem.solve()

```

I would like to evaluate `uh`, the solution at a an array of (x,y,z) points. Thanks for any help.

---

<div class="post-metadata">

**Author:** ![francesco-ballarin](https://avatars.discourse-cdn.com/v4/letter/f/f05b48/32.png) [@francesco-ballarin](https://fenicsproject.discourse.group/u/francesco-ballarin)\
**Post date:** [January 1, 2024, 5:58am UTC](https://fenicsproject.discourse.group/t/evaluating-at-arbitrary-points/13188/2 "2024-01-01T05:58:42Z")

</div>

Next time, please read [Read before posting: How do I get my question answered?](https://fenicsproject.discourse.group/t/read-before-posting-how-do-i-get-my-question-answered/21) before bosting, because:

1. it would have been better to provide a minimal example. Put yourself in the shoes of someone willing to reply: if you don’t provide a minimal example, not only they will have to come up with the code of the feature you are asking (function evaluation), but also all the code leading up to `uh = problem.solve()`
2. if you had searched for previous posts, e.g. with a query like “evaluate function” ordered by date, you would have found this post [Duplicates can happen when evaluating function at points - safe version](https://fenicsproject.discourse.group/t/duplicates-can-happen-when-evaluating-function-at-points-safe-version/12836) which links to this tutorial [Implementation — FEniCSx tutorial](https://jsdokken.com/dolfinx-tutorial/chapter1/membrane_code.html). That is probably the answer you are looking for (or very close to it), and you wouldn’t have needed to wait for anyone to reply, especially on days like new year’s eve/day where the community might be slower to respond.

---

<div class="post-metadata">

**Author:** ![gideonsimpson](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/gideonsimpson/32/561_2.png) [@gideonsimpson](https://fenicsproject.discourse.group/u/gideonsimpson)\
**Post date:** [January 1, 2024, 8:09pm UTC](https://fenicsproject.discourse.group/t/evaluating-at-arbitrary-points/13188/3 "2024-01-01T20:09:35Z")

</div>

Sorry about that. I come back to fenics every couple of years for some FEM problem, and things have just changed a lot (i.e., this is what I was using the last time: [https://fenicsproject.org/qa/6374/what-is-the-best-way-to-evaluate-function-in-list-coordinates/](https://fenicsproject.org/qa/6374/what-is-the-best-way-to-evaluate-function-in-list-coordinates/))
