Say we have a Poisson problem:
$\nabla^2 \varphi = S$
As a boundary value problem, it requires the definition of boundary conditions on all surfaces of the domain. If we assume there is a vector field $\vec{v}$ that satisfies:
$\nabla \cdot \vec{v} = S$
Then solving the Poisson problem can be rewritten:
$\nabla \cdot (\nabla \varphi) = \nabla \cdot \vec{v}$
$\nabla \varphi = \vec{v}$
The latter equation can be integrated up to a constant with an omnidirectional integrator without requiring any boundary conditions.
My questions are:
- Is $\vec{v}$ unique to a constant?
- If infinite solutions for $\vec{v}$ are possible, do all of them yield the same $\varphi$?
- How to solve for $\vec{v}(x,y,z)$ for a general scalar field $S(x,y,z)$?
After doing some more research I found this answer on Quora:
https://www.quora.com/How-can-I-find-the-vector-field-having-its-divergence/answer/Tipper-Rumpf?ch=10&oid=106729750&share=4afbbd75&srid=hNudm7&target_type=answer
I guess what I was asking is if the divergence operator can be inverted as Tipper Rumpf replied. Looks like for a continuous field there are multiple solutions because it's an underdefined problem. In the discrete form, we can write $\nabla \cdot \vec{v}=S$ as:
$\begin{bmatrix} D_x & D_y & D_z \end{bmatrix}\begin{bmatrix} v_x \\ v_y \\ v_z \end{bmatrix}=\big[S\big]$
where $D$ is the discrete divergence operator.For a grid with $N$ elements, we have $N$ equations and $3N$ unknowns, so there are infinite solutions.
Anyways, hope this helps others in the future. Thanks!