A grain boundary formulation for crystal plasticity