Algorithms for Multiphase Motion with Applications to Materials Science.