Application of multigrid to general relativity