Skip to content

Commit

Permalink
fix compilation error after rebase with Pulsar_Development
Browse files Browse the repository at this point in the history
  • Loading branch information
RevathiJambunathan committed Sep 10, 2021
1 parent b059f1b commit 31b0cb2
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 41 deletions.
38 changes: 23 additions & 15 deletions Source/Diagnostics/ComputeDiagFunctors/EdotBFunctor.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#include "EdotBFunctor.H"
#include "Utils/CoarsenIO.H"
#include "WarpX.H"
#include <AMReX_IntVect.H>
#include <AMReX.H>
#include <AMReX_GpuControl.H>
#include <AMReX_GpuDevice.H>
#include <AMReX_GpuLaunch.H>
#include <AMReX_GpuQualifiers.H>

#include <AMReX.H>

Expand All @@ -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<int,3> sf_Ex; // staggering of source xfield
GpuArray<int,3> sf_Ey; // staggering of source yfield
GpuArray<int,3> sf_Ez; // staggering of source zfield
GpuArray<int,3> sf_Bx; // staggering of source xfield
GpuArray<int,3> sf_By; // staggering of source yfield
GpuArray<int,3> sf_Bz; // staggering of source zfield
GpuArray<int,3> s_dst;
GpuArray<int,3> 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<int,3> sf_Ex; // staggering of source xfield
amrex::GpuArray<int,3> sf_Ey; // staggering of source yfield
amrex::GpuArray<int,3> sf_Ez; // staggering of source zfield
amrex::GpuArray<int,3> sf_Bx; // staggering of source xfield
amrex::GpuArray<int,3> sf_By; // staggering of source yfield
amrex::GpuArray<int,3> sf_Bz; // staggering of source zfield
amrex::GpuArray<int,3> s_dst;
amrex::GpuArray<int,3> cr;

for (int i=0; i<AMREX_SPACEDIM; ++i) {
sf_Ex[i] = stag_Exsrc[i];
Expand Down
39 changes: 23 additions & 16 deletions Source/Diagnostics/ComputeDiagFunctors/PoyntingVectorFunctor.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#include "PoyntingVectorFunctor.H"
#include "Utils/CoarsenIO.H"
#include "Utils/WarpXConst.H"

#include "WarpX.H"
#include <AMReX_IntVect.H>
#include <AMReX.H>
#include <AMReX_GpuControl.H>
#include <AMReX_GpuDevice.H>
#include <AMReX_GpuLaunch.H>
#include <AMReX_GpuQualifiers.H>
#include <AMReX.H>

PoyntingVectorFunctor::PoyntingVectorFunctor (
Expand All @@ -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<int,3> sf_Ex; // staggering of source xfield
GpuArray<int,3> sf_Ey; // staggering of source yfield
GpuArray<int,3> sf_Ez; // staggering of source zfield
GpuArray<int,3> sf_Bx; // staggering of source xfield
GpuArray<int,3> sf_By; // staggering of source yfield
GpuArray<int,3> sf_Bz; // staggering of source zfield
GpuArray<int,3> s_dst;
GpuArray<int,3> 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<int,3> sf_Ex; // staggering of source xfield
amrex::GpuArray<int,3> sf_Ey; // staggering of source yfield
amrex::GpuArray<int,3> sf_Ez; // staggering of source zfield
amrex::GpuArray<int,3> sf_Bx; // staggering of source xfield
amrex::GpuArray<int,3> sf_By; // staggering of source yfield
amrex::GpuArray<int,3> sf_Bz; // staggering of source zfield
amrex::GpuArray<int,3> s_dst;
amrex::GpuArray<int,3> cr;

for (int i=0; i<AMREX_SPACEDIM; ++i) {
sf_Ex[i] = stag_Exsrc[i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
#ifdef PULSAR
#include "Particles/PulsarParameters.H"
#endif

#include "WarpX.H"
#include <AMReX_IntVect.H>
#include <AMReX.H>
#include <AMReX_GpuControl.H>
#include <AMReX_GpuDevice.H>
#include <AMReX_GpuLaunch.H>
#include <AMReX_GpuQualifiers.H>

SphericalComponentFunctor::SphericalComponentFunctor (amrex::MultiFab const * mfx_src,
amrex::MultiFab const * mfy_src,
Expand All @@ -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<int,3> sfx; // staggering of source xfield
GpuArray<int,3> sfy; // staggering of source yfield
GpuArray<int,3> sfz; // staggering of source zfield
GpuArray<int,3> s_dst;
GpuArray<int,3> 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<int,3> sfx; // staggering of source xfield
amrex::GpuArray<int,3> sfy; // staggering of source yfield
amrex::GpuArray<int,3> sfz; // staggering of source zfield
amrex::GpuArray<int,3> s_dst;
amrex::GpuArray<int,3> cr;

for (int i=0; i<AMREX_SPACEDIM; ++i) {
sfx[i] = stag_xsrc[i];
Expand Down
4 changes: 4 additions & 0 deletions Source/Particles/PhysicalParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,9 @@ PhysicalParticleContainer::AddPlasmaFlux (int lev, amrex::Real dt)
bool radially_weighted = plasma_injector->radially_weighted;
#endif

int Nmax_particles = 0;
int valid_particles_beforeAdd = TotalNumberOfParticles();

MFItInfo info;
if (do_tiling && Gpu::notInLaunchRegion()) {
info.EnableTiling(tile_size);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 31b0cb2

Please sign in to comment.