Physical mesomechanics of heterogeneous media and computer-aided design of materials