Surface differential operators on the torus¶
Two models in this repository require surface differential operators:
The electrode model solves a Poisson equation on the surface (Laplace–Beltrami operator).
The current-potential model computes \(\nabla_s \Phi\) to obtain a divergence-free surface current.
Surface gradient¶
For a scalar field \(f(\theta,\phi)\) on a parameterized surface, the surface gradient can be written as:
where \(u^1=\theta\), \(u^2=\phi\), and \(g^{ij}\) is the inverse metric.
For the circular torus (orthogonal coordinates, \(F=0\)):
Laplace–Beltrami (surface Laplacian)¶
The Laplace–Beltrami operator is:
For the circular torus, with \(\sqrt{g}=aR(\theta)\), \(g^{\theta\theta}=1/a^2\), \(g^{\phi\phi}=1/R(\theta)^2\), this becomes:
Discretization and numerics in this code¶
Periodic grids¶
We discretize \(\theta\) and \(\phi\) on uniform periodic grids:
Spectral derivatives¶
Derivatives in \(\theta\) and \(\phi\) are computed using FFTs:
implemented in src/torus_solver/spectral.py.
Poisson solve¶
Because \(R(\theta)\) varies, \(\Delta_s\) is not diagonal in Fourier space, so the Poisson equation is solved with Conjugate Gradient (CG) using a matrix-free operator.
In the electrode model we solve (schematically):
with:
a net-zero constraint on \(s\) (closed surface)
a gauge fix on \(V\) (remove the constant nullspace)
See src/torus_solver/poisson.py.