diff options
author | 2020-01-24 16:44:11 -0800 | |
---|---|---|
committer | 2020-01-24 16:44:11 -0800 | |
commit | 3b2a9e7bd9d656c503324f502ff298239d448287 (patch) | |
tree | a3d85b12a9513150daf57ae7882d15c4e7803d4c /Source/WarpX.cpp | |
parent | c55c6188ea2dafdc72764fabb35f01d0431f12ce (diff) | |
download | WarpX-3b2a9e7bd9d656c503324f502ff298239d448287.tar.gz WarpX-3b2a9e7bd9d656c503324f502ff298239d448287.tar.zst WarpX-3b2a9e7bd9d656c503324f502ff298239d448287.zip |
Implement PR comments and fix compilation for PSATD
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r-- | Source/WarpX.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index c591a2856..c9084cd2a 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -893,11 +893,11 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm if (fft_hybrid_mpi_decomposition == false){ // Allocate and initialize the spectral solver std::array<Real,3> dx = CellSize(lev); - #if (AMREX_SPACEDIM == 3) +#if (AMREX_SPACEDIM == 3) RealVect dx_vect(dx[0], dx[1], dx[2]); - #elif (AMREX_SPACEDIM == 2) +#elif (AMREX_SPACEDIM == 2) RealVect dx_vect(dx[0], dx[2]); - #endif +#endif // Get the cell-centered box, with guard cells BoxArray realspace_ba = ba; // Copy box realspace_ba.enclosedCells().grow(ngE); // cell-centered + guard cells @@ -905,11 +905,10 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm spectral_solver_fp[lev].reset( new SpectralSolver( realspace_ba, dm, nox_fft, noy_fft, noz_fft, do_nodal, dx_vect, dt[lev] ) ); } -#else - std::array<Real,3> dx = CellSize(lev); - fdtd_solver_fp[lev].reset( - new FiniteDifferenceSolver(maxwell_fdtd_solver_id, dx) ); #endif + std::array<Real,3> const dx = CellSize(lev); + fdtd_solver_fp[lev].reset( + new FiniteDifferenceSolver(maxwell_fdtd_solver_id, dx) ); // // The Aux patch (i.e., the full solution) // @@ -981,11 +980,11 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm if (fft_hybrid_mpi_decomposition == false){ // Allocate and initialize the spectral solver std::array<Real,3> cdx = CellSize(lev-1); - #if (AMREX_SPACEDIM == 3) +#if (AMREX_SPACEDIM == 3) RealVect cdx_vect(cdx[0], cdx[1], cdx[2]); - #elif (AMREX_SPACEDIM == 2) +#elif (AMREX_SPACEDIM == 2) RealVect cdx_vect(cdx[0], cdx[2]); - #endif +#endif // Get the cell-centered box, with guard cells BoxArray realspace_ba = cba;// Copy box realspace_ba.enclosedCells().grow(ngE);// cell-centered + guard cells @@ -993,11 +992,10 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm spectral_solver_cp[lev].reset( new SpectralSolver( realspace_ba, dm, nox_fft, noy_fft, noz_fft, do_nodal, cdx_vect, dt[lev] ) ); } -#else +#endif std::array<Real,3> dx = CellSize(lev-1); fdtd_solver_cp[lev].reset( new FiniteDifferenceSolver( maxwell_fdtd_solver_id, dx ) ); -#endif } // |