  Self-gravity plays an important role in the evolution of rotationally
supported systems such as protoplanetary disks, accretion disks around black
holes, or galactic disks, as it can both feed turbulence or lead to
gravitational fragmentation. While such systems can be studied in the shearing
box approximation with high local resolution, the large density contrasts that
are possible in the case of fragmentation still limit the utility of Eulerian
codes with constant spatial resolution. In this paper, we present a novel
self-gravity solver for the shearing box based on the TreePM method of the
moving-mesh code AREPO. The spatial gravitational resolution is adaptive which
is important to make full use of the quasi-Lagrangian hydrodynamical resolution
of the code. We apply our new implementation to two- and three-dimensional,
self-gravitating disks combined with a simple $\beta$-cooling prescription. For
weak cooling we find a steady, gravito-turbulent state, while for strong
cooling the formation of fragments is inevitable. To reach convergence for the
critical cooling efficiency above which fragmentation occurs, we require a
smoothing of the gravitational force in the two dimensional case that mimics
the stratification of the three-dimensional simulations. The critical cooling
efficiency we find, $\beta \approx 3$, as well as box-averaged quantities
characterizing the gravito-turbulent state, agree well with various previous
results in the literature. Interestingly, we observe stochastic fragmentation
for $\beta > 3$, which slightly decreases the cooling efficiency required to
observe fragmentation over the lifetime of a protoplanetary disk. The numerical
method outlined here appears well suited to study the problem of galactic disks
as well as magnetized, self-gravitating disks.
