Skip to content

Commit d9cbcdf

Browse files
authored
Merge pull request #651 from PhilipDeegan/revert
updater: revert #643
2 parents ee8c72c + 0ccb3e3 commit d9cbcdf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/core/numerics/ion_updater/ion_updater.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,14 @@ void IonUpdater<Ions, Electromag, GridLayout>::updateAndDepositDomain_(Ions& ion
160160
outRange = makeRange(outputArray);
161161

162162
auto firstGhostOut = pusher_->move(inRange, outRange, em, pop.mass(), interpolator_,
163-
inGhostBox, inDomainBox, layout);
163+
inGhostBox, inGhostLayer, layout);
164164

165-
auto inDomain = makeRange(std::begin(outputArray), firstGhostOut);
165+
auto endInDomain = std::partition(firstGhostOut, std::end(outputArray), inDomainBox);
166166

167-
interpolator_(inDomain.begin(), inDomain.end(), pop.density(), pop.flux(), layout);
167+
interpolator_(firstGhostOut, endInDomain, pop.density(), pop.flux(), layout);
168168

169169
if (copyInDomain)
170-
std::copy(inDomain.begin(), inDomain.end(), std::back_inserter(domain));
170+
std::copy(firstGhostOut, endInDomain, std::back_inserter(domain));
171171
};
172172

173173
// 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,
229229
auto pushAndCopyInDomain = [&](auto& particleArray) {
230230
auto range = makeRange(particleArray);
231231
auto firstOutGhostBox = pusher_->move(range, range, em, pop.mass(), interpolator_,
232-
inGhostBox, inDomainSelector, layout);
232+
inGhostBox, inGhostLayer, layout);
233233

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);
236236

237237
particleArray.erase(firstOutGhostBox, std::end(particleArray));
238238
};

0 commit comments

Comments
 (0)