Grothendieck went to Vietnam to deliver lectures and a [report][1] of what he did can still be found online.

Bertrand Russell was imprisoned during WWI for anti-war activities and wrote "Introduction to Mathematical Philosophy" (1919) while in prison.

Hardy, in protest for Russell's affair, left Cambridge to Oxford and continued working there and collaborating by mail with Littlewood. Both of them worked during that time in Mathematics and there is [fiction][2] written about it.


  [1]: http://www.math.jussieu.fr/~leila/grothendieckcircle/vietnam.pdf
  [2]: http://en.wikipedia.org/wiki/Uncle_Petros_and_Goldbach's_Conjecture