From f316aa4e8c199e012ef04c26e1539dee8e682bd2 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Date: Wed, 20 Apr 2022 14:10:11 -0700 Subject: Current Deposition Interfaces: Always Pass `dt` & `relative_time` (#2937) * Current Deposition Interfaces: Always Pass `dt` & `relative_time` * Fix CI Failures * Fix 1D/RZ Warnings * Fix RZ Bug * Fix Bugs * Minimize Changes, Fix Roundoff Errors * Cleaning * Remove dt From doDepositionShapeN * Cleaning Esirkepov Deposition * Cleaning Vay Deposition * Fix Roundoff Errors * Fix Roundoff Errors (continued) * Fix Bug (RZ) --- Source/Particles/LaserParticleContainer.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'Source/Particles/LaserParticleContainer.cpp') diff --git a/Source/Particles/LaserParticleContainer.cpp b/Source/Particles/LaserParticleContainer.cpp index e29a401d0..22ffb2a5f 100644 --- a/Source/Particles/LaserParticleContainer.cpp +++ b/Source/Particles/LaserParticleContainer.cpp @@ -601,22 +601,25 @@ LaserParticleContainer::Evolve (int lev, amplitude_E.dataPtr(), dt); WARPX_PROFILE_VAR_STOP(blp_pp); - // // Current Deposition - // - // Deposit inside domains - if (! skip_deposition ) { + if (skip_deposition == false) + { + // Deposit at t_{n+1/2} + amrex::Real relative_time = -0.5_rt * dt; + int* ion_lev = nullptr; + // Deposit inside domains DepositCurrent(pti, wp, uxp, uyp, uzp, ion_lev, &jx, &jy, &jz, 0, np_current, thread_num, - lev, lev, dt, -0.5_rt); // Deposit current at t_{n+1/2} + lev, lev, dt, relative_time); - bool has_buffer = cjx; - if (has_buffer){ + const bool has_buffer = cjx; + if (has_buffer) + { // Deposit in buffers DepositCurrent(pti, wp, uxp, uyp, uzp, ion_lev, cjx, cjy, cjz, np_current, np-np_current, thread_num, - lev, lev-1, dt, -0.5_rt); // Deposit current at t_{n+1/2} + lev, lev-1, dt, relative_time); } } -- cgit v1.2.3