Stability criteria for homogeneously stressed materials and the calculation of elastic constants.