Influence of magnetic fields on structural martensitic transitions