Partitioning, tearing and modification of sparse linear systems