Mesh distribution with mesh density function

I generate the mesh in a 2d square cavity. but as i shown in the “unv” file, the coordinates of the nodes don’t have the same values which should be on the same line.
Could you please give me some help.

Hello ztdep,
The reason is that the orientations of 2 parallel edges are opposite. For example the first value 1.344299 corresponds to 0.1 in the table (or 0.9 whatever) and the value 1.343577 corresponds to 0.9 (or 0.1). If you sum the values 1.34xx with their similar 8.65xx you will get 1.
If it is a real problem for you, you can solve it by inverting the direction of the edges in the table; see the python file I joined. The drawback is that the inverted edges are defined by their Id and this Id may change if you modify the geometry.
I do agree that it is strange and I will investigate that. (3.8 KB)

ok, it works after I inverted the edge direction