Phase-field simulations with inhomogeneous elasticity: Comparison with an atomic-scale method and application to superalloys