From 3d1b776e2273bb19c633a5d0c7bf1ed02fd9f66e Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Mon, 4 Dec 2017 12:34:38 -0800 Subject: Make the injection contiguous, even for at the first timestep --- Source/WarpXEvolve.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/WarpXEvolve.cpp') diff --git a/Source/WarpXEvolve.cpp b/Source/WarpXEvolve.cpp index 4bef3b2d0..b54b7f8b0 100644 --- a/Source/WarpXEvolve.cpp +++ b/Source/WarpXEvolve.cpp @@ -68,6 +68,7 @@ WarpX::EvolveES(int numsteps) { if (is_synchronized) { // on first step, push X by 0.5*dt mypc->PushXES(0.5*dt[lev]); + UpdatePlasmaInjectionPosition(0.5*dt[lev]); mypc->Redistribute(); mypc->DepositCharge(rhoNodal); computePhi(rhoNodal, phiNodal); @@ -92,6 +93,7 @@ WarpX::EvolveES(int numsteps) { if (cur_time + dt[0] >= stop_time - 1.e-3*dt[0] || step == numsteps_max-1) { // on last step, push by only 0.5*dt to synchronize all at n+1/2 mypc->PushXES(-0.5*dt[lev]); + UpdatePlasmaInjectionPosition(-0.5*dt[lev]); is_synchronized = true; } @@ -194,6 +196,7 @@ WarpX::EvolveEM (int numsteps) FillBoundaryB(); EvolveE(0.5*dt[0], DtType::SecondHalf); mypc->PushX(0.5*dt[0]); + UpdatePlasmaInjectionPosition(0.5*dt[0]); mypc->Redistribute(); // Redistribute particles is_synchronized = false; } @@ -226,6 +229,7 @@ WarpX::EvolveEM (int numsteps) // on last step, push by only 0.5*dt to synchronize all at n+1/2 EvolveE(0.5*dt[0], DtType::FirstHalf); // We now have E^{n+1/2} mypc->PushX(-0.5*dt[0]); + UpdatePlasmaInjectionPosition(-0.5*dt[0]); is_synchronized = true; } else { EvolveE(dt[0], DtType::Full); // We now have E^{n+1} -- cgit v1.2.3