Go to the documentation of this file.
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);
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]);
195 forAll(srcToTgtCellAddr, cellI)
197 scalar srcVol = src_.cellVolumes()[cellI];
198 scalar tgtVol =
sum(srcToTgtCellWght[cellI]);
200 if (
mag(srcVol) > ROOTVSMALL &&
mag((tgtVol-srcVol)/srcVol) > 1
e-6)
203 <<
"At cell " << cellI <<
" cc:"
204 << src_.cellCentres()[cellI]
206 <<
" total overlap volume:" << tgtVol
211 forAll(tgtToSrcCellAddr, cellI)
213 scalar tgtVol = tgt_.cellVolumes()[cellI];
214 scalar srcVol =
sum(tgtToSrcCellWght[cellI]);
216 if (
mag(tgtVol) > ROOTVSMALL &&
mag((srcVol-tgtVol)/tgtVol) > 1
e-6)
219 <<
"At cell " << cellI <<
" cc:"
220 << tgt_.cellCentres()[cellI]
222 <<
" total overlap volume:" << srcVol
241 const labelList& srcNbrCells = src_.cellCells()[srcCellI];
245 bool valuesSet =
false;
248 label cellS = srcNbrCells[i];
250 if (mapFlag[cellS] && seedCells[cellS] == -1)
254 label cellT = visitedCells[j];
258 seedCells[cellS] = cellT;
279 bool foundNextSeed =
false;
280 for (
label i = startSeedI; i < srcCellIDs.
size(); i++)
282 label cellS = srcCellIDs[i];
289 foundNextSeed =
true;
292 if (seedCells[cellS] != -1)
295 tgtCellI = seedCells[cellS];
305 Pout<<
"Advancing front stalled: searching for new "
306 <<
"target cell" <<
endl;
379 boolList mapFlag(src_.nCells(),
false);
385 label startSeedI = 0;
virtual ~cellVolumeWeightMethod()
Destructor.
#define forAll(list, i)
Loop across all elements in list.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
Base class for mesh-to-mesh calculation methods.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
void append(const T &)
Append an element at the end of the list.
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.
Raster intersect(const Raster &rast1, const Raster &rast2)
Macros for easy insertion into run-time selection tables.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
virtual void calculate(labelListList &srcToTgtAddr, scalarListList &srcToTgtWght, pointListList &srcToTgtVec, labelListList &tgtToSrcAddr, scalarListList &tgtToSrcWght, pointListList &tgtToSrcVec)
Calculate addressing and weights and optionally offset vectors.
prefixOSstream Pout(cout, "Pout")
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.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const dimensionedScalar e
Elementary charge.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
T remove()
Remove and return the top element.
A List with indirect addressing.
void size(const label)
Override size to be inconsistent with allocated storage.
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.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
cellVolumeWeightMethod(const cellVolumeWeightMethod &)
Disallow default bitwise copy construct.