Efficiently Finding Maximum Function Value in a Mesh with FEniCSx

There is a vertex to dof map:

which you can use to map vertices to dogs.

Combine that with entities_to_geoemtry, and you can get the values at vertices for any space that has dofs associated with vertices.

Note that for higher order spaces you are then excluding all other dofs, and you will likely not get the correct maximum value.