40 cellVolumeWeightMethod,
51 const label startSeedI,
56 const cellList& srcCells = src_.cells();
57 const faceList& srcFaces = src_.faces();
60 for (
label i = startSeedI; i < srcCellIDs.
size(); i++)
62 const label srcI = srcCellIDs[i];
68 tgt_.cellTree().findBox
76 const label tgtI = tgtIDs[j];
78 if (intersect(srcI, tgtI))
91 Pout<<
"could not find starting seed" <<
endl;
104 const label srcSeedI,
105 const label tgtSeedI,
111 label srcCelli = srcSeedI;
112 label tgtCelli = tgtSeedI;
128 seedCells[srcCelli] = tgtCelli;
135 visitedTgtCells.
clear();
138 nbrTgtCells.
append(tgtCelli);
139 appendNbrCells(tgtCelli, tgt_, visitedTgtCells, nbrTgtCells);
143 tgtCelli = nbrTgtCells.remove();
144 visitedTgtCells.
append(tgtCelli);
146 scalar vol = interVol(srcCelli, tgtCelli);
149 if (vol/srcVol[srcCelli] > tolerance_)
152 srcToTgtAddr[srcCelli].
append(tgtCelli);
153 srcToTgtWght[srcCelli].
append(vol);
155 tgtToSrcAddr[tgtCelli].
append(srcCelli);
156 tgtToSrcWght[tgtCelli].
append(vol);
158 appendNbrCells(tgtCelli, tgt_, visitedTgtCells, nbrTgtCells);
164 while (!nbrTgtCells.
empty());
166 mapFlag[srcCelli] =
false;
180 while (srcCelli != -1);
183 forAll(srcToTgtCellAddr, i)
185 srcToTgtCellAddr[i].
transfer(srcToTgtAddr[i]);
186 srcToTgtCellWght[i].
transfer(srcToTgtWght[i]);
189 forAll(tgtToSrcCellAddr, i)
191 tgtToSrcCellAddr[i].
transfer(tgtToSrcAddr[i]);
192 tgtToSrcCellWght[i].
transfer(tgtToSrcWght[i]);
208 const labelList& srcNbrCells = src_.cellCells()[srcCelli];
212 bool valuesSet =
false;
215 label cellS = srcNbrCells[i];
217 if (mapFlag[cellS] && seedCells[cellS] == -1)
221 label cellT = visitedCells[j];
223 if (intersect(cellS, cellT))
225 seedCells[cellS] = cellT;
246 bool foundNextSeed =
false;
247 for (
label i = startSeedI; i < srcCellIDs.
size(); i++)
249 label cellS = srcCellIDs[i];
256 foundNextSeed =
true;
259 if (seedCells[cellS] != -1)
262 tgtCelli = seedCells[cellS];
272 Pout<<
"Advancing front stalled: searching for new " 273 <<
"target cell" <<
endl;
321 return faceAreaWeightAMI::typeName;
350 boolList mapFlag(src_.nCells(),
false);
356 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)
virtual const word & AMImethod() const
Return the corresponding AMI method for patch interpolation.
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.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from string.
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.
Standard boundBox + extra functionality for use in octree.
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.