aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r--Source/WarpX.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index e4ac79cec..967f69fdd 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -85,6 +85,9 @@ bool WarpX::use_fdtd_nci_corr = false;
int WarpX::l_lower_order_in_v = true;
bool WarpX::use_filter = false;
+bool WarpX::use_kspace_filter = false;
+bool WarpX::use_filter_compensation = false;
+
bool WarpX::serialize_ics = false;
bool WarpX::refine_plasma = false;
@@ -443,6 +446,8 @@ WarpX::ReadParameters ()
// Read filter and fill IntVect filter_npass_each_dir with
// proper size for AMREX_SPACEDIM
pp.query("use_filter", use_filter);
+ pp.query("use_kspace_filter", use_kspace_filter);
+ pp.query("use_filter_compensation", use_filter_compensation);
Vector<int> parse_filter_npass_each_dir(AMREX_SPACEDIM,1);
pp.queryarr("filter_npass_each_dir", parse_filter_npass_each_dir);
filter_npass_each_dir[0] = parse_filter_npass_each_dir[0];
@@ -948,6 +953,9 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
realspace_ba.grow(1, ngE[1]); // add guard cells only in z
spectral_solver_fp[lev].reset( new SpectralSolverRZ( realspace_ba, dm,
n_rz_azimuthal_modes, noz_fft, do_nodal, dx_vect, dt[lev], lev ) );
+ if (use_kspace_filter) {
+ spectral_solver_fp[lev]->InitFilter(filter_npass_each_dir, use_filter_compensation);
+ }
# else
if ( fft_periodic_single_box == false ) {
realspace_ba.grow(ngE); // add guard cells
@@ -1066,6 +1074,9 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
realspace_ba.grow(1, ngE[1]); // add guard cells only in z
spectral_solver_cp[lev].reset( new SpectralSolverRZ( realspace_ba, dm,
n_rz_azimuthal_modes, noz_fft, do_nodal, cdx_vect, dt[lev], lev ) );
+ if (use_kspace_filter) {
+ spectral_solver_cp[lev]->InitFilter(filter_npass_each_dir, use_filter_compensation);
+ }
# else
realspace_ba.grow(ngE); // add guard cells
spectral_solver_cp[lev].reset( new SpectralSolver( realspace_ba, dm,