# Efficiently Finding Maximum Function Value in a Mesh with FEniCSx

**URL:** <https://fenicsproject.discourse.group/t/efficiently-finding-maximum-function-value-in-a-mesh-with-fenicsx/15910>\
**Category:** General\
**Created:** [September 26, 2024, 2:31pm UTC](https://fenicsproject.discourse.group/t/efficiently-finding-maximum-function-value-in-a-mesh-with-fenicsx/15910 "2024-09-26T14:31:29Z")\
**Posts on this page:** 1\
**Showing post:** 8

<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:** [September 27, 2024, 10:55am UTC](https://fenicsproject.discourse.group/t/efficiently-finding-maximum-function-value-in-a-mesh-with-fenicsx/15910/8 "2024-09-27T10:55:45Z")

</div>

> [@nikoleeaa](#):
>
> My idea is to obtain the coordinates of the three vertices of the cell, not the degrees of freedom, because only in this way can we truly locate the range of the triangle.

What do you mean by this? If you use a `P1` function space, the dofs are located at the vertices, whatever those vertices are are not affected by `V.tabulate_dof_coordinates()` which I just used to illustrate to you want the coordinates are.  
The true value at the vertex is the value that is in `u.x.array`, `u.eval` will be affected by floating point accuracy in the push forward.

Secondly:

> [@nikoleeaa](#):
>
> ```auto
> cell_vertices = mesh.topology.connectivity(mesh.topology.dim, 0).links(cell_index)
> points = mesh.geometry.x[cell_vertices]
> 
> ```

is not correct, as I mentioned earlier. See for instance: [What is the difference between compute\_incident\_entities and entities\_to\_geometry? - #2 by dokken](https://fenicsproject.discourse.group/t/what-is-the-difference-between-compute-incident-entities-and-entities-to-geometry/14867/2)  
and [Getting coordinates of facets in dolfinx - #2 by dokken](https://fenicsproject.discourse.group/t/getting-coordinates-of-facets-in-dolfinx/5146/2)

---

_[View the full topic](https://fenicsproject.discourse.group/t/efficiently-finding-maximum-function-value-in-a-mesh-with-fenicsx/15910)._
