  It is shown that a ferroelastic lattice distortion is associated with the
superconducting transition both in low- and high-temperature superconductors. A
low-temperature ferroelastic transition in crystalline solids produces also a
maximum in the temperature dependence of their thermal conductivity. In layered
tetragonal superconductors with a sufficiently high transition temperature, a
ferroelastic distortion is improper and is caused by an out-of-plane charge
ordering. The relation between the out-of-plane charge gap and the maximum
superconducting transition temperature for these superconductors is obtained.
