  Using Monte Carlo simulations we confirm that the rare-earth compound LiHoF4
is a very good realization of a dipolar Ising model. With only one free
parameter our calculations for the magnetization, specific heat and inverse
susceptibility match experimental data at a quantitative level in the single
Kelvin temperature range, including the ferromagnetic transition at 1.53 K.
Using parallel tempering methods and reaching system sizes up to 32000 dipoles
with periodic boundary conditions we are able to give strong direct evidence of
the logarithmic corrections predicted in renormalization group theory. Due to
the long range and angular dependence of the dipolar model sample shape and
domains play a crucial role in the ordered state. We go beyond Griffiths's
theorem and consider surface corrections arising in finite macroscopic samples
leading to a theory of magnetic domains. We predict that the ground-state
domain structure for cylinders with a demagnetization factor N>0 consists of
thin parallel sheets of opposite magnetization, with a width depending on the
demagnetization factor.
