The structure and stress development of adsorption, impurity incorporation, and temperature controlled morphology for thin films