I think there are various ways you could do this.
- is to invert the map in: Reordering nodal values in accordance with meshgrid created using numpy - #3 by dokken
which is similar to - Assigning values to function: order issues - #4 by dokken
- Another one is to use an interpolator: Mapping 2D numpy array into dolfinx function - #4 by dokken