Stress in thin layers: grain interaction elastic constants and diffraction response