|
IPPL (Independent Parallel Particle Layer)
IPPL
|
Different types of Poisson solvers and a biharmonic solver are available in IPPL.
Poisson solvers are numerical method used to solve Poisson's equation, a PDE that appears in many areas of physics. The equation is of the form:
\[ - \nabla^2 \phi = f \]
where \(\nabla^2 \) is the Laplace operator, \(\phi\) is the unknown function, and \( f \) is a given function.
IPPL provides different variants:
ippl::FFTPeriodicPoissonSolver: Solves Poisson equation with periodic bcs spectrally
ippl::FFTOpenPoissonSolver: Solves Poisson equation with Open BCs using FFTs (subtypes: Hockney (2nd order solver), Vico (spectral solver))
ippl::FFTTruncatedGreenSolver: Solves Poisson equation with periodic bcs, based on FFT
ippl::PoissonCG: Solves Poison equation with Conjugate Gradient method
All these inherit from the Poisson class.
The FFT based solvers are not available for 1D as heFFTe doesn't support 1D FFTs.
For Poisson equation solved with these different types of solvers see:
test/solver/TestFFTPeriodicPoissonSolver.cpp (for FFTPeriodicPoissonSolver)
test/solver/TestGaussian_convergence.cpp (for FFTOpenPoissonSolver)
test/solver/TestFFTTruncatedGreenSolver.cpp (for FFTTruncatedGreenSolver)
test/solver/TestCGSolver.cpp (for CG Poisson solver)
This section shows how to use the solvers. This example uses the FFTOpenPoissonSolver. The concepts used here are the same for the other solvers.
To start we define the mesh and the field types:
Then we need to define the solver type we want to use:
We define the parameters to pass to the solver. Consider the not declared variable to be your choice for your own simulation:
Now we can define the solver object and solve the Poisson equation:
The potential is stored in the rho Field. The E-Field is stored in the fieldE Field.
If you want to precondition the solver you can add following parameters to the parameter list: