Skip to content

Commit

Permalink
Follow-up: quasi-3D IGF solver (#5516)
Browse files Browse the repository at this point in the history
This is a minor follow-up to PR #5089.
It fixes two comments and adds the documentation entry about
`ablastr.nprocs_igf_fft`.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
aeriforme and pre-commit-ci[bot] authored Dec 18, 2024
1 parent 2cdcb77 commit b4eebb9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion Docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,21 @@ Overall simulation parameters
In electromagnetic mode, this solver can be used to initialize the species' self fields
(``<species_name>.initialize_self_fields=1``) provided that the field BCs are PML (``boundary.field_lo,hi = PML``).

* ``warpx.use_2d_slices_fft_solver`` (`bool`, default: 0): Select the type of Integrated Green Function solver.
* ``warpx.use_2d_slices_fft_solver`` (`bool`) optional (default: 0): Select the type of Integrated Green Function solver.
If 0, solve Poisson equation in full 3D geometry.
If 1, solve Poisson equation in a quasi 3D geometry, neglecting the :math:`z` derivatives in the Laplacian of the Poisson equation.
In practice, in this case, the code performes many 2D Poisson solves on all :math:`(x,y)` slices, each slice at a given :math:`z`.
This is often a good approximation for ultra-relativistic beams propagating along the :math:`z` direction, with the relativistic solver.
As a consequence, this solver does not need to do an FFT along the :math:`z` direction,
and instead uses only transverse FFTs (along :math:`x` and :math:`y`) at each :math:`z` position (or :math:`z` "slice").

* ``ablastr.nprocs_igf_fft`` (`int`) optional (default: number of MPI ranks): Number of MPI ranks used to parallalelize the FFT solver.
This can be less or equal than then number of MPI ranks that are used to run the overall simulation.
It can be useful if the auxiliary simulation boxes fit within a single process, so to avoid extra communications.
The auxiliary boxes are extended boxes in real and spectral space that are used to perform the necessary FFTs.
The extended simulation box size in real space is :math:`2n_x-1, 2n_y-1, 2n_z-1` with the 3D solver, :math:`2n_x-1, 2n_y -1, n_z` with the 2D solver.
The extended simulation box size in spectral space is :math:`n_x, 2n_y-1, 2n_z-1` with the 3D solver, :math:`n_x, 2n_y-1, n_z` with the 2D solver.

* ``warpx.self_fields_required_precision`` (`float`, default: 1.e-11)
The relative precision with which the electrostatic space-charge fields should
be calculated. More specifically, the space-charge fields are
Expand Down
4 changes: 2 additions & 2 deletions Source/ablastr/fields/IntegratedGreenFunctionSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ computePhiIGF ( amrex::MultiFab const & rho,
amrex::Real const dz = cell_size[2];

if (!is_igf_2d_slices){
// 2D sliced solver
// fully 3D solver
obc_solver->setGreensFunction(
[=] AMREX_GPU_DEVICE (int i, int j, int k) -> amrex::Real
{
Expand All @@ -84,7 +84,7 @@ computePhiIGF ( amrex::MultiFab const & rho,
return SumOfIntegratedPotential3D(x, y, z, dx, dy, dz);
});
}else{
// fully 3D solver
// 2D sliced solver
obc_solver->setGreensFunction(
[=] AMREX_GPU_DEVICE (int i, int j, int k) -> amrex::Real
{
Expand Down

0 comments on commit b4eebb9

Please sign in to comment.