Short range interactions based on the Laplacian \( \Delta u_{i, j} \).
Each particle has still one degree of freedom, but interacts with four neighbours in a '2d' grid. The particle numbering is assumed to be as follows:
0 1 2 3 4
5 6 7 8 9
10 11 12 13 14
15 16 17 18 19
20 21 22 23 24
whereby the interaction kernal is:
+1
+1 -4 +1
+1
such that \( f_{i,j} = k (u_{i - 1, j} + u_{i + 1, j} + u_{i, j - 1} + u_{i, j + 1} - 4 u_{i, j}) \).
Indices
From Python you can access the indices as follows:
# array with 'spatial' organisation of the flat indices of particles
organisation = np.arange(rows * cols).reshape(rows, cols)
# flat particle indices of neighbours to all sides
down = np.roll(organisation, -1, axis=0)
up = np.roll(organisation, 1, axis=0)
left = np.roll(organisation, 1, axis=1)
right = np.roll(organisation, -1, axis=1)
Definition at line 524 of file detail.h.