Stress relaxation in ferroelectric materials