Ferroelectrics as smart mechanical materials