Hi,
I am trying to refine a 1d interval mesh near the boundary.
for example:
The original mesh mesh= IntervalMesh(10,0,1)
and I want it to be refined until 0.5 distance for which I use:
cell_markers = MeshFunction("bool", mesh, mesh.topology().dim()) cell_markers.set_all(False) for cell in cells(mesh): if cell.midpoint().x() < .5: cell_markers[cell] = True mesh = refine(mesh, cell_markers)
and I save the the mesh in xml format mesh_file=File("mesh_refined.xml") mesh_file<<mesh
To me this should have added 5 more vertices between 0 to 0.5 distance along the mesh but when I open the xml file, I see that these new vertices appear after the original 11 vertices. imgae for reference, the xml file:
It would be great if someone can help me figure where I am mistaking and how to have these new refined vertices on correct order (between my specified distance of 0.5). Thanks!
These indicate which vertices each cell is made up of. as you can observe with the first cell, it is made up of the 0th and 11th vertex, i.e.
x=0.0 and x=0.05, creating the cell you wanted. Similarly, you can go through all the other coordinates, and observe that the connectivity is correct.
Thanks dokken, Yes I noticed that, and I assume that it does not matter if in the cells dataset, v0 and v1 are interchanged as long as both of them are correct vertices?.