Cannot read vertex data/attributes from .xdmf

I have an external program which exports a 3D pipe mesh as an xdmf file by constructing it manually and exporting with meshio, and a dolfinx program which reads this file and performs a finite element method on it. In the dolfinx code I would like to create a MeshTags object which tags the boundary facets with -1,0,1 for the inside surface, endpoints, and outside surface of the pipe so I can apply different boundary conditions on these surfaces - this is not possible to solve geometrically as the pipe can have an arbitrary shape with a number of bends. The meshing code has the ability to export point data and cell data and to identify the points or the facets which are on the outside/inside, so I currently have it set up to export point data using meshio which labels every point as outside (1) inside (-1) or interior (0), which meshio saves as a node-centred associated with the grid in the xdmf file.

If I can read this data from xdmf correctly I can work with it to create the MeshTags object - I can read it and obtain the attribute dictionary using meshio.read(mesh_path).point_data but because it seems the meshio Mesh object indexes points differently to the dolfinx Mesh object created with dolfinx.io.XDMFFile.read_mesh() this fails. Using io.XDMFFile.read_meshtags() creates a MeshTags object but reads the point data as cell data, which removes information. It seems unusual to have a built-in function to create a MeshTags object immediately from xdmf cell data but have no dolfinx function to read point data into a MeshTags, so I feel like I’ve misunderstood something here.

I have installed adios4dolfinx but it seems that to use the helpful read functions from that module I need to also write the mesh and data using adios4dolfinx and cannot read it in directly from the xdmf created with meshio - I do have the ability to alter the mesh generator but as the program is external to my dolfinx code and does not currently depend on dolfinx at all changing this is not ideal. I am wondering if there is a way to achieve this without adios4dolfinx, or to use it but do it simply without altering the mesh generator.

The method described in the subdomains tutorial seems like it wouldn’t fully apply here because the data is already saved as xdmf rather than .msh. I have tried to create a new .xdmf file containing only the tagged boundary facets (to read back in immediately with dolfinx read_meshtags) by working with the meshio mesh but

meshio_mesh.get_cells_type("quad")

returns an empty list, unlike the tutorial where the same function with “line” returns a list of all the facets from the 2D mesh - I expect this is because my xdmf mesh is produced in a different way to the tutorial (i.e. not using gmsh).

It seems there are lots of ways to approach this problem but all feel more complicated than they could be and I haven’t yet been able to get any to work. If anyone has any insight or some handy I/O or meshing functions I’m missing it would be very helpful.

Without a minimal reproducible example it is really hard to give you any guidance here.
You should be able to store vertex, edge, facet or cell data that can be read in with DOLFINx, given that all of the data is written consistently to XDMFFile’s using meshio. This is for instance illustrated in many places with facet data.
I have also shown how to read point (vertex) data from XDMF with: Reading node based data from "Legacy" XDMFFile · Issue #16 · jorgensd/adios4dolfinx · GitHub