Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 19, 2024
1 parent 7553131 commit c0b3f4c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ Overall simulation parameters
In electrostatic mode, this solver requires open field boundary conditions (``boundary.field_lo,hi = open``).
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): if 0, solve Poisson equation in full 3D geometry with the
Integrated Green Function solver; if 1, solve Poisson equation in a quasi 3D geometry. In the latter case,
the code performes many 2D Poisson solves for each slice at a given :math:`z`.

* warpx.use_2d_slices_fft_solver (`bool`, default: 0): if 0, solve Poisson equation in full 3D geometry with the
Integrated Green Function solver; if 1, solve Poisson equation in a quasi 3D geometry. In the latter case,
the code performes many 2D Poisson solves for each slice at a given :math:`z`.

* ``warpx.self_fields_required_precision`` (`float`, default: 1.e-11)
The relative precision with which the electrostatic space-charge fields should
Expand Down
20 changes: 10 additions & 10 deletions Source/ablastr/fields/IntegratedGreenFunctionSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void
computePhiIGF ( amrex::MultiFab const & rho,
amrex::MultiFab & phi,
std::array<amrex::Real, 3> const & cell_size,
amrex::BoxArray const & ba,
amrex::BoxArray const & ba,
bool is_2d_slices)
{
using namespace amrex::literals;
Expand All @@ -60,16 +60,16 @@ computePhiIGF ( amrex::MultiFab const & rho,

// Allocate 2x wider (_big) arrays for the convolution of rho with the Green function
// The arrays are doubled in z only if the solver is full 3D
int const nx_big = 2*nx-1;
int const ny_big = 2*ny-1;
int const nx_big = 2*nx-1;
int const ny_big = 2*ny-1;
int const nz_big = (!is_2d_slices) ? 2*nz-1 : nz;

amrex::Box const realspace_box = amrex::Box(
{domain.smallEnd(0), domain.smallEnd(1), domain.smallEnd(2)},
{nx_big+domain.smallEnd(0), ny_big+domain.smallEnd(1), nz_big+domain.smallEnd(2)},
amrex::IntVect::TheNodeVector() );

amrex::BoxArray realspace_ba;
amrex::BoxArray realspace_ba;
amrex::DistributionMapping dm_global_fft;

// Define a new distribution mapping which is decomposed purely along z
Expand Down Expand Up @@ -134,7 +134,7 @@ computePhiIGF ( amrex::MultiFab const & rho,
amrex::Real const dx = cell_size[0];
amrex::Real const dy = cell_size[1];
amrex::Real const dz = cell_size[2];

amrex::Array4<amrex::Real> const tmp_G_arr = tmp_G.array(mfi);
amrex::ParallelFor( bx,
[=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
Expand Down Expand Up @@ -199,10 +199,10 @@ computePhiIGF ( amrex::MultiFab const & rho,
const int nsy = c_local_box.length(1);
const int nsz = c_local_box.length(2);

if(!is_2d_slices){
if(!is_2d_slices){

#if !defined(ABLASTR_USE_HEFFTE) // full 3d solver on 1 process
// Create the FFT plans
// Create the FFT plans
BL_PROFILE_VAR_START(timer_plans);
const amrex::IntVect fft_size = realspace_ba[local_boxid].length();
ablastr::math::anyfft::FFTplan forward_plan_rho = ablastr::math::anyfft::CreatePlan(
Expand Down Expand Up @@ -266,7 +266,7 @@ computePhiIGF ( amrex::MultiFab const & rho,
heffte_complex* rho_fft_data = (heffte_complex*) tmp_rho_fft.dataPtr();
heffte_complex* G_fft_data = (heffte_complex*) tmp_G_fft.dataPtr();

// Forward transforms of rho and G
// Forward transforms of rho and G
BL_PROFILE_VAR_START(timer_ffts);
fft.forward(tmp_rho[local_boxid].dataPtr(), rho_fft_data);
fft.forward(tmp_G[local_boxid].dataPtr(), G_fft_data);
Expand Down Expand Up @@ -309,7 +309,7 @@ computePhiIGF ( amrex::MultiFab const & rho,
nsz, NULL, 1, nsx*nsy, NULL, 1, nrx*nry);
BL_PROFILE_VAR_STOP(timer_plans);

// Forward transforms of rho and G
// Forward transforms of rho and G
BL_PROFILE_VAR_START(timer_ffts);
ablastr::math::anyfft::Execute(forward_plan_rho);
ablastr::math::anyfft::Execute(forward_plan_G);
Expand All @@ -335,7 +335,7 @@ computePhiIGF ( amrex::MultiFab const & rho,
tmp_G.mult( normalization );
}
}

// Copy from tmp_G to phi
BL_PROFILE_VAR_START(timer_pcopies);
phi.ParallelCopy( tmp_G, 0, 0, 1, amrex::IntVect::TheZeroVector(), phi.nGrowVect() );
Expand Down

0 comments on commit c0b3f4c

Please sign in to comment.