aboutsummaryrefslogtreecommitdiff
path: root/Source/BoundaryConditions/PML.cpp
diff options
context:
space:
mode:
authorGravatar Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> 2021-10-12 02:39:58 +0200
committerGravatar GitHub <noreply@github.com> 2021-10-11 17:39:58 -0700
commit5a12391f0c2350e9083bf3138da210eb81707e6e (patch)
tree5755fcbc17dfd120e2f3ad8fd019de7b15aca24f /Source/BoundaryConditions/PML.cpp
parentd367eb0c15c36baf390d0c9ec7bc068fe25490b7 (diff)
downloadWarpX-5a12391f0c2350e9083bf3138da210eb81707e6e.tar.gz
WarpX-5a12391f0c2350e9083bf3138da210eb81707e6e.tar.zst
WarpX-5a12391f0c2350e9083bf3138da210eb81707e6e.zip
Use parser for more input parameters (#2386)
* Use parser for more input parameters * Fix PSATD compilation and apply suggestions from code review * Avoid out of bound array access for num_particles_per_cell_each_dim * Fix few input files with respect to num_particles_per_cell_each_dim * Fix get that incorrectly became query
Diffstat (limited to 'Source/BoundaryConditions/PML.cpp')
-rw-r--r--Source/BoundaryConditions/PML.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/BoundaryConditions/PML.cpp b/Source/BoundaryConditions/PML.cpp
index 93e74d9d6..50233f2c8 100644
--- a/Source/BoundaryConditions/PML.cpp
+++ b/Source/BoundaryConditions/PML.cpp
@@ -506,9 +506,9 @@ PML::PML (const int lev, const BoxArray& grid_ba, const DistributionMapping& /*g
int ngFFt_z = do_nodal ? noz_fft : noz_fft/2;
ParmParse pp_psatd("psatd");
- pp_psatd.query("nx_guard", ngFFt_x);
- pp_psatd.query("ny_guard", ngFFt_y);
- pp_psatd.query("nz_guard", ngFFt_z);
+ queryWithParser(pp_psatd, "nx_guard", ngFFt_x);
+ queryWithParser(pp_psatd, "ny_guard", ngFFt_y);
+ queryWithParser(pp_psatd, "nz_guard", ngFFt_z);
#if (AMREX_SPACEDIM == 3)
IntVect ngFFT = IntVect(ngFFt_x, ngFFt_y, ngFFt_z);
@@ -599,8 +599,8 @@ PML::PML (const int lev, const BoxArray& grid_ba, const DistributionMapping& /*g
const RealVect dx{AMREX_D_DECL(geom->CellSize(0), geom->CellSize(1), geom->CellSize(2))};
// Get the cell-centered box, with guard cells
BoxArray realspace_ba = ba; // Copy box
- Array<Real,3> const v_galilean_zero = {0., 0., 0.};
- Array<Real,3> const v_comoving_zero = {0., 0., 0.};
+ amrex::Vector<amrex::Real> const v_galilean_zero = {0., 0., 0.};
+ amrex::Vector<amrex::Real> const v_comoving_zero = {0., 0., 0.};
realspace_ba.enclosedCells().grow(nge); // cell-centered + guard cells
spectral_solver_fp = std::make_unique<SpectralSolver>(lev, realspace_ba, dm,
nox_fft, noy_fft, noz_fft, do_nodal, WarpX::fill_guards, v_galilean_zero,
@@ -707,8 +707,8 @@ PML::PML (const int lev, const BoxArray& grid_ba, const DistributionMapping& /*g
const RealVect cdx{AMREX_D_DECL(cgeom->CellSize(0), cgeom->CellSize(1), cgeom->CellSize(2))};
// Get the cell-centered box, with guard cells
BoxArray realspace_cba = cba; // Copy box
- Array<Real,3> const v_galilean_zero = {0., 0., 0.};
- Array<Real,3> const v_comoving_zero = {0., 0., 0.};
+ amrex::Vector<amrex::Real> const v_galilean_zero = {0., 0., 0.};
+ amrex::Vector<amrex::Real> const v_comoving_zero = {0., 0., 0.};
realspace_cba.enclosedCells().grow(nge); // cell-centered + guard cells
spectral_solver_cp = std::make_unique<SpectralSolver>(lev, realspace_cba, cdm,
nox_fft, noy_fft, noz_fft, do_nodal, WarpX::fill_guards, v_galilean_zero,