Add support for reading XDMF DG0 functions
Related forum topic : https://fenicsproject.discourse.group/t/create-a-function-from-cell-data/7009
With the current XDMFFile api, one can write any dolfinx function to a xdmf file through the write_function function. However, there is no way of reading a function from a xdmf file.
One can use the read_meshtags function when the data is made of integers, but that's not always the case.
A use case is the following : a material microstructure is defined and meshed through an external software. In the output mesh, the software defines several mesh functions, relative to local features of the material. For instance, with an anisotropic heterogeneous material, such a mesh function could be a DG0 floating point vector field representing the local microstructure orientation. In order to solve the linear elasticity equation in dolfinx, one would need to load this orientation field from the xdmf file and map it to material properties in dolfinx, which is not currently possible.