Hi everyone. I’m trying to validate my computational model using a .vtk mesh.
This .vtk file has everything I need, i.e:
So I used mesh.io to convert this .vtk file. I tried for .xdmf and .XML formats. I’ve always used.XML format, but in the conversion, it says that this format is legacy, and should I consider using .xdmf instead.
The 1st conversion, .vtk to . XML, I got 4 files: mesh, fibers, ID, and sheets, as I expected. But when I tried to read the files like this:
mesh = Mesh(“mesh-1.xml”)
ids = MeshFunction(“size_t”, mesh, “mesh-1_ID.xml”)
fibers = MeshFunction(“size_t”, mesh, “mesh-fibers.xml”)
sheets = MeshFunction(“size_t”, mesh, “mesh-sheets.xml”)
besides the mesh, I got the following error:
Error: Unable to read mesh function from XML file
Reason: Type mismatch reading XML MeshFunction. MeshFunction type is “unit”, but file type is “int” (for ids) and “float” (for fibers/sheets). I even tried to change “size_t” to int or float respectively but didn’t work.
So I tried the .xdmf format. I got only one file out from the conversion: mesh.vtk → mesh.xdmf. So my question is: How to read this only mesh.xdmf file and get all properties showed in the figure (ids, fibers and sheets) ?
The last question is: I have this scalar field “rho”, the goes from 0 to 1 in the rho direction. I’d like to know how to setup my boundaries for rho=0 and rho=1. How can I use this scalar field to define boundaries?
Any help would be appreciated. Thanks a lot!