A library for modeling invasion percolation