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 Oct 4, 2024
1 parent 15e6d82 commit 2ff840b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public:
amrex::Real absolute_tolerance,
int max_iters,
int verbosity,
bool is_igf_2d_slices,
bool is_igf_2d_slices,
bool is_igf_3d_distributed
) const;

Expand Down
2 changes: 1 addition & 1 deletion Source/ablastr/fields/IntegratedGreenFunctionSolver.H
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ namespace ablastr::fields
amrex::MultiFab & phi,
std::array<amrex::Real, 3> const & cell_size,
amrex::BoxArray const & ba,
bool is_2d_slices,
bool is_2d_slices,
bool is_3d_distributed);

} // namespace ablastr::fields
Expand Down
18 changes: 9 additions & 9 deletions Source/ablastr/fields/IntegratedGreenFunctionSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ computePhiIGF ( amrex::MultiFab const & rho,
amrex::MultiFab & phi,
std::array<amrex::Real, 3> const & cell_size,
amrex::BoxArray const & ba,
bool const is_2d_slices,
bool const is_2d_slices,
bool const is_3d_distributed)
{
using namespace amrex::literals;
Expand Down Expand Up @@ -77,17 +77,17 @@ computePhiIGF ( amrex::MultiFab const & rho,
amrex::IntVect::TheNodeVector() );

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

if(is_2d_slices || is_3d_distributed){
arianna(realspace_box, realspace_ba, dm_global_fft);
arianna(realspace_box, realspace_ba, dm_global_fft);
}
else{
// Without distributed FFTs (i.e. without heFFTe):
// allocate the 2x wider array on a single box
realspace_ba = amrex::BoxArray(realspace_box);
// Define a distribution mapping for the global FFT, with only one box
dm_global_fft.define(realspace_ba);
dm_global_fft.define(realspace_ba);
}

// Allocate required arrays
Expand Down Expand Up @@ -139,10 +139,10 @@ computePhiIGF ( amrex::MultiFab const & rho,
if ((i0< nx)&&(j0< ny)) { tmp_G_arr(i,j,k) = SumOfIntegratedPotential2D(x, y, dx, dy); }
if ((i0< nx)&&(j0> ny)) { tmp_G_arr(i,j,k) = SumOfIntegratedPotential2D(x, y_hi-y, dx, dy); }
if ((i0> nx)&&(j0> ny)) { tmp_G_arr(i,j,k) = SumOfIntegratedPotential2D(x_hi-x, y_hi-y, dx, dy); }
if ((i0> nx)&&(j0< ny)) { tmp_G_arr(i,j,k) = SumOfIntegratedPotential2D(x_hi-x, y, dx, dy); }
if ((i0> nx)&&(j0< ny)) { tmp_G_arr(i,j,k) = SumOfIntegratedPotential2D(x_hi-x, y, dx, dy); }
} else {
int const k0 = k - lo[2];
amrex::Real const z = k0*dz;
amrex::Real const z = k0*dz;
#if defined(ABLASTR_USE_HEFFTE)
if (is_3d_distributed) {
// 3D with distributed FFTs (i.e. with heFFTe):
Expand All @@ -155,7 +155,7 @@ computePhiIGF ( amrex::MultiFab const & rho,
if ((i0> nx)&&(j0> ny)&&(k0> nz)) { tmp_G_arr(i,j,k) = SumOfIntegratedPotential3D(x_hi-x, y_hi-y, z_hi-z, dx, dy, dz); }
if ((i0> nx)&&(j0< ny)&&(k0< nz)) { tmp_G_arr(i,j,k) = SumOfIntegratedPotential3D(x_hi-x, y , z , dx, dy, dz); }
} else
#endif
#endif
{
// 3D without distributed FFTs (i.e. without heFFTe):
amrex::Real const G_value = SumOfIntegratedPotential3D(x , y , z , dx, dy, dz);
Expand All @@ -169,7 +169,7 @@ computePhiIGF ( amrex::MultiFab const & rho,
if ((i0>0)&&(k0>0)) {tmp_G_arr(hi[0]+1-i0, j , hi[2]+1-k0) = G_value;}
if ((i0>0)&&(j0>0)&&(k0>0)) {tmp_G_arr(hi[0]+1-i0, hi[1]+1-j0, hi[2]+1-k0) = G_value;}
}
}
}
}
);
}
Expand Down Expand Up @@ -252,7 +252,7 @@ computePhiIGF ( amrex::MultiFab const & rho,
const amrex::Real normalization = 1._rt / (nrx*nry);
tmp_G.mult( normalization );
} else {
#if defined(ABLASTR_USE_HEFFTE)
#if defined(ABLASTR_USE_HEFFTE)
if (is_3d_distributed) { // Fully 3d solver on many processes
// Create plans
BL_PROFILE_VAR_START(timer_plans);
Expand Down

0 comments on commit 2ff840b

Please sign in to comment.