Calculated strain energy of hexagonal epitaxial thin films