4D printing with shape memory polymers for functional structures and devices