add mesh to sparse matrix conversion