A thermodynamically consistent model with evolving domain structures in ferroelectrics