Nanoscale electromechanical phenomena in ferroelectric thin films