Application of an automatic grating technique for the structural analysis of composite materials