Efficient boundary element method solution of potential problems that are large, linear and involve optimization of boundary geometry