Numerical simulation of mechanical behavior of heterogeneous materials under loading with an explicit consideration for their 3D mesoscale structure is given. A 3-D problem in the dynamic formulation is solved using the finite-difference method. As an example, a coal specimen under tension and compression is examined, with an initial crack pattern taken into account. It is been shown that the fracture criterion we used in the calculations provides adequate description of fracture behavior under tension and compression on both macro and mesoscale level.