  The mechanocaloric effect is the temperature change of a material upon
application or removal of an external stress. Beyond its fundamental interest,
this caloric response represents a promising and ecofriendly alternative to
current cooling technologies. To obtain large mechanocaloric effects, we need
materials whose elastic properties (e.g., strain, elastic compliance) are
strongly temperature dependent. This is the case of ferroelectric perovskite
oxides, where the development of the spontaneous electric polarization is
accompanied by significant strains and lattice softening. Thus, in this work we
study the mechanocaloric properties of model ferroelectric PbTiO$_{3}$, by
means of predictive atomistic ("second-principles") simulations and a
perturbative formalism here introduced. Our calculations reveal relatively
large effects (up to $-$4 K for relatively small applied compressions of $-$0.1
GPa) and several striking features. In particular, we find that the
mechanocaloric response is highly anisotropic in the ferroelectric phase, as it
can be either conventional (temperature increases upon compression) or inverse
(temperature decreases) depending on the direction of the applied stress. We
discuss and explain these surprising results, which compare well with existing
experimental information. Our analysis suggests that the coexistence of
conventional and inverse mechanocaloric responses is probably common among
ferroelectrics and materials displaying a negative thermal expansion.
