  We present a comprehensive study of the discretized modes of an atomic gas in
different conditions of confinement. Starting from the equations of
hydrodynamics we derive a closed equation for the velocity field, depending on
the adiabatic and isothermal compressibilities and applicable to different
dimensions and quantum statistics. At zero temperature the equation reproduces
the irrotational behavior of superfluid hydrodynamics. It is also applicable
above the critical temperature in the collisional regime, where the appearence
of rotational components in the velocity field is caused by the external
potential. In the presence of harmonic trapping, a general class of analytic
solutions is obtained for systems exhibiting a polytropic equation of state,
characterized by a power law isoentropic dependence of the pressure on the
density. Explicit results for the compressional modes are derived for both Bose
and Fermi gases in the pancake, cigar as well as in the deep 2D and 1D regimes.
Our results agree with the analytical predictions available in the literature
in some limiting cases. They are particularly relevant in 1D configurations,
where the study of the collective frequencies could provide a unique test of
the achievement of the collisional regime at finite temperature.
