  We study the critical behavior of the free energy and the thermodynamic
Casimir force in a $L_\parallel^{d-1} \times L$ block geometry in $2<d<4$
dimensions with aspect ratio $\rho=L/L_\parallel$ above, at, and below $T_c$ on
the basis of the O$(n)$ symmetric $\phi^4$ lattice model with periodic boundary
conditions (b.c.). We consider a simple-cubic lattice with isotropic
short-range interactions. Exact results are derived in the large - $n$ limit
describing the geometric crossover from film ($\rho =0$) over cubic $\rho=1$ to
cylindrical ($\rho = \infty$) geometries. For $n=1$, three perturbation
approaches are presented that cover both the central finite-size regime near
$T_c$ for $1/4 \lesssim \rho \lesssim 3$ and the region outside the central
finite-size regime well above and below $T_c$ for arbitrary $\rho$. At bulk
$T_c$ of isotropic systems with periodic b.c., we predict the critical Casimir
force in the vertical $(L)$ direction to be negative (attractive) for a slab
($\rho < 1$), positive (repulsive) for a rod ($\rho > 1$), and zero for a cube
$(\rho=1)$. We also present extrapolations to the cylinder limit
($\rho=\infty$) and to the film limit ($\rho=0$) for $n=1$ and $d=3$. Our
analytic results for finite-size scaling functions in the minimal
renormalization scheme at fixed dimension $d=3$ agree well with Monte Carlo
data for the three-dimensional Ising model by Hasenbusch for $\rho=1$ and by
Vasilyev et al. for $\rho=1/6$ above, at, and below $T_c$.
