title: Compute divergence of vector field using python
body: <p>Is there a function that could be used for calculation of the divergence of the vectorial field? (in <a href="http://www.mathworks.ch/help/techdoc/ref/divergence.html">matlab</a>) I would expect it exists in numpy/scipy but I can not find it using Google.</p>
  
  <p>I need to calculate <code>div[A * grad(F)]</code>, where </p>
  
  <pre><code>F = np.array([[1,2,3,4],[5,6,7,8]]) # (2D numpy ndarray)
  
  A = np.array([[1,2,3,4],[1,2,3,4]]) # (2D numpy ndarray)
  </code></pre>
  
  <p>so <code>grad(F)</code> is a list of 2D <code>ndarray</code>s</p>
  
  <p>I know I can calculate divergence like <a href="http://en.wikipedia.org/wiki/Divergence#Application_in_Cartesian_coordinates">this</a> but do not want to reinvent the wheel. (I would also expect something more optimized) Does anyone have suggestions?</p>