diff options
author | 2017-01-31 18:01:04 +0000 | |
---|---|---|
committer | 2017-01-31 18:01:04 +0000 | |
commit | 192b358aeab22316120b8d30bb5ff4640be8a3cc (patch) | |
tree | 2b47d23e42aa0038c1fa60464871e783cc4d0517 /Source/WarpXParticleContainer.cpp | |
parent | ac5fbbb6edeb5f692130b378fb06a91d184aa01f (diff) | |
parent | acf5754f6c51b7197e34df981e0643728cb9b5a2 (diff) | |
download | WarpX-192b358aeab22316120b8d30bb5ff4640be8a3cc.tar.gz WarpX-192b358aeab22316120b8d30bb5ff4640be8a3cc.tar.zst WarpX-192b358aeab22316120b8d30bb5ff4640be8a3cc.zip |
Merged in laser_injection (pull request #11)
Laser injection
Diffstat (limited to 'Source/WarpXParticleContainer.cpp')
-rw-r--r-- | Source/WarpXParticleContainer.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/WarpXParticleContainer.cpp b/Source/WarpXParticleContainer.cpp index 5405d2120..879bcaa1d 100644 --- a/Source/WarpXParticleContainer.cpp +++ b/Source/WarpXParticleContainer.cpp @@ -95,21 +95,18 @@ WarpXParticleContainer::AddNParticles (int n, const Real* x, const Real* y, cons p.m_data[PIdx::uy] = vy[i]; p.m_data[PIdx::uz] = vz[i]; - if (!ParticleBase::Where(p,m_gdb)) // this will update m_lev, m_grid, and m_cell + if (ParticleBase::Where(p,m_gdb)) // this will update m_lev, m_grid, and m_cell { - BoxLib::Abort("Invalid particle in ParticleContainer::AddNParticles()"); + gid = p.m_grid; + m_particles[p.m_lev][p.m_grid].push_back(p); } - - gid = p.m_grid; - - m_particles[p.m_lev][p.m_grid].push_back(p); } Redistribute(true); auto npart_after = TotalNumberOfParticles(); // xxxxx move this into if (verbose > xxx) if (ParallelDescriptor::IOProcessor()) { - std::cout << "Total number of particles injected: " << npart_after - npart_before << std::endl; + std::cout << "Total number of particles added: " << npart_after - npart_before << std::endl; } } |