If I have a function $f(\mathbf{x})$ defined over $\mathbb{R}^3$ and wish to make a Fourier transform of this function, I do
\begin{equation} f(\mathbf{x})=\int_{\mathbb{R}^3}\hat{f}(\mathbf{k})e^{2\pi i \mathbf{x} \cdot \mathbf{k}} d^3k, \end{equation} up to some normalization factor, which is equivalent to expanding $f(\mathbf{x})$ in a basis of plane waves.
The question is, if $f$ is defined instead over the three-torus $\mathbb{T}^3$ or perhaps $\mathbb{T}^2 \times \mathbb{R}$ or $S^1 \times \mathbb{R}^2$, then how do I go about doing this Fourier transform?
My first instinct is to say that a periodic boundary condition in the $i^\text{th}$ dimension would make the wave modes in that direction discrete:
\begin{equation} k=\frac{2\pi}{L_i}n_i, \end{equation}
for all integers $n_i$ given the torus length $L_i$. This would then change the integral over wave-vectors in that direction to a summation:
\begin{equation} \int dk \to \frac{1}{L_i}\sum_{k}, \end{equation} and continue with the analysis as before. Is this the correct approach? Thanks for any help!