aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/WarpXParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar MaxThevenet <mthevenet@lbl.gov> 2019-09-12 08:25:45 -0700
committerGravatar MaxThevenet <mthevenet@lbl.gov> 2019-09-12 08:25:45 -0700
commit511e9355a86bc3412dd05c36498cf9cbad63bf7d (patch)
tree968db62b0d76ccd9477808db4aaa1d19892518fa /Source/Particles/WarpXParticleContainer.cpp
parentb2f98f30c048e42c6525114f34e926205639a83e (diff)
parent0bda5edfefde5773f5a773dcc8991649d33cc360 (diff)
downloadWarpX-511e9355a86bc3412dd05c36498cf9cbad63bf7d.tar.gz
WarpX-511e9355a86bc3412dd05c36498cf9cbad63bf7d.tar.zst
WarpX-511e9355a86bc3412dd05c36498cf9cbad63bf7d.zip
manually fix merge conflicts with dev
Diffstat (limited to 'Source/Particles/WarpXParticleContainer.cpp')
-rw-r--r--Source/Particles/WarpXParticleContainer.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp
index cb3d00fcb..ee606aadb 100644
--- a/Source/Particles/WarpXParticleContainer.cpp
+++ b/Source/Particles/WarpXParticleContainer.cpp
@@ -108,7 +108,7 @@ WarpXParticleContainer::ReadParameters ()
static bool initialized = false;
if (!initialized)
{
- ParmParse pp("particles");
+ ParmParse pp("particles");
#ifdef AMREX_USE_GPU
do_tiling = false; // By default, tiling is off on GPU
@@ -118,7 +118,7 @@ WarpXParticleContainer::ReadParameters ()
pp.query("do_tiling", do_tiling);
pp.query("do_not_push", do_not_push);
- initialized = true;
+ initialized = true;
}
}
@@ -173,28 +173,28 @@ WarpXParticleContainer::AddOneParticle (ParticleTileType& particle_tile,
void
WarpXParticleContainer::AddNParticles (int lev,
int n, const Real* x, const Real* y, const Real* z,
- const Real* vx, const Real* vy, const Real* vz,
- int nattr, const Real* attr, int uniqueparticles, int id)
+ const Real* vx, const Real* vy, const Real* vz,
+ int nattr, const Real* attr, int uniqueparticles, int id)
{
BL_ASSERT(nattr == 1);
const Real* weight = attr;
int ibegin, iend;
if (uniqueparticles) {
- ibegin = 0;
- iend = n;
+ ibegin = 0;
+ iend = n;
} else {
- int myproc = ParallelDescriptor::MyProc();
- int nprocs = ParallelDescriptor::NProcs();
- int navg = n/nprocs;
- int nleft = n - navg * nprocs;
- if (myproc < nleft) {
- ibegin = myproc*(navg+1);
- iend = ibegin + navg+1;
- } else {
- ibegin = myproc*navg + nleft;
- iend = ibegin + navg;
- }
+ int myproc = ParallelDescriptor::MyProc();
+ int nprocs = ParallelDescriptor::NProcs();
+ int navg = n/nprocs;
+ int nleft = n - navg * nprocs;
+ if (myproc < nleft) {
+ ibegin = myproc*(navg+1);
+ iend = ibegin + navg+1;
+ } else {
+ ibegin = myproc*navg + nleft;
+ iend = ibegin + navg;
+ }
}
// Add to grid 0 and tile 0
@@ -211,12 +211,12 @@ WarpXParticleContainer::AddNParticles (int lev,
for (int i = ibegin; i < iend; ++i)
{
ParticleType p;
- if (id==-1)
- {
- p.id() = ParticleType::NextID();
- } else {
- p.id() = id;
- }
+ if (id==-1)
+ {
+ p.id() = ParticleType::NextID();
+ } else {
+ p.id() = id;
+ }
p.cpu() = ParallelDescriptor::MyProc();
#if (AMREX_SPACEDIM == 3)
p.pos(0) = x[i];
@@ -233,7 +233,7 @@ WarpXParticleContainer::AddNParticles (int lev,
#endif
if ( (NumRuntimeRealComps()>0) || (NumRuntimeIntComps()>0) ){
- auto& ptile = DefineAndReturnParticleTile(0, 0, 0);
+ auto& ptile = DefineAndReturnParticleTile(0, 0, 0);
}
particle_tile.push_back(p);
@@ -247,7 +247,7 @@ WarpXParticleContainer::AddNParticles (int lev,
particle_tile.push_back_real(PIdx::uz, vz + ibegin, vz + iend);
if ( (NumRuntimeRealComps()>0) || (NumRuntimeIntComps()>0) ){
- auto& ptile = DefineAndReturnParticleTile(0, 0, 0);
+ auto& ptile = DefineAndReturnParticleTile(0, 0, 0);
}
for (int comp = PIdx::uz+1; comp < PIdx::nattribs; ++comp)
@@ -299,7 +299,7 @@ WarpXParticleContainer::DepositCurrent(WarpXParIter& pti,
const long offset, const long np_to_depose,
int thread_num, int lev, int depos_lev,
Real dt)
-{
+{
AMREX_ALWAYS_ASSERT_WITH_MESSAGE((depos_lev==(lev-1)) ||
(depos_lev==(lev )),
"Deposition buffers only work for lev-1");
@@ -326,7 +326,7 @@ WarpXParticleContainer::DepositCurrent(WarpXParIter& pti,
const IntVect& ref_ratio = WarpX::RefRatio(depos_lev);
tilebox = amrex::coarsen(pti.tilebox(),ref_ratio);
}
-
+
// Staggered tile boxes (different in each direction)
Box tbx = convert(tilebox, WarpX::jx_nodal_flag);
Box tby = convert(tilebox, WarpX::jy_nodal_flag);
@@ -370,11 +370,11 @@ WarpXParticleContainer::DepositCurrent(WarpXParIter& pti,
// Lower corner of tile box physical domain
// Note that this includes guard cells since it is after tilebox.ngrow
const std::array<Real, 3>& xyzmin = WarpX::LowerCorner(tilebox, depos_lev);
- // xyzmin is built on pti.tilebox(), so it does
+ // xyzmin is built on pti.tilebox(), so it does
// not include staggering, so the stagger_shift has to be done by hand.
- // Alternatively, we could define xyzminx from tbx (and the same for 3
+ // Alternatively, we could define xyzminx from tbx (and the same for 3
// directions and for jx, jy, jz). This way, sx0 would not be needed.
- // Better for memory? worth trying?
+ // Better for memory? worth trying?
const Dim3 lo = lbound(tilebox);
BL_PROFILE_VAR_START(blp_deposit);
@@ -441,7 +441,7 @@ WarpXParticleContainer::DepositCurrent(WarpXParIter& pti,
ion_lev is a null pointer.
* \param rho : Full array of charge density
* \param icomp : Component of rho into which charge is deposited.
- 0: old value (before particle push).
+ 0: old value (before particle push).
1: new value (after particle push).
* \param offset : Index of first particle for which charge is deposited
* \param np_to_depose: Number of particles for which charge is deposited.
@@ -481,7 +481,7 @@ WarpXParticleContainer::DepositCharge (WarpXParIter& pti, RealVector& wp,
const IntVect& ref_ratio = WarpX::RefRatio(depos_lev);
tilebox = amrex::coarsen(pti.tilebox(),ref_ratio);
}
-
+
tilebox.grow(ngRho);
const int nc = (rho->nComp() == 1 ? 1 : rho->nComp()/2);