This article about the psychology of programmers hits the nail on the head. Finding it difficult and even impossible to get 'into the flow', was one of the sources of frustration in my recent employment that lead me to resigning.
Now I work virtually for CivicActions and I can create my own space and time to get in the flow and do the fun interesting (and billable) work.
I have experimented working at Effusion's offices, an open-source-centric co-working-like environment in Christchurch over the last 4 weeks. I have found I'm not as productive here because it takes me longer to get into the flow and there are more distractions.