  We investigate the particle and kinetic-energy densities for a system of $N$
fermions confined in a potential $V(\bfr)$. In an earlier paper [J. Phys. A:
Math. Gen. {\bf 36}, 1111 (2003)], some exact and asymptotic relations
involving the particle density and the kinetic-energy density locally, i.e. at
any given point $\bfr$, were derived for isotropic harmonic oscillators in
arbitrary dimensions. In this paper we show that these {\it local virial
theorems} (LVT) also hold exactly for linear potentials in arbitrary dimensions
and for the one-dimensional box. We also investigate the validity of these LVTs
when they are applied to arbitrary smooth potentials. We formulate generalized
LVTs that are supported by a semiclassical theory which relates the density
oscillations to the closed non-periodic orbits of the classical system. We test
the validity of these generalized theorems numerically for various local
potentials. Although they formally are only valid asymptotically for large
particle numbers $N$, we show that they practically are surprisingly accurate
also for moderate values of $N$.
