Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow-up: quasi-3D IGF solver #5516

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading