A Grain Boundary Formulation for the Analysis of Three-Dimensional Polycrystalline Microstructures