aboutsummaryrefslogtreecommitdiff
path: root/Source/RigidInjectedParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar Maxence Thevenet <mthevenet@lbl.gov> 2018-06-15 17:04:13 -0700
committerGravatar Maxence Thevenet <mthevenet@lbl.gov> 2018-06-15 17:04:13 -0700
commitf68ffc6e5853c785512bb881c55b4afd8248e846 (patch)
tree858188bf5a49aa3539a376699124257c4dbf9f0d /Source/RigidInjectedParticleContainer.cpp
parenta757fa6d4e33f081dc3edb1a0801aaccc1857763 (diff)
downloadWarpX-f68ffc6e5853c785512bb881c55b4afd8248e846.tar.gz
WarpX-f68ffc6e5853c785512bb881c55b4afd8248e846.tar.zst
WarpX-f68ffc6e5853c785512bb881c55b4afd8248e846.zip
remove threading segfault in RigidInjection
Diffstat (limited to 'Source/RigidInjectedParticleContainer.cpp')
-rw-r--r--Source/RigidInjectedParticleContainer.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/RigidInjectedParticleContainer.cpp b/Source/RigidInjectedParticleContainer.cpp
index a47bf0aad..5f06e2a82 100644
--- a/Source/RigidInjectedParticleContainer.cpp
+++ b/Source/RigidInjectedParticleContainer.cpp
@@ -101,15 +101,15 @@ RigidInjectedParticleContainer::RemapParticles()
const Real uz_boost = WarpX::gamma_boost*WarpX::beta_boost*PhysConst::c;
const Real csq = PhysConst::c*PhysConst::c;
+ vzbeam_ave_boosted = meanParticleVelocity(false)[2];
+
#ifdef _OPENMP
#pragma omp parallel
#endif
{
-
// Get the average beam velocity in the boosted frame.
// Note that the particles are already in the boosted frame.
// This value is saved to advance the particles not injected yet
- vzbeam_ave_boosted = meanParticleVelocity(false)[2];
Vector<Real> xp, yp, zp;
@@ -160,19 +160,19 @@ RigidInjectedParticleContainer::BoostandRemapParticles()
// to the t=0 in the boosted frame. If using rigid_advance, the z position
// is adjusted using vzbar, otherwise using vz[i]
+ if (rigid_advance) {
+ // Get the average beam velocity in the boosted frame
+ // This value is saved to advance the particles not injected yet
+ const Real vzbeam_ave_lab = meanParticleVelocity(false)[2];
+ vzbeam_ave_boosted = (vzbeam_ave_lab - WarpX::beta_boost*PhysConst::c)/(1. - vzbeam_ave_lab*WarpX::beta_boost/PhysConst::c);
+ }
+
#ifdef _OPENMP
#pragma omp parallel
#endif
{
Vector<Real> xp, yp, zp;
- if (rigid_advance) {
- // Get the average beam velocity in the boosted frame
- // This value is saved to advance the particles not injected yet
- const Real vzbeam_ave_lab = meanParticleVelocity(false)[2];
- vzbeam_ave_boosted = (vzbeam_ave_lab - WarpX::beta_boost*PhysConst::c)/(1. - vzbeam_ave_lab*WarpX::beta_boost/PhysConst::c);
- }
-
for (WarpXParIter pti(*this, 0); pti.isValid(); ++pti)
{