diff --git a/Source/Diagnostics/ComputeDiagFunctors/EdotBFunctor.cpp b/Source/Diagnostics/ComputeDiagFunctors/EdotBFunctor.cpp index dea8db37e91..32fe74daed6 100644 --- a/Source/Diagnostics/ComputeDiagFunctors/EdotBFunctor.cpp +++ b/Source/Diagnostics/ComputeDiagFunctors/EdotBFunctor.cpp @@ -1,5 +1,12 @@ #include "EdotBFunctor.H" #include "Utils/CoarsenIO.H" +#include "WarpX.H" +#include +#include +#include +#include +#include +#include #include @@ -15,25 +22,26 @@ EdotBFunctor::EdotBFunctor (amrex::MultiFab const * Ex_src, amrex::MultiFab cons void EdotBFunctor::operator ()(amrex::MultiFab& mf_dst, int dcomp, const int /*i_buffer=0*/) const { + using namespace amrex; auto & warpx = WarpX::GetInstance(); const auto dx = warpx.Geom(m_lev).CellSizeArray(); const auto problo = warpx.Geom(m_lev).ProbLoArray(); const auto probhi = warpx.Geom(m_lev).ProbHiArray(); - const IntVect stag_Exsrc = m_Ex_src->ixType().toIntVect(); - const IntVect stag_Eysrc = m_Ey_src->ixType().toIntVect(); - const IntVect stag_Ezsrc = m_Ez_src->ixType().toIntVect(); - const IntVect stag_Bxsrc = m_Bx_src->ixType().toIntVect(); - const IntVect stag_Bysrc = m_By_src->ixType().toIntVect(); - const IntVect stag_Bzsrc = m_Bz_src->ixType().toIntVect(); - const IntVect stag_dst = mf_dst.ixType().toIntVect(); - GpuArray sf_Ex; // staggering of source xfield - GpuArray sf_Ey; // staggering of source yfield - GpuArray sf_Ez; // staggering of source zfield - GpuArray sf_Bx; // staggering of source xfield - GpuArray sf_By; // staggering of source yfield - GpuArray sf_Bz; // staggering of source zfield - GpuArray s_dst; - GpuArray cr; + const amrex::IntVect stag_Exsrc = m_Ex_src->ixType().toIntVect(); + const amrex::IntVect stag_Eysrc = m_Ey_src->ixType().toIntVect(); + const amrex::IntVect stag_Ezsrc = m_Ez_src->ixType().toIntVect(); + const amrex::IntVect stag_Bxsrc = m_Bx_src->ixType().toIntVect(); + const amrex::IntVect stag_Bysrc = m_By_src->ixType().toIntVect(); + const amrex::IntVect stag_Bzsrc = m_Bz_src->ixType().toIntVect(); + const amrex::IntVect stag_dst = mf_dst.ixType().toIntVect(); + amrex::GpuArray sf_Ex; // staggering of source xfield + amrex::GpuArray sf_Ey; // staggering of source yfield + amrex::GpuArray sf_Ez; // staggering of source zfield + amrex::GpuArray sf_Bx; // staggering of source xfield + amrex::GpuArray sf_By; // staggering of source yfield + amrex::GpuArray sf_Bz; // staggering of source zfield + amrex::GpuArray s_dst; + amrex::GpuArray cr; for (int i=0; i +#include +#include +#include +#include +#include #include PoyntingVectorFunctor::PoyntingVectorFunctor ( @@ -19,25 +25,26 @@ void PoyntingVectorFunctor::operator ()(amrex::MultiFab& mf_dst, int dcomp, const int /*i_buffer=0*/) const { + using namespace amrex; auto & warpx = WarpX::GetInstance(); const auto dx = warpx.Geom(m_lev).CellSizeArray(); const auto problo = warpx.Geom(m_lev).ProbLoArray(); const auto probhi = warpx.Geom(m_lev).ProbHiArray(); - const IntVect stag_Exsrc = m_Ex_src->ixType().toIntVect(); - const IntVect stag_Eysrc = m_Ey_src->ixType().toIntVect(); - const IntVect stag_Ezsrc = m_Ez_src->ixType().toIntVect(); - const IntVect stag_Bxsrc = m_Bx_src->ixType().toIntVect(); - const IntVect stag_Bysrc = m_By_src->ixType().toIntVect(); - const IntVect stag_Bzsrc = m_Bz_src->ixType().toIntVect(); - const IntVect stag_dst = mf_dst.ixType().toIntVect(); - GpuArray sf_Ex; // staggering of source xfield - GpuArray sf_Ey; // staggering of source yfield - GpuArray sf_Ez; // staggering of source zfield - GpuArray sf_Bx; // staggering of source xfield - GpuArray sf_By; // staggering of source yfield - GpuArray sf_Bz; // staggering of source zfield - GpuArray s_dst; - GpuArray cr; + const amrex::IntVect stag_Exsrc = m_Ex_src->ixType().toIntVect(); + const amrex::IntVect stag_Eysrc = m_Ey_src->ixType().toIntVect(); + const amrex::IntVect stag_Ezsrc = m_Ez_src->ixType().toIntVect(); + const amrex::IntVect stag_Bxsrc = m_Bx_src->ixType().toIntVect(); + const amrex::IntVect stag_Bysrc = m_By_src->ixType().toIntVect(); + const amrex::IntVect stag_Bzsrc = m_Bz_src->ixType().toIntVect(); + const amrex::IntVect stag_dst = mf_dst.ixType().toIntVect(); + amrex::GpuArray sf_Ex; // staggering of source xfield + amrex::GpuArray sf_Ey; // staggering of source yfield + amrex::GpuArray sf_Ez; // staggering of source zfield + amrex::GpuArray sf_Bx; // staggering of source xfield + amrex::GpuArray sf_By; // staggering of source yfield + amrex::GpuArray sf_Bz; // staggering of source zfield + amrex::GpuArray s_dst; + amrex::GpuArray cr; for (int i=0; i #include +#include +#include +#include +#include SphericalComponentFunctor::SphericalComponentFunctor (amrex::MultiFab const * mfx_src, amrex::MultiFab const * mfy_src, @@ -21,19 +26,20 @@ SphericalComponentFunctor::SphericalComponentFunctor (amrex::MultiFab const * mf void SphericalComponentFunctor::operator ()(amrex::MultiFab& mf_dst, int dcomp, const int /*i_buffer=0*/) const { + using namespace amrex; auto & warpx = WarpX::GetInstance(); const auto dx = warpx.Geom(m_lev).CellSizeArray(); const auto problo = warpx.Geom(m_lev).ProbLoArray(); const auto probhi = warpx.Geom(m_lev).ProbHiArray(); - const IntVect stag_xsrc = m_mfx_src->ixType().toIntVect(); - const IntVect stag_ysrc = m_mfy_src->ixType().toIntVect(); - const IntVect stag_zsrc = m_mfz_src->ixType().toIntVect(); - const IntVect stag_dst = mf_dst.ixType().toIntVect(); - GpuArray sfx; // staggering of source xfield - GpuArray sfy; // staggering of source yfield - GpuArray sfz; // staggering of source zfield - GpuArray s_dst; - GpuArray cr; + const amrex::IntVect stag_xsrc = m_mfx_src->ixType().toIntVect(); + const amrex::IntVect stag_ysrc = m_mfy_src->ixType().toIntVect(); + const amrex::IntVect stag_zsrc = m_mfz_src->ixType().toIntVect(); + const amrex::IntVect stag_dst = mf_dst.ixType().toIntVect(); + amrex::GpuArray sfx; // staggering of source xfield + amrex::GpuArray sfy; // staggering of source yfield + amrex::GpuArray sfz; // staggering of source zfield + amrex::GpuArray s_dst; + amrex::GpuArray cr; for (int i=0; iradially_weighted; #endif + int Nmax_particles = 0; + int valid_particles_beforeAdd = TotalNumberOfParticles(); + MFItInfo info; if (do_tiling && Gpu::notInLaunchRegion()) { info.EnableTiling(tile_size); @@ -1389,6 +1392,7 @@ PhysicalParticleContainer::AddPlasmaFlux (int lev, amrex::Real dt) // Max number of new particles. All of them are created, // and invalid ones are then discarded int max_new_particles = Scan::ExclusiveSum(counts.size(), counts.data(), offset.data()); + Nmax_particles += max_new_particles; // Update NextID to include particles created in this function Long pid;