Cubic polytrope fails isolated gravitational matching (source code)

= Cubic polytrope fails isolated gravitational matching

For the <cubic polytropic interior>, $\nabla\rho$ vanishes at each vertex, so the locally defined potential $\Phi=C-2K\rho$ predicts zero gravitational acceleration there. But at the vertex $(0,0,0)$, the actual self-gravitational acceleration of the positive mass distribution is
$$
\mathbf g(0)=G\int_{[0,L]^3}\rho(\mathbf r')\frac{\mathbf r'}{|\mathbf r'|^3}\,d^3r',
$$
whose three components are strictly positive. The fields cannot match continuously. Thus the interior <Helmholtz equation> and zero density on the faces do not construct an isolated static cubic star. External stresses or an external gravitational field would be needed to realize such a boundary-value construction.