Skip to content

Commit

Permalink
update ppc.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
EyaDammak committed Feb 21, 2025
1 parent 332ce5e commit a5435e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/particles/plasma/PlasmaParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ PlasmaToBeam (MultiBeam& beams, const amrex::Vector< std::string > beamnames, co
});

auto [sum_new_beam_part] = reduce_data.value();

amrex::Gpu::Atomic::Add(p_num_new_beam_part, static_cast<uint32_t>(sum_new_beam_part));

auto& beam_elec = m_product_beam_pc;
Expand All @@ -791,7 +792,7 @@ PlasmaToBeam (MultiBeam& beams, const amrex::Vector< std::string > beamnames, co
amrex::ParallelFor(num_particles,
[=] AMREX_GPU_DEVICE (int ip) {
if (ptd_plasma.id(ip) != 2){
const long pid_beam = amrex::Gpu::Atomic::Add(ip_elec, 1u);
const long pid_beam = amrex::Gpu::Atomic::Add(ip_elec.dataPtr(), 1u);
const long pidx_beam = pid + old_size;
ptd_beam.rdata(BeamIdx::x)[pidx_beam] = ptd_plasma.pos(0, ip);
ptd_beam.rdata(BeamIdx::y)[pidx_beam] = ptd_plasma.pos(1, ip);
Expand Down

0 comments on commit a5435e8

Please sign in to comment.