work on 1D mesh and 2D mesh