diff --git a/Source/Diagnostics/ComputeDiagFunctors/JdispFunctor.cpp b/Source/Diagnostics/ComputeDiagFunctors/JdispFunctor.cpp index 79edab53272..5da5dbd193a 100644 --- a/Source/Diagnostics/ComputeDiagFunctors/JdispFunctor.cpp +++ b/Source/Diagnostics/ComputeDiagFunctors/JdispFunctor.cpp @@ -1,8 +1,11 @@ -/* This file is part of Warpx. +/* Copyright 2023-2024 The WarpX Community + * + * This file is part of WarpX. + * + * Authors: Avigdor Veksler (TAE Technologies) * - * Authors: Avigdor Veksler * License: BSD-3-Clause-LBNL -*/ + */ #include "JdispFunctor.H" #include "WarpX.H" @@ -61,51 +64,6 @@ JdispFunctor::operator() (amrex::MultiFab& mf_dst, int dcomp, const int /*i_buff -1, *mf_j, 0, 0, 1, Jdisp.nGrowVect() ); - if (hybrid_pic_model) { - // Subtract the interpolated j_external value from j_displacement. - /** pointer to external currents (Jext) multifab */ - amrex::MultiFab* mf_j_external = hybrid_pic_model->get_pointer_current_fp_external(m_lev, m_dir); - - // Index type required for interpolating Jext from their respective - // staggering (nodal) to the Jx_displacement, Jy_displacement, Jz_displacement - // locations. The staggering of J_displacement is the same as the - // staggering for J, so we use J_stag as the interpolation map. - // For interp to work below, the indices of the undefined dimensions - // must match. We set them as (1,1,1). - amrex::GpuArray Jext_IndexType = {1, 1, 1}; - amrex::GpuArray J_IndexType = {1, 1, 1}; - amrex::IntVect Jext_stag = mf_j_external->ixType().toIntVect(); - amrex::IntVect J_stag = mf_j->ixType().toIntVect(); - - // Index types for the dimensions simulated are overwritten. - for ( int idim = 0; idim < AMREX_SPACEDIM; ++idim) { - Jext_IndexType[idim] = Jext_stag[idim]; - J_IndexType[idim] = J_stag[idim]; - } - - // Parameters for `interp` that maps from Jext to J. - // The "coarsening is just 1 i.e. no coarsening" - amrex::GpuArray const& coarsen = {1, 1, 1}; - - // Loop through the grids, and over the tiles within each grid to - // subtract the interpolated Jext from J_displacement. -#ifdef AMREX_USE_OMP -#pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) -#endif - for ( MFIter mfi(Jdisp, TilingIfNotGPU()); mfi.isValid(); ++mfi ) { - - Array4 const& Jdisp_arr = Jdisp.array(mfi); - Array4 const& Jext = mf_j_external->const_array(mfi); - - // Loop over cells and update the Jdisp MultiFab - amrex::ParallelFor(mfi.tilebox(), [=] AMREX_GPU_DEVICE (int i, int j, int k){ - // Interpolate Jext to the staggering of J - auto const jext_interp = ablastr::coarsen::sample::Interp(Jext, Jext_IndexType, J_IndexType, coarsen, i, j, k, 0); - Jdisp_arr(i, j, k, 0) -= jext_interp; - }); - } - } - InterpolateMFForDiag(mf_dst, Jdisp, dcomp, warpx.DistributionMap(m_lev), m_convertRZmodes2cartesian); }