Grain boundary ensembles in materials with f.c.c., b.c.c. and diamond structures