mesh <- fm_mesh_2d(
boundary = fm_segm(rbind(c(0,0), c(1,0), c(1,1), c(0, 1)), is.bnd = TRUE)
)
new_mesh <- fm_subdivide(mesh, n = 3)
plot(new_mesh, edge.color = 2)
plot(mesh, add = TRUE, edge.color = 1)
Run the code above in your browser using DataLab