So far I succeeded in drawing a simple grid along with it's centres using grid and nodes.
\draw[step=1] (0, 0) grid (4, 3);
\coordinate (a) at (0.4, 0.3);
\coordinate (b) at (3.8, 0.8);
\draw[fill=white,thick,->] (a) -- (b);
\foreach \x in {0.5, 1.5, 2.5, 3.5} {
\foreach \y in {0.5, 1.5, 2.5} {
\node at (\x, \y)[circle, fill=black, scale=0.25] {};
}
}
However the nodes representing the centroids of the cells, I would also like to add a vector field. The vectors in a column should point in the same direction, but along the x axis they should point more in the upward direction as one goes to the right side (like Pi/8, Pi/4, 3*Pi/4, etc). It's clear to me how this would be programmed in a "normal" programming language, but I don't see how this fits into TikZ's foreach loop..
Also I'm wondering weather it's possible to have a curvilinear grid instead of a simple rectangular.

