39 cellVolumeWeightMethod,
50 const label startSeedI,
55 const cellList& srcCells = src_.cells();
56 const faceList& srcFaces = src_.faces();
59 for (
label i = startSeedI; i < srcCellIDs.
size(); i++)
61 label srcI = srcCellIDs[i];
66 pts(srcCells[srcI].
points(srcFaces, srcPts).xfer());
70 const point& pt = pts[ptI];
71 label tgtI = tgt_.cellTree().findInside(pt);
73 if (tgtI != -1 && intersect(srcI, tgtI))
86 Pout<<
"could not find starting seed" <<
endl;
100 const label tgtSeedI,
106 label srcCellI = srcSeedI;
107 label tgtCellI = tgtSeedI;
123 seedCells[srcCellI] = tgtCellI;
130 visitedTgtCells.
clear();
133 nbrTgtCells.
append(tgtCellI);
134 appendNbrCells(tgtCellI, tgt_, visitedTgtCells, nbrTgtCells);
138 tgtCellI = nbrTgtCells.remove();
139 visitedTgtCells.
append(tgtCellI);
141 scalar vol = interVol(srcCellI, tgtCellI);
144 if (vol/srcVol[srcCellI] > tolerance_)
147 srcToTgtAddr[srcCellI].
append(tgtCellI);
148 srcToTgtWght[srcCellI].
append(vol);
150 tgtToSrcAddr[tgtCellI].
append(srcCellI);
151 tgtToSrcWght[tgtCellI].
append(vol);
153 appendNbrCells(tgtCellI, tgt_, visitedTgtCells, nbrTgtCells);
159 while (!nbrTgtCells.
empty());
161 mapFlag[srcCellI] =
false;
175 while (srcCellI != -1);
178 forAll(srcToTgtCellAddr, i)
180 srcToTgtCellAddr[i].
transfer(srcToTgtAddr[i]);
181 srcToTgtCellWght[i].
transfer(srcToTgtWght[i]);
184 forAll(tgtToSrcCellAddr, i)
186 tgtToSrcCellAddr[i].
transfer(tgtToSrcAddr[i]);
187 tgtToSrcCellWght[i].
transfer(tgtToSrcWght[i]);
203 const labelList& srcNbrCells = src_.cellCells()[srcCellI];
207 bool valuesSet =
false;
210 label cellS = srcNbrCells[i];
212 if (mapFlag[cellS] && seedCells[cellS] == -1)
216 label cellT = visitedCells[j];
218 if (intersect(cellS, cellT))
220 seedCells[cellS] = cellT;
241 bool foundNextSeed =
false;
242 for (
label i = startSeedI; i < srcCellIDs.
size(); i++)
244 label cellS = srcCellIDs[i];
251 foundNextSeed =
true;
254 if (seedCells[cellS] != -1)
257 tgtCellI = seedCells[cellS];
267 Pout<<
"Advancing front stalled: searching for new " 268 <<
"target cell" <<
endl;
339 boolList mapFlag(src_.nCells(),
false);
345 label startSeedI = 0;
const pointField & points
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
bool empty() const
Return true if the UList is empty (ie, size() is zero).
bool findInitialSeeds(const labelList &srcCellIDs, const boolList &mapFlag, const label startSeedI, label &srcSeedI, label &tgtSeedI) const
Find indices of overlapping cells in src and tgt meshes - returns.
void clear()
Clear the addressed list, i.e. set the size to zero.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
virtual void calculate(labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, labelListList &tgtToTgtAddr, scalarListList &tgtToTgtWght)
Calculate addressing and weights.
Base class for mesh-to-mesh calculation methods.
void setNextCells(label &startSeedI, label &srcCellI, label &tgtCellI, const labelList &srcCellIDs, const boolList &mapFlag, const DynamicList< label > &visitedCells, labelList &seedCells) const
Set the next cells in the advancing front algorithm.
void clear()
Clear the list, i.e. set size to zero.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A List with indirect addressing.
Macros for easy insertion into run-time selection tables.
void calculateAddressing(labelListList &srcToTgtCellAddr, scalarListList &srcToTgtCellWght, labelListList &tgtToSrcCellAddr, scalarListList &tgtToSrcCellWght, const label srcSeedI, const label tgtSeedI, const labelList &srcCellIDs, boolList &mapFlag, label &startSeedI)
Calculate the mesh-to-mesh addressing and weights.
Mesh consisting of general polyhedral cells.
void append(const T &)
Append an element at the end of the list.
virtual ~cellVolumeWeightMethod()
Destructor.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
cellVolumeWeightMethod(const cellVolumeWeightMethod &)
Disallow default bitwise copy construct.
defineTypeNameAndDebug(combustionModel, 0)
prefixOSstream Pout(cout,"Pout")