Effects of voids and flaws on the mechanical properties and on intergranular damage and fracture for polycrystalline materials