because 'read_from_msh 'doesn’t have an array attribute, but I want an array of physical tag of every cell, which is what cell_markers is doing in the dolfin code. But ‘read_from_msh’ does return the cell_markers associated with the physical tags, which is what I want
I had a look at ‘extract_topology_and_markers’, but that appears to accept only gmsh models, not .msh files
Then how do I get the array?
print(cell_markers.array() used to print an array of the physical tags, and plot(cell_markers) used to plot subdomains. How can I use cell_tags to do the same?
Printing cell_tags just gives, what I think is a memory location.
<dolfinx.cpp.mesh.MeshTags_int32 object at 0x7ff070e428f0>
print(meshio.read("path to file").cell_data_dict["gmsh:physical"]["triangle"])
does give me such an array, but I’m unsure of how to use it further
cell_tags is a dolfinx.fem.MeshTags<std::int32> object.
This object has several properties, including cell_tags.indices and cell_tags.values, where indices gives you the list of entities (local to process) whose ith entry map to the ith entry in cell_tags.values.