A domain decomposition method for computing the scattering matrix of waveguide circuits