@@ -160,14 +160,14 @@ void IonUpdater<Ions, Electromag, GridLayout>::updateAndDepositDomain_(Ions& ion
160
160
outRange = makeRange (outputArray);
161
161
162
162
auto firstGhostOut = pusher_->move (inRange, outRange, em, pop.mass (), interpolator_,
163
- inGhostBox, inDomainBox , layout);
163
+ inGhostBox, inGhostLayer , layout);
164
164
165
- auto inDomain = makeRange ( std::begin (outputArray), firstGhostOut );
165
+ auto endInDomain = std::partition (firstGhostOut, std::end (outputArray), inDomainBox );
166
166
167
- interpolator_ (inDomain. begin (), inDomain. end () , pop.density (), pop.flux (), layout);
167
+ interpolator_ (firstGhostOut, endInDomain , pop.density (), pop.flux (), layout);
168
168
169
169
if (copyInDomain)
170
- std::copy (inDomain. begin (), inDomain. end () , std::back_inserter (domain));
170
+ std::copy (firstGhostOut, endInDomain , std::back_inserter (domain));
171
171
};
172
172
173
173
// After this function is done domain particles overlaping ghost layers of neighbor patches
@@ -229,10 +229,10 @@ void IonUpdater<Ions, Electromag, GridLayout>::updateAndDepositAll_(Ions& ions,
229
229
auto pushAndCopyInDomain = [&](auto & particleArray) {
230
230
auto range = makeRange (particleArray);
231
231
auto firstOutGhostBox = pusher_->move (range, range, em, pop.mass (), interpolator_,
232
- inGhostBox, inDomainSelector , layout);
232
+ inGhostBox, inGhostLayer , layout);
233
233
234
- auto inDomain = makeRange ( std::begin (particleArray), firstOutGhostBox);
235
- std::copy (inDomain. begin (), inDomain. end (), std::back_inserter (domainParticles));
234
+ std::copy_if (firstOutGhostBox, std::end (particleArray),
235
+ std::back_inserter (domainParticles), inDomainSelector );
236
236
237
237
particleArray.erase (firstOutGhostBox, std::end (particleArray));
238
238
};
0 commit comments