116 MPI_Barrier(MPI_COMM_WORLD);
125 for (
typename ParticleContainerType::iterator pIter =this->begin();
130 lpt.insert(pIter->pCell->neighborSize(),&*pIter);
140 for (
size_t b=0;
b<lpt.bins();++
b)
142 const size_t binSize(lpt.bin(
b).size());
143 for (
size_t p=0;
p<binSize;++
p)
145 lpt.bin(
b)[
p]->set_mpiID(binOffset+
p);
152#pragma omp parallel for
154 for (
unsigned int k=0;
k<lpt.bin(this->
mpiRank()).size();++
k)
160 for (
typename SpatialCellType::CellMapType::const_iterator cIter=lpt.bin(this->mpiRank())[
k]->neighborCellsBegin();cIter!=lpt.bin(this->mpiRank())[
k]->neighborCellsEnd();++cIter)
163 for(
typename SpatialCellType::ParticleContainerType::const_iterator sIter=cIter->second->particleBegin();sIter!=cIter->second->particleEnd();++sIter)
174 if(FieldType::use_multipole)
176 typename SpatialCellType::CellMapType farCells(lpt.bin(this->mpiRank())[
k]->template farCells<_ParticleType>());
182 if(
sizeof...(OtherSourceTypes))
189 std::vector<int> interactionSizeVector(this->
mpiProcs());
190 std::vector<int> interactionRankOffsetVector(this->
mpiProcs());
197 interactionRankOffsetVector[
k]=dofOffset;
201 MPI_Allgatherv(MPI_IN_PLACE,0,MPI_DATATYPE_NULL,
203 &interactionSizeVector[0],&interactionRankOffsetVector[0],
204 MPI_DOUBLE,MPI_COMM_WORLD);
210 void computeField(std::deque<OtherParticleType>& fpDeq,
const OtherSourceTypes&... otherSources)
const
215 MPI_Barrier(MPI_COMM_WORLD);
222 for (
typename std::deque<OtherParticleType>::iterator pIter =fpDeq.begin();
226 typename SpatialCellType::CellMapType cellMap(pIter->template neighborCells<_ParticleType>());
228 for (
typename SpatialCellType::CellMapType::const_iterator cIter=cellMap.begin();cIter!=cellMap.end();++cIter)
230 weight += cIter->second->size();
233 lpt.insert(weight,&*pIter);
245 for (
size_t b=0;
b<lpt.bins();++
b)
247 const size_t binSize(lpt.bin(
b).size());
248 for (
size_t p=0;
p<binSize;++
p)
250 lpt.bin(
b)[
p]->set_mpiID(binOffset+
p);
257#pragma omp parallel for
259 for (
unsigned int k=0;
k<lpt.bin(this->
mpiRank()).size();++
k)
264 typename SpatialCellType::CellMapType cellMap((lpt.bin(this->mpiRank())[
k])->template neighborCells<_ParticleType>());
267 for (
typename SpatialCellType::CellMapType::const_iterator cIter =cellMap.begin();
268 cIter!=cellMap.end();
272 for(
typename SpatialCellType::ParticleContainerType::const_iterator sIter=cIter->second->particleBegin();sIter!=cIter->second->particleEnd();++sIter)
283 if(FieldType::use_multipole)
285 typename SpatialCellType::CellMapType farCells(lpt.bin(this->mpiRank())[
k]->template farCells<_ParticleType>());
292 if(
sizeof...(OtherSourceTypes))
300 std::vector<int> interactionSizeVector(this->
mpiProcs());
301 std::vector<int> interactionRankOffsetVector(this->
mpiProcs());
308 interactionRankOffsetVector[
k]=dofOffset;
313 MPI_Allgatherv(MPI_IN_PLACE,0,MPI_DATATYPE_NULL,
315 &interactionSizeVector[0],&interactionRankOffsetVector[0],
316 MPI_DOUBLE,MPI_COMM_WORLD);
321 void computeField(OtherParticleType& part,
const OtherSourceTypes&... otherSources)
const
327 ParticleSystemBaseType::template
computeField<OtherParticleType,FieldType,OtherSourceTypes...>(part,otherSources...);