Can somebody point me to software/code to extract a solenoidal (a.k.a. divergence-free) field from a 2D vector field numerically?
There are a plethora of papers and documents describing how to do this, but for some reason none of the authors (or anybody else for that matter) puts a simple piece of source code online implementing that functionality. All I found are rather huge packages or very cryptic pieces of code.
Update. More concretely for my situation: I have two 2D arrays of size 64x64 with double-precision floating point numbers. These two arrays represent the x- and y-velocities of a fluid flow. Periodic boundaries are employed. I would like to extract the solenoidal part of the velocities into two new 2D arrays.