The influence of elastic strain energy on the formation of coherent hexagonal phases