  In this paper we present a simple and effective numerical method which allows
a fast Fourier transformation-based evaluation of stress generated by
dislocations with arbitrary directions and Burgers vectors if the
(site-dependent) dislocation density is known. Our method allows the evaluation
of the dislocation stress using a rectangular grid with shape-anisotropic
discretization cells without employing higher multipole moments of the
dislocation interaction coefficients. Using the proposed method, we first
simulate the stress created by relatively simple nonhomogeneous distributions
of vertical edge and so-called 'mixed' dislocations in a disk-shaped sample,
which is necessary to understand the dislocation behavior in more complicated
systems. The main part of our research is devoted to the stress distribution in
polycrystalline layers with the dislocation density rapidly varying with the
distance to the layer bottom. Considering GaN as a typical example of such
systems, we investigate dislocation-induced stress for edge and mixed
dislocations, having random orientations of Burgers vectors among crystal
grains. We show that the rapid decay of the dislocation density leads to many
highly nontrivial features of the stress distributions in such layers and study
in detail the dependence of these features on the average grain size. Finally
we develop an analytical approach which allows us to predict the evolution of
the stress variance with the grain size and compare analytical predictions with
numerical results.
