Total-energy calculations for point defects in metals