# Coordinates of mesh generated by Mathematica-FEM

MeshCoordinates function yields more nodal coordinates than expected. Can I extract the coordinates of vertices only. Here is an example of a square region with a course mesh to explain the problem. I would like the code get me the following coordinates:{{0., 0.}, {0., 0.5}, {0., 1.}, {0.5, 0.}, {0.5, 0.5}, {0.5, 1.}, {1.,0.}, {1., 0.5}, {1., 1.}}.

Needs["NDSolveFEM"]
d = Rectangle[{0, 0}, {1, 1}];
mesh = ToElementMesh[d2, MaxCellMeasure -> 0.5];
mesh["Wireframe"]
MeshCoordinates[mesh2][[1, 1]]

• d2,mesh2 should be d,meshin your code I think. mesh = ToElementMesh[d, MaxCellMeasure -> 1 ]; give the coordinates you wish to get. Mar 9 at 11:24

The function MeshCoordinates works for MeshRegion. ToElementMesh, however, returns an ElementMesh. For an ElementMesh you can extract the coordinates in the following manner:

Needs["NDSolveFEM"]
d = Rectangle[{0, 0}, {1, 1}];
mesh = ToElementMesh[d2, MaxCellMeasure -> 0.5];
mesh["Wireframe"]
mesh["Coordinates"]


If you want a first order mesh use:

mesh = ToElementMesh[d2, MaxCellMeasure -> 0.5,"MeshOrder"->1];


Also, I encourage you to look at the documentation of ToElementMesh and ElementMesh for more information.

• V. clear. Many thanks. Mar 10 at 11:17