generalize get-patch to work with multiple topologies