Modeling of Structural, Elastic, and Polar Properties of Organic and Inorganic Ferroelectrics