Skip to content

Commit

Permalink
Set use_filter false for implicit evolve schemes (#5453)
Browse files Browse the repository at this point in the history
This PR sets the `use_filter` input parameter to false by default for
the implicit evolve schemes.

Note that this does not affect any of the related CI tests since the
parameter is explicitly specified in all cases.
  • Loading branch information
dpgrote authored Nov 12, 2024
1 parent 1b27071 commit 4a2590e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 6 additions & 3 deletions Docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2186,10 +2186,13 @@ Time step
Filtering
^^^^^^^^^

* ``warpx.use_filter`` (`0` or `1`; default: `1`, except for RZ FDTD)
Whether to smooth the charge and currents on the mesh, after depositing them from the macro-particles.
* ``warpx.use_filter`` (`0` or `1`)
Whether to use filtering in the simulation.
With the explicit evolve scheme, the filtering is turned on by default, except for RZ FDTD.
With the implicit evolve schemes, the filtering is turned off by default.
The filtering smoothes the charge and currents on the mesh, after depositing them from the macro-particles.
With implicit schemes, the electric field is also filtered (to maintain consistency for energy conservation).
This uses a bilinear filter (see the :ref:`filtering section <theory-pic-filter>`).
The default is `1` in all cases, except for simulations in RZ geometry using the FDTD solver.
With the RZ PSATD solver, the filtering is done in :math:`k`-space.

.. warning::
Expand Down
7 changes: 6 additions & 1 deletion Source/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ WarpX::ReadParameters ()
if (electromagnetic_solver_id == ElectromagneticSolverAlgo::ECT && !EB::enabled()) {
throw std::runtime_error("ECP Solver requires to enable embedded boundaries at runtime.");
}
pp_algo.query_enum_sloppy("evolve_scheme", evolve_scheme, "-_");
}

{
Expand Down Expand Up @@ -706,6 +707,11 @@ WarpX::ReadParameters ()
pp_warpx.queryarr("dt_update_interval", dt_interval_vec);
dt_update_interval = utils::parser::IntervalsParser(dt_interval_vec);

// Filter defaults to true for the explicit scheme, and false for the implicit schemes
if (evolve_scheme != EvolveScheme::Explicit) {
use_filter = false;
}

// Filter currently not working with FDTD solver in RZ geometry: turn OFF by default
// (see https://github.com/ECP-WarpX/WarpX/issues/1943)
#ifdef WARPX_DIM_RZ
Expand Down Expand Up @@ -1113,7 +1119,6 @@ WarpX::ReadParameters ()
pp_algo.query_enum_sloppy("current_deposition", current_deposition_algo, "-_");
pp_algo.query_enum_sloppy("charge_deposition", charge_deposition_algo, "-_");
pp_algo.query_enum_sloppy("particle_pusher", particle_pusher_algo, "-_");
pp_algo.query_enum_sloppy("evolve_scheme", evolve_scheme, "-_");

// check for implicit evolve scheme
if (evolve_scheme == EvolveScheme::SemiImplicitEM) {
Expand Down

0 comments on commit 4a2590e

Please sign in to comment.