本文整理汇总了C++中ParticleList::deleteParticles方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleList::deleteParticles方法的具体用法?C++ ParticleList::deleteParticles怎么用?C++ ParticleList::deleteParticles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleList
的用法示例。
在下文中一共展示了ParticleList::deleteParticles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: interchangeParticles
void MDcalculation::interchangeParticles(int dim){
MPI_Status status;
MPI_Request req0, req1;
int* stats;
int* statsIn;
double* data;
double* dataIn;
int nStats, nData;
int nStatsIn, nDataIn;
//Senders and recievers
int right = neighbour[2*dim];
int left = neighbour[2*dim + 1];
//Export arrays
ParticleList* rightExport = exportList[2*dim];
ParticleList* leftExport = exportList[2*dim + 1];
//Communicating to right
rightExport->makeArrays(&stats, &data, &nStats, &nData);
rightExport->deleteParticles();
shiftCoordinatesOut(data, nData, dim);
//Send data to right
MPI_Isend(data, nData, MPI_DOUBLE, right, 0, MPI_COMM_WORLD, &req0);
//Recieve data from left
MPI_Probe(left, 0, MPI_COMM_WORLD, &status);
MPI_Get_count(&status, MPI_DOUBLE, &nDataIn);
dataIn = new double[nDataIn];
MPI_Irecv(dataIn, nDataIn, MPI_DOUBLE, left, 0, MPI_COMM_WORLD, &req1);
MPI_Wait(&req0, &status);
MPI_Wait(&req1, &status);
//Send stats to right
MPI_Isend(stats, nStats, MPI_INT, right, 1, MPI_COMM_WORLD, &req0);
//Recieve stats from left
MPI_Probe(left, 1, MPI_COMM_WORLD, &status);
MPI_Get_count(&status, MPI_INT, &nStatsIn);
statsIn = new int[nStatsIn];
MPI_Irecv(statsIn, nStatsIn, MPI_INT, left, 1, MPI_COMM_WORLD, &req1);
MPI_Wait(&req0, &status);
MPI_Wait(&req1, &status);
addParticles(statsIn, dataIn, nStatsIn, nDataIn);
delete[] stats; delete[] data; delete[] statsIn; delete[] dataIn;
//Communicating to left
leftExport->makeArrays(&stats, &data, &nStats, &nData);
leftExport->deleteParticles();
//Send data to left
MPI_Isend(data, nData, MPI_DOUBLE, left, 0, MPI_COMM_WORLD, &req0);
//Recieve data from right
MPI_Probe(right, 0, MPI_COMM_WORLD, &status);
MPI_Get_count(&status, MPI_DOUBLE, &nDataIn);
dataIn = new double[nDataIn];
MPI_Irecv(dataIn, nDataIn, MPI_DOUBLE, right, 0, MPI_COMM_WORLD, &req1);
MPI_Wait(&req0, &status);
MPI_Wait(&req1, &status);
//Send stats to left
MPI_Isend(stats, nStats, MPI_INT, left, 1, MPI_COMM_WORLD, &req0);
//Recieve stats from right
MPI_Probe(right, 1, MPI_COMM_WORLD, &status);
MPI_Get_count(&status, MPI_INT, &nStatsIn);
statsIn = new int[nStatsIn];
MPI_Irecv(statsIn, nStatsIn, MPI_INT, right, 1, MPI_COMM_WORLD, &req1);
MPI_Wait(&req0, &status);
MPI_Wait(&req1, &status);
shiftCoordinatesIn(dataIn, nDataIn, dim);
addParticles(statsIn, dataIn, nStatsIn, nDataIn);
delete[] stats; delete[] data; delete[] statsIn; delete[] dataIn;
}