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;
296 Foam::cellVolumeWeightMethod::cellVolumeWeightMethod
339 boolList mapFlag(src_.nCells(),
false);
345 label startSeedI = 0;
#define forAll(list, i)
Loop across all elements in list.
bool empty() const
Return true if the UList is empty (ie, size() is 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.
virtual ~cellVolumeWeightMethod()
Destructor.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
Macros for easy insertion into run-time selection tables.
virtual void calculate(labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, labelListList &tgtToTgtAddr, scalarListList &tgtToTgtWght)
Calculate addressing and weights.
void clear()
Clear the list, i.e. set size to zero.
void append(const T &)
Append an element at the end of the list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
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.
prefixOSstream Pout(cout, "Pout")
A List with indirect addressing.
Mesh consisting of general polyhedral cells.
void clear()
Clear the addressed list, i.e. set the size to 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 transfer(List< T > &)
Transfer the contents of the argument List into this list.