Skip to content

Commit

Permalink
integrate suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
aeriforme committed Dec 16, 2024
1 parent d2406f8 commit 1e2a239
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 31 deletions.
7 changes: 1 addition & 6 deletions Docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,19 +290,14 @@ 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`, 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").

* warpx.use_distributed_3d_fft_solver (`bool`, default: 0): Choose whether the 3D FFTs performed in the
full 3D Integrated Green Function solver are distributed.
If 0, the FFTs are performed on a single MPI rank (the rest of the code is still fully parallel).
If 1, the FFTs are distributed using the heFFTe library. The code must be compiled with `-DWarpX_HEFFTE=ON`.

* ``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

This file was deleted.

4 changes: 2 additions & 2 deletions Source/ablastr/fields/IntegratedGreenFunctionSolver.H
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace ablastr::fields
}


/** @brief Implements minus equation 58 in https://doi.org/10.1016/j.jcp.2004.01.008
/** @brief Implements equation 58 in https://doi.org/10.1016/j.jcp.2004.01.008
*
* @param[in] x x-coordinate of given location
* @param[in] y y-coordinate of given location
Expand Down Expand Up @@ -130,7 +130,7 @@ namespace ablastr::fields
amrex::MultiFab & phi,
std::array<amrex::Real, 3> const & cell_size,
amrex::BoxArray const & ba,
bool do_2d_slices);
bool is_igf_2d_slices);

} // namespace ablastr::fields

Expand Down
6 changes: 3 additions & 3 deletions Source/ablastr/fields/IntegratedGreenFunctionSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ computePhiIGF ( amrex::MultiFab const & rho,
amrex::MultiFab & phi,
std::array<amrex::Real, 3> const & cell_size,
amrex::BoxArray const & ba,
bool const do_2d_slices)
bool const is_igf_2d_slices)
{
using namespace amrex::literals;

Expand All @@ -59,7 +59,7 @@ computePhiIGF ( amrex::MultiFab const & rho,
}
if (!obc_solver || obc_solver->Domain() != domain) {
amrex::FFT::Info info{};
if (do_2d_slices) { info.setBatchMode(true); } // do 2D FFTs
if (is_igf_2d_slices) { info.setBatchMode(true); } // do 2D FFTs
info.setNumProcs(nprocs);
obc_solver = std::make_unique<amrex::FFT::OpenBCSolver<amrex::Real>>(domain, info);
}
Expand All @@ -69,7 +69,7 @@ computePhiIGF ( amrex::MultiFab const & rho,
amrex::Real const dy = cell_size[1];
amrex::Real const dz = cell_size[2];

if (!do_2d_slices){
if (!is_igf_2d_slices){
// 2D sliced solver
obc_solver->setGreensFunction(
[=] AMREX_GPU_DEVICE (int i, int j, int k) -> amrex::Real
Expand Down

0 comments on commit 1e2a239

Please sign in to comment.