Smart polymers and composites