Skip to content

Commit

Permalink
Adding more requirements to enable divergence cleaner by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkse committed Aug 19, 2024
1 parent 7b2a2b7 commit 882d14d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Source/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,16 @@ WarpX::ReadParameters ()
pp_warpx.query("do_dive_cleaning", do_dive_cleaning);
pp_warpx.query("do_divb_cleaning", do_divb_cleaning);

// Update default to external projection divb cleaner if external fields are loaded
// Update default to external projection divb cleaner if external fields are loaded,
// the grids are staggered, and the solver is compatible with the cleaner
if (m_p_ext_field_params->B_ext_grid_type != ExternalFieldType::default_zero
&& m_p_ext_field_params->B_ext_grid_type != ExternalFieldType::constant)
&& m_p_ext_field_params->B_ext_grid_type != ExternalFieldType::constant
&& grid_type != GridType::Collocated
&& (WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::Yee
|| WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::HybridPIC
|| ( (WarpX::electrostatic_solver_id == ElectrostaticSolverAlgo::LabFrame
|| WarpX::electrostatic_solver_id == ElectrostaticSolverAlgo::LabFrameElectroMagnetostatic)
&& WarpX::poisson_solver_id == PoissonSolverAlgo::Multigrid)))
{
do_divb_cleaning_external = true;
}
Expand Down

0 comments on commit 882d14d

Please sign in to comment.