Skip to content

Commit

Permalink
ensure invalid particles have a weight of zero
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderSinn committed Feb 6, 2025
1 parent 31802f5 commit e392293
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/particles/beam/BeamParticleContainerInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace
ptd.rdata(BeamIdx::ux )[ip] = uxp;
ptd.rdata(BeamIdx::uy )[ip] = uyp;
ptd.rdata(BeamIdx::uz )[ip] = uz * speed_of_light;
ptd.rdata(BeamIdx::w )[ip] = std::abs(weight);
ptd.rdata(BeamIdx::w )[ip] = is_valid ? std::abs(weight) : amrex::Real{0};

ptd.idata(BeamIdx::nsubcycles)[ip] = 0;
ptd.idata(BeamIdx::mr_level)[ip] = 0;
Expand Down
1 change: 0 additions & 1 deletion src/salame/Salame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ SalameMultiplyBeamWeight (const amrex::Real W, Hipace* hipace)
// invalidate particles with a weight of zero
if (W == 0) {
id.make_invalid();
return;
}

// Multiply SALAME beam particles on this slice with W
Expand Down

0 comments on commit e392293

Please sign in to comment.