Wrote function for calculating local density using voro++.