[2D Meshing] How to ensure the nodes on boundaries always coincide perfectly?
I am creating a 2D mesh where I need the center region to have a larger element size compared to the top layer and the boundary layers (which should have the same element size). I managed to do this (picture and code below) but I noticed that on the boundaries separating surfaces, those pointed out by a blue arrow don't have nodes of the elements on adjacent surfaces perfectly matched up. However, those boundaries pointed out by black arrows do have these nodes perfectly coincident.
I am wondering if there is a way to enforce these nodes to match up? A more detained explanation on why this happened for the black-arrow boundaries but didn't happen for the blue-arrow boundaries would also be greatly appreciated!!!
P.S. to create the increase in element size in the middle I used a combination of distances and thresholds. I was going to try the box field (as seen in my code which is commented out), but somehow that operation does nothing to my mesh (maybe because it is a box across several surfaces?) Anyways, if anyone has suggestions on a better way to do this (i.e. increase element size in the middle area while also creating a transition back to smaller elements to match up the top and boundary layers), it would be much appreciated!
Thanks!!