A model for the behaviour of tensile and compressive residual stresses developed in thin films produced by ion beam-assisted deposition techniques