Output solution across surface of mesh with element coordinates to a .txt file

After thinking about this, some minor modifications are needed in this line, and previous line to work in 3D, but it should be straightforward to change.