Calculation of strain relaxation in strained-layer structures: comparison of atomistic and continuum methods