Commit c634eb11 authored by PIACIBELLO Cyrille's avatar PIACIBELLO Cyrille
parents aa4c4d19 347d5b87
......@@ -132,7 +132,7 @@ public:
const MortonIndex particuleIndex = tree->getMortonFromPosition(partPos);
if(particuleIndex != currentIndex){
tomove.push(ConverterClass::GetParticle(particles,idxPart));
tomove.push(ConverterClass::GetParticleAndRemove(particles,idxPart));
}
}
} while(octreeIterator.moveRight());
......
......@@ -185,7 +185,7 @@ public:
if(particuleIndex != currentIndex){
// find the right interval
const int procConcerned = getInterval( particuleIndex, comm.processCount(), intervals);
toMove[procConcerned].push(ConverterClass::GetParticle(particles,idxPart));
toMove[procConcerned].push(ConverterClass::GetParticleAndRemove(particles,idxPart));
indexesToExtract.push(idxPart);
}
}
......
......@@ -99,7 +99,7 @@ template <class ParticleClass>
class Converter {
public:
template <class ContainerClass>
static ParticleClass GetParticle(ContainerClass* containers, const int idxExtract){
static ParticleClass GetParticleAndRemove(ContainerClass* containers, const int idxExtract){
const FReal*const positionsX = containers->getPositions()[0];
const FReal*const positionsY = containers->getPositions()[1];
const FReal*const positionsZ = containers->getPositions()[2];
......@@ -119,6 +119,8 @@ public:
part.potential = potentials[idxExtract];
part.velocity = velocites[idxExtract];
containers->removeParticles(&idxExtract, 1);
return part;
}
......
......@@ -47,12 +47,13 @@ template <class ParticleClass>
class Converter {
public:
template <class ContainerClass>
static ParticleClass GetParticle(ContainerClass* container, const int idxExtract){
static ParticleClass GetParticleAndRemove(ContainerClass* container, const int idxExtract){
TestParticle part;
part.position.setPosition(
container->getPositions()[0][idxExtract],
container->getPositions()[1][idxExtract],
container->getPositions()[2][idxExtract]);
container->removeParticles(&idxExtract, 1);
return part;
}
......
......@@ -55,12 +55,13 @@ template <class ParticleClass>
class Converter {
public:
template <class ContainerClass>
static ParticleClass GetParticle(ContainerClass* container, const int idxExtract){
static ParticleClass GetParticleAndRemove(ContainerClass* container, const int idxExtract){
TestParticle part;
part.position.setPosition(
container->getPositions()[0][idxExtract],
container->getPositions()[1][idxExtract],
container->getPositions()[2][idxExtract]);
container->removeParticles(&idxExtract, 1);
return part;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment