Energy applications of functional thin films