Density functional theory for the recognition of polymer at nanopatterned surface.