Multifunctional piezoelectric metastructures for vibration attenuation and energy harvesting