4D printing of reconfigurable metamaterials and devices