Divergence of a vector $\mathbf{a}$ can be numerically written as, \begin{eqnarray} \nabla \cdot \mathbf{a} \approx \sum_{i=0-9} w_i\mathbf{a(x+c_i)}\cdot \mathbf{c}_i \end{eqnarray}
The lattice directions $\mathbf{c}_i$ for two dimensions can be seen in the following figure and weights $w_i$ are $4/9,1/9,1/36$ respectively for directions that have $0,1,\sqrt{2}$ distance from center.
I would like to check the error terms with above expression with Mathematica. I do not know how to expand a vector series so I started working on x component of $\mathbf{a} =f$ and proceeded as follows
c = {{0, 0}, {1, 0}, {0, 1}, {-1, 0}, {0, -1}, {1, 1}, {-1,
1}, {-1, -1}, {1, -1}}
w = {4/9, 1/9, 1/9, 1/9, 1/9, 1/36, 1/36, 1/36, 1/36}
Simplify[Normal[
Series[w[[2]] c[[2, 1]] f[(x + c[[2, 1]]) t, (y + c[[2, 2]]) t] +
w[[4]] c[[4, 1]] f[(x + c[[4, 1]]) t, (y + c[[4, 2]]) t] +
w[[3]] c[[3, 1]] f[(x + c[[3, 1]]) t, (y + c[[3, 2]]) t] +
w[[5]] c[[5, 1]] f[(x + c[[5, 1]]) t, (y + c[[5, 2]]) t] +
w[[6]] c[[6, 1]] f[(x + c[[6, 1]]) t, (y + c[[6, 2]]) t] +
w[[8]] c[[8, 1]] f[(x + c[[8, 1]]) t, (y + c[[8, 2]]) t] +
w[[7]] c[[7, 1]] f[(x + c[[7, 1]]) t, (y + c[[7, 2]]) t] +
w[[9]] c[[9, 1]] f[(x + c[[9, 1]]) t, (y + c[[9, 2]]) t], {t, 0,
4}]] /. t -> 1] /. {x -> 0, y -> 0}
Similar expression for y component of $\mathbf{a}=g$ can be derived and finally combined. Now my question is how to do it directly working with vectors, instead of components separately. Also I have used a brute force method for running over different lattices. How can I do it with more elegence?