Suppose $f=f(t,x,v)$ with $t\geq 0, x\in\mathbb{T}^1, v\in\mathbb{R}$. Here, $\mathbb{T}^1$ is the one-dimensional torus.
The torus is discretized into $N$ subintervals $X_i:=\left(x_{i-\frac{1}{2}}, x_{i+\frac{1}{2}}\right)$.
Then, I have (applying the divergence theorem of Gauss),
$$ \int_{x_{i-\frac{1}{2}}}^{x_{i+\frac{1}{2}}} \frac{\partial f}{\partial x}\, dx=\int_{\partial X_i} f\cdot n\, dS $$
I have some problems to "compute" the integral on the right-hand side.
I think that $\partial X_i$ consists of the endpoints of $X_i$, that is, $\partial X_i=\{x_{i-\frac{1}{2}},x_{i+\frac{1}{2}}\}$
This is fundamental thoerem of calculus in disguise. $f$ is a function over $\mathbb{R}$ and need not be viewed over $T^1$. The only constraint is that the function $f$ has to be periodic w.r.t intervals $X_i$. So i would think $f(x_{i-1/2})-f(x_{i+1/2}) = 0$ if $f$ is continuous on the $T^1$.
Hence, $$\int_{X_i} \frac{\partial f}{\partial x} dx = \int_{\partial X_i} f(x).n dS = f(x_{i-1/2})-f(x_{i+1/2})$$
This is because $n dS$ is a zero dimensional normal $n$ with zero dimension measure $dS$. Hence $n dS$ is a counting measure.