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];
67 srcCells[srcI].
points(srcFaces, srcPts)
72 const point& pt = pts[ptI];
73 label tgtI = tgt_.cellTree().findInside(pt);
75 if (tgtI != -1 && intersect(srcI, tgtI))
88 Pout<<
"could not find starting seed" <<
endl;
101 const label srcSeedI,
102 const label tgtSeedI,
108 label srcCelli = srcSeedI;
109 label tgtCelli = tgtSeedI;
125 seedCells[srcCelli] = tgtCelli;
132 visitedTgtCells.
clear();
135 nbrTgtCells.
append(tgtCelli);
136 appendNbrCells(tgtCelli, tgt_, visitedTgtCells, nbrTgtCells);
140 tgtCelli = nbrTgtCells.remove();
141 visitedTgtCells.
append(tgtCelli);
143 scalar vol = interVol(srcCelli, tgtCelli);
146 if (vol/srcVol[srcCelli] > tolerance_)
149 srcToTgtAddr[srcCelli].
append(tgtCelli);
150 srcToTgtWght[srcCelli].
append(vol);
152 tgtToSrcAddr[tgtCelli].
append(srcCelli);
153 tgtToSrcWght[tgtCelli].
append(vol);
155 appendNbrCells(tgtCelli, tgt_, visitedTgtCells, nbrTgtCells);
161 while (!nbrTgtCells.
empty());
163 mapFlag[srcCelli] =
false;
177 while (srcCelli != -1);
180 forAll(srcToTgtCellAddr, i)
182 srcToTgtCellAddr[i].
transfer(srcToTgtAddr[i]);
183 srcToTgtCellWght[i].
transfer(srcToTgtWght[i]);
186 forAll(tgtToSrcCellAddr, i)
188 tgtToSrcCellAddr[i].
transfer(tgtToSrcAddr[i]);
189 tgtToSrcCellWght[i].
transfer(tgtToSrcWght[i]);
205 const labelList& srcNbrCells = src_.cellCells()[srcCelli];
209 bool valuesSet =
false;
212 label cellS = srcNbrCells[i];
214 if (mapFlag[cellS] && seedCells[cellS] == -1)
218 label cellT = visitedCells[j];
220 if (intersect(cellS, cellT))
222 seedCells[cellS] = cellT;
243 bool foundNextSeed =
false;
244 for (
label i = startSeedI; i < srcCellIDs.
size(); i++)
246 label cellS = srcCellIDs[i];
253 foundNextSeed =
true;
256 if (seedCells[cellS] != -1)
259 tgtCelli = seedCells[cellS];
269 Pout<<
"Advancing front stalled: searching for new " 270 <<
"target cell" <<
endl;
341 boolList mapFlag(src_.nCells(),
false);
347 label startSeedI = 0;
cellVolumeWeightMethod(const polyMesh &src, const polyMesh &tgt)
Construct from source and target meshes.
#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.