Derivation of a heteroepitaxial thin-film model