<p>Nor will you ever understand how to calculate such a derivative, because technically, it isn't possible. You can only ever interpolate a true discrete derivative over cells back to cells, but it isn't defined there.</p>

<p>Now that does not sound very helpful, I know, and I cannot really explain all that very well in the space given here. But if you want to do yourself a favor, read up on discrete exterior calculus. It may sound like a bit of scary terminology at first, but it will make your life a lot easier, quite fast.</p>

<p>Try google, or start following references here: <a href="http://arxiv.org/abs/1103.3076" rel="nofollow">http://arxiv.org/abs/1103.3076</a></p>
Calculating derivative of quantities in a 2D and 3D meshes
<p>I am new to physics of games. I have a problem where i have a 2D or 3D mesh. The computational cells are triangles or tetrahedrons respectively. Certain physical quantities like density and energy are given at cell centers as cell centered averages. I need to compute the gradient of these quantities at the center of all the cells in the mesh.</p>

<p>I understand that in 1D, the derivative of a quantity in a cell (i) can be calculated by dividing the difference of values of that quantity in the neighboring cells (i+1,i-1) by the distance between them (central difference formula). What i don't understand is to solve this problem on an arbitrary 2D or 3D mesh?</p>

<p>Can i get reference to some literature where i can get such numerical methods/algorithms ?</p>

<p>Thanks in advance.</p>