\subsection{Exact forces for accuracy checks}
\label{ssec:exact_forces}

To assess the accuracy of the gravity solver, \swift can also compute
the gravitational forces and potential for a subset of particles using
a simple direct summation method. This is obviously much slower and
should only be used for code testing purposes. The forces for a
selection of particles are computed every time-step if they are active
and dumped to a file alongside the forces computed by the FMM method.

In the case where periodic boundary conditions are used, we apply the
\cite{Ewald1921} summation technique to include the contribution to
the forces of all the infinite periodic replications of the particle
distribution. We use the approximation to the infinite series of terms
proposed by \cite{Hernquist1991}\footnote{Note, however, that there is
  a typo in their formula for the force correction terms
  (Eq. 2.14b). The correct expression is given by \cite{Klessen1997}
  \citep[see also][]{Hubber2011}.}, which we tabulate in one octant
using 64 equally spaced bins along each spatial direction spanning and
the range $[0,L]$, where $L$ is the side-length of the box.
