An immersed boundary method based on domain decomposition