42 cellVolumeWeightMethod,
53 const label startSeedI,
58 const cellList& srcCells = src_.cells();
59 const faceList& srcFaces = src_.faces();
62 for (label i = startSeedI; i < srcCellIDs.size(); ++i)
64 const label srcI = srcCellIDs[i];
70 for (
const point& pt : pts)
72 const label tgtI = tgt_.cellTree().findInside(pt);
74 if (tgtI != -1 && intersect(srcI, tgtI))
87 Pout<<
"could not find starting seed" <<
endl;
100 const label srcSeedI,
101 const label tgtSeedI,
107 label srcCelli = srcSeedI;
108 label tgtCelli = tgtSeedI;
124 seedCells[srcCelli] = tgtCelli;
131 visitedTgtCells.
clear();
134 nbrTgtCells.
append(tgtCelli);
135 appendNbrCells(tgtCelli, tgt_, visitedTgtCells, nbrTgtCells);
139 tgtCelli = nbrTgtCells.remove();
140 visitedTgtCells.
append(tgtCelli);
142 scalar vol = interVol(srcCelli, tgtCelli);
145 if (vol/srcVol[srcCelli] > tolerance_)
148 srcToTgtAddr[srcCelli].
append(tgtCelli);
149 srcToTgtWght[srcCelli].
append(vol);
151 tgtToSrcAddr[tgtCelli].
append(srcCelli);
152 tgtToSrcWght[tgtCelli].
append(vol);
154 appendNbrCells(tgtCelli, tgt_, visitedTgtCells, nbrTgtCells);
160 while (!nbrTgtCells.empty());
162 mapFlag[srcCelli] =
false;
176 while (srcCelli != -1);
179 forAll(srcToTgtCellAddr, i)
181 srcToTgtCellAddr[i].
transfer(srcToTgtAddr[i]);
182 srcToTgtCellWght[i].
transfer(srcToTgtWght[i]);
185 forAll(tgtToSrcCellAddr, i)
187 tgtToSrcCellAddr[i].
transfer(tgtToSrcAddr[i]);
188 tgtToSrcCellWght[i].
transfer(tgtToSrcWght[i]);
196 forAll(srcToTgtCellAddr, cellI)
198 scalar srcVol = src_.cellVolumes()[cellI];
199 scalar tgtVol =
sum(srcToTgtCellWght[cellI]);
201 if (
mag(srcVol) > ROOTVSMALL &&
mag((tgtVol-srcVol)/srcVol) > 1
e-6)
204 <<
"At cell " << cellI <<
" cc:"
205 << src_.cellCentres()[cellI]
207 <<
" total overlap volume:" << tgtVol
212 forAll(tgtToSrcCellAddr, cellI)
214 scalar tgtVol = tgt_.cellVolumes()[cellI];
215 scalar srcVol =
sum(tgtToSrcCellWght[cellI]);
217 if (
mag(tgtVol) > ROOTVSMALL &&
mag((srcVol-tgtVol)/tgtVol) > 1
e-6)
220 <<
"At cell " << cellI <<
" cc:"
221 << tgt_.cellCentres()[cellI]
223 <<
" total overlap volume:" << srcVol
242 const labelList& srcNbrCells = src_.cellCells()[srcCelli];
246 bool valuesSet =
false;
249 label cellS = srcNbrCells[i];
251 if (mapFlag[cellS] && seedCells[cellS] == -1)
255 label cellT = visitedCells[j];
257 if (intersect(cellS, cellT))
259 seedCells[cellS] = cellT;
280 bool foundNextSeed =
false;
281 for (label i = startSeedI; i < srcCellIDs.size(); i++)
283 label cellS = srcCellIDs[i];
290 foundNextSeed =
true;
293 if (seedCells[cellS] != -1)
296 tgtCelli = seedCells[cellS];
306 Pout<<
"Advancing front stalled: searching for new "
307 <<
"target cell" <<
endl;
335 Foam::cellVolumeWeightMethod::cellVolumeWeightMethod
380 boolList mapFlag(src_.nCells(),
false);
386 label startSeedI = 0;