  In 2D simulations of thin gaseous disks with embedded planets or self-gravity
the gravitational potential needs to be smoothed to avoid singularities in the
numerical evaluation of the gravitational potential or force. In order to
correctly resemble the realistic case of vertically extended 3D disks the
softening prescription used in 2D needs to be adjusted properly. In this paper
we analyze the embedded planet and the self-gravity case and provide a method
to evaluate the required smoothing in 2D simulations of thin disks. Starting
from the averaged hydrodynamic equations and using a vertically isothermal disk
model, we calculate the force. We compare our results to the often used Plummer
form of the potential which runs as \propto 1/(r^2+\epsilon^2)^{1/2}. For that
purpose we compute the required smoothing length \epsilon as a function of
distance r to the planet or to a disk element within a self-gravitating disk.
We find that for larger distances \epsilon is determined solely by the vertical
disk thickness H. For the planet case we find that outside r\simH a value of
\epsilon = 0.7H describes the averaged force very well, while in the
self-gravitating disk the value needs to be larger, \epsilon = 1.2H. For
smaller distances the smoothing needs to be reduced significantly. Comparing
torque densities of 3D and 2D simulations we show that the modification to the
vertical density stratification as induced by an embedded planet needs to be
taken into account to obtain agreeing results. In disk fragmentation
simulations the choice of \epsilon can determine whether a disk will fragment
or not. Because a wrong smoothing length can change even the direction of
migration, it is very important to include the effect of the planet on the
local scale height in 2D planet-disk simulations. We provide an approximate and
fast method for this purpose which gives very good agreement to full 3D
simulations.
