Cluster approach in first-principle calculations for ferroelectrics