Skip to content

Commit b71cf30

Browse files
allow dt update based on particle CFL for theta implicit solver.
1 parent a51b0f5 commit b71cf30

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Source/Evolve/WarpXEvolve.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ WarpX::Evolve (int numsteps)
192192

193193
// Update timestep for electrostatic solver if a constant dt is not provided
194194
// This first synchronizes the position and velocity before setting the new timestep
195-
if (electromagnetic_solver_id == ElectromagneticSolverAlgo::None &&
195+
if ((electromagnetic_solver_id == ElectromagneticSolverAlgo::None ||
196+
evolve_scheme == EvolveScheme::ThetaImplicitEM) &&
196197
!m_const_dt.has_value() && m_dt_update_interval.contains(step+1)) {
197198
if (verbose_step) {
198199
amrex::Print() << Utils::TextMsg::Info("updating timestep");
@@ -384,13 +385,13 @@ void WarpX::OneStep (
384385

385386
// implicit solver
386387
if (m_implicit_solver) {
388+
// advance fields and particles by one time step
389+
m_implicit_solver->OneStep(a_cur_time, a_dt, a_step);
390+
387391
// perform particle collisions
388392
ExecutePythonCallback("beforecollisions");
389393
mypc->doCollisions(a_step, a_cur_time, a_dt);
390394
ExecutePythonCallback("aftercollisions");
391-
392-
// advance fields and particles by one time step
393-
m_implicit_solver->OneStep(a_cur_time, a_dt, a_step);
394395
}
395396
// explicit solver
396397
else {

0 commit comments

Comments
 (0)