Poisson says of the potential π:
β2π/βx2 + β2π/βy2 + β2π/βz2 = 4ΟΟ.
Ο = 0 outside the body and Ο = 1 inside.
Simple iteration of this numerically provides a relaxation scheme that might yet win out.
Maybe this would help.
A pressing problem is to decide how far outside the body we compute π and what boundary conditions to use there.
To first approximation we know the total mass m of the body and π=m/r there is an easy start.
There is the complexity to relate the mesh to the bodyβs boundary.
There are two potentials in this problem. The above π is just the gravitational potential. The one we use to redistribute mass is π + (rΟ)2/2.
First I presume a uniform square mesh. We need to make body boundary information readily accessible as we run thru the mesh. As we center a calculation on some mesh point we must know whether we and which of the six neighbors are in the body. The two body definitions that seem plausible in this context are the octree and tetrahedral decomposition.
For each case where of (x, y, z) two of those are multiples of Ξ΄ and for some triangle face (x, y, z) is in that face, make a record that identifies the point and the face. List sort these by z value and pocket sort them by x and y values.
I can use the Cornet alternating gradient scheme! (No!! It fails badly in a box where North & South walls are 0 and Ease & West walls are 1. π)