00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 {
00032
00033 vector subPosition = position + offset;
00034 label partCellId = particleCloud_.locateM().findSingleCell(subPosition,cellID);
00035
00036
00037
00038 if(partCellId!=cellID)
00039 {
00040 nUnEqual++;
00041 }
00042 if(partCellId<0)
00043 {
00044 nNotFound++;
00045 }
00046 nTotal++;
00047
00048 if (partCellId >= 0)
00049 {
00050
00051 scalar partCellVol = particleCloud_.mesh().V()[partCellId];
00052 scalar particleVolume = volume/static_cast<scalar>(nPoints);
00053 scalar newAlpha = voidfractionNext_[partCellId]- particleVolume / partCellVol;
00054
00055 if(newAlpha > alphaMin_) voidfractionNext_[partCellId] = newAlpha;
00056 else
00057 {
00058 voidfractionNext_[partCellId] = alphaMin_;
00059 tooMuch_ += (alphaMin_-newAlpha) * partCellVol;
00060 }
00061
00062 cellsSet++;
00063
00064
00065
00066 bool createNew = true;
00067 label storeInIndex=0;
00068 for(int i=0; i < cellsPerParticle_[index][0] ; i++)
00069 {
00070 if(partCellId == particleCloud_.cellIDs()[index][i])
00071 {
00072 storeInIndex = i;
00073 createNew = false;
00074 break;
00075 }
00076 }
00077
00078 if(createNew)
00079 {
00080 cellsPerParticle_[index][0] ++;
00081 storeInIndex = cellsPerParticle_[index][0]-1;
00082 particleCloud_.cellIDs()[index][storeInIndex] = partCellId;
00083
00084 }
00085
00086 particleWeights[index][storeInIndex] += 1/static_cast<scalar>(nPoints);
00087 particleVolumes[index][storeInIndex] += particleVolume;
00088
00089 }
00090 }