Comparison of the deflated preconditioned conjugate gradient method and algebraic multigrid for composite materials