Performance of various Hamiltonians in the study of the piezoelectric properties of crystalline compounds: The case of BeO and ZnO