A numerical model based on the finite element method is presented for modeling of microstructures. The model uses a discrete version of the Voronoi algorithm to partition the mesh into grains. The model is utilized to study representativity of grain structures. The number of grains needed in a representative volume element is evaluated for materials with cubic symmetry and random texture. It is shown that the number of grains needed depend on the anisotropy, and a simple expression that relates anisotropy and the number of grains is suggested.