  Finite-size effects are investigated in the Gaussian model with isotropic and
anisotropic short-range interactions in film geometry with nonperiodic boundary
conditions (b.c). We have obtained exact results for the free energy and the
Casimir force for antiperiodic, Neumann, Dirichlet, and Neumann-Dirichlet mixed
b.c. in 1<d<4 dimensions. For the Casimir force, finite-size scaling is found
to be valid for all b.c.. For the free energy, finite-size scaling is valid in
1<d<3 and 3<d<4 dimensions for antiperiodic, Neumann, and Dirichlet b.c., but
logarithmic deviations from finite-size scaling exist in d=3 dimensions for
Neumann and Dirichlet b.c.. This is explained in terms of the borderline
dimension d*=3, where the critical exponent of the Gaussian surface energy
density vanishes. For Neumann-Dirichlet b.c., finite-size scaling is strongly
violated above T_c for 1<d<4. Our results include an exact description of the
dimensional crossover between the d-dimensional finite-size critical behavior
near bulk T_c and the (d-1)-dimensional critical behavior near T_c,film(L).
This dimensional crossover is illustrated for the critical behavior of the
specific heat. For 2<d<4, the Gaussian results are reformulated as one-loop
contributions of the phi^4 theory at fixed dimension and are compared with the
epsilon=4-d expansion results as well as with d=3 Monte Carlo data. For d=2,
the Gaussian results for the Casimir force scaling function are compared with
those for the Ising model; unexpected exact relations are found between the
Gaussian and Ising scaling functions. For both the Gaussian and the Ising model
it is shown that anisotropic couplings imply nonuniversal scaling functions of
the Casimir force. Our Gaussian results provide the basis for the investigation
of finite-size effects of the mean spherical model with nonperiodic b.c..
