68 return (ijk[0]*nDivs[1] + ijk[1])*nDivs[2] + ijk[2];
78 label ij = boxI/nDivs[2];
79 label
k = boxI-ij*nDivs[2];
80 label i = ij/nDivs[1];
81 label j = ij-i*nDivs[1];
99 floor(relPt[0]/d[0]*nDivs[0]),
100 floor(relPt[1]/d[1]*nDivs[1]),
101 floor(relPt[2]/d[2]*nDivs[2])
117 const vector sz(d[0]/nDivs[0], d[1]/nDivs[1], d[2]/nDivs[2]);
119 return bb.
min()+0.5*sz+
vector(sz[0]*ids[0], sz[1]*ids[1], sz[2]*ids[2]);
129 const unsigned int val
135 for (
direction cmpt = 0; cmpt < 3; cmpt++)
137 if (maxIds[cmpt] < 0 || minIds[cmpt] > nDivs[cmpt])
145 maxIds =
min(maxIndex, maxIds);
147 for (label i = minIds[0]; i <= maxIds[0]; i++)
149 for (label j = minIds[1]; j <= maxIds[1]; j++)
151 for (label
k = minIds[2];
k <= maxIds[2];
k++)
176 const fvBoundaryMesh&
pbm =
mesh.boundary();
183 const fvPatch& fvp =
pbm[patchI];
190 const polyPatch&
pp = fvp.patch();
194 patchCellTypes[cellMap[fc[i]]] = patchCellType::PATCH;
197 boundBox faceBb(
pp.points(),
pp[i],
false);
198 faceBb.grow(smallVec);
200 if (bb.overlaps(faceBb))
202 fill(
patchTypes, bb, nDivs, faceBb, patchCellType::PATCH);
211 const fvPatch& fvp =
pbm[patchI];
217 const polyPatch&
pp = fvp.patch();
221 patchCellTypes[cellMap[fc[i]]] = patchCellType::OVERSET;
224 boundBox faceBb(
pp.points(),
pp[i],
false);
225 faceBb.grow(smallVec);
227 if (bb.overlaps(faceBb))
229 fill(
patchTypes, bb, nDivs, faceBb, patchCellType::OVERSET);
241 const PackedList<2>& vals,
242 const treeBoundBox& subBb,
243 const unsigned int val
248 labelVector minIds(index3(bb, nDivs, subBb.min()));
249 labelVector maxIds(index3(bb, nDivs, subBb.max()));
251 for (
direction cmpt = 0; cmpt < 3; cmpt++)
253 if (maxIds[cmpt] < 0 || minIds[cmpt] > nDivs[cmpt])
261 maxIds =
min(maxIndex, maxIds);
263 for (label i = minIds[0]; i <= maxIds[0]; i++)
265 for (label j = minIds[1]; j <= maxIds[1]; j++)
267 for (label
k = minIds[2];
k <= maxIds[2];
k++)
270 if (vals[i1] == patchCellType::PATCH)
283 PstreamBuffers& pBufs,
285 const PtrList<fvMeshSubset>& meshParts,
287 const List<treeBoundBoxList>& patchBb,
288 const List<labelVector>& patchDivisions,
289 const PtrList<PackedList<2>>& patchParts,
298 const labelList& tgtCellMap = meshParts[tgtI].cellMap();
305 if (srcPatchBb.overlaps(tgtPatchBb))
307 const PackedList<2>& srcPatchTypes = patchParts[srcI];
308 const labelVector& zoneDivs = patchDivisions[srcI];
310 forAll(tgtCellMap, tgtCelli)
312 label celli = tgtCellMap[tgtCelli];
313 treeBoundBox cBb(mesh_.cellBb(celli));
328 allCellTypes[celli] = HOLE;
342 const treeBoundBox& tgtPatchBb = tgtPatchBbs[procI];
344 if (srcPatchBb.overlaps(tgtPatchBb))
348 UOPstream
os(procI, pBufs);
349 os << srcPatchBb << patchDivisions[srcI] << patchParts[srcI];
353 pBufs.finishedSends();
358 const treeBoundBox& srcPatchBb = srcPatchBbs[procI];
361 if (srcPatchBb.overlaps(tgtPatchBb))
363 UIPstream is(procI, pBufs);
364 const treeBoundBox receivedBb(is);
366 const PackedList<2> srcPatchTypes(is);
369 if (srcPatchBb != receivedBb)
373 <<
" srcPatchBb:" << srcPatchBb
374 <<
" receivedBb:" << receivedBb
378 forAll(tgtCellMap, tgtCelli)
380 label celli = tgtCellMap[tgtCelli];
381 treeBoundBox cBb(mesh_.cellBb(celli));
396 allCellTypes[celli] = HOLE;
407 const label destMesh,
408 const label currentDonorMesh,
409 const label newDonorMesh
422 if (currentDonorMesh == -1)
428 const label currentDist =
mag(currentDonorMesh-destMesh);
429 const label newDist =
mag(newDonorMesh-destMesh);
431 if (newDist < currentDist)
435 else if (newDist == currentDist && newDonorMesh > currentDonorMesh)
449 const globalIndex& globalCells,
450 PstreamBuffers& pBufs,
451 const PtrList<fvMeshSubset>& meshParts,
452 const List<treeBoundBoxList>&
meshBb,
465 const fvMesh& srcMesh = meshParts[srcI].subMesh();
466 const labelList& srcCellMap = meshParts[srcI].cellMap();
467 const fvMesh& tgtMesh = meshParts[tgtI].subMesh();
468 const pointField& tgtCc = tgtMesh.cellCentres();
469 const labelList& tgtCellMap = meshParts[tgtI].cellMap();
475 forAll(tgtCellMap, tgtCelli)
477 const label srcCelli = tgtToSrcAddr[tgtCelli];
481 && allCellTypes[tgtCellMap[tgtCelli]] != HOLE
484 label celli = tgtCellMap[tgtCelli];
488 if (betterDonor(tgtI, allDonor[celli], srcI))
491 globalCells.toGlobal(srcCellMap[srcCelli]);
492 allStencil[celli].setSize(1);
493 allStencil[celli][0] = globalDonor;
494 allDonor[celli] = srcI;
515 tgtOverlapProcs.append(procI);
519 srcOverlapProcs.append(procI);
527 forAll(srcOverlapProcs, i)
529 label procI = srcOverlapProcs[i];
530 tgtSendCells[procI].reserve(tgtMesh.nCells()/srcOverlapProcs.size());
534 forAll(tgtCellMap, tgtCelli)
536 label celli = tgtCellMap[tgtCelli];
537 if (srcOverlapProcs.size())
539 treeBoundBox subBb(mesh_.cellBb(celli));
540 subBb.grow(smallVec_);
542 forAll(srcOverlapProcs, i)
544 const label procI = srcOverlapProcs[i];
545 if (subBb.overlaps(srcBbs[procI]))
547 tgtSendCells[procI].append(tgtCelli);
556 forAll(srcOverlapProcs, i)
558 label procI = srcOverlapProcs[i];
559 const labelList& cellIDs = tgtSendCells[procI];
561 UOPstream
os(procI, pBufs);
564 pBufs.finishedSends();
567 (void)srcMesh.tetBasePtIs();
568 forAll(tgtOverlapProcs, i)
570 label procI = tgtOverlapProcs[i];
572 UIPstream is(procI, pBufs);
582 donors[sampleI] = globalCells.toGlobal(srcCellMap[srcCelli]);
587 UOPstream
os(procI, pBufs);
590 pBufs.finishedSends();
592 forAll(srcOverlapProcs, i)
594 label procI = srcOverlapProcs[i];
595 const labelList& cellIDs = tgtSendCells[procI];
597 UIPstream is(procI, pBufs);
600 if (donors.size() != cellIDs.size())
608 label globalDonor = donors[donorI];
610 if (globalDonor != -1)
612 label celli = tgtCellMap[cellIDs[donorI]];
616 if (betterDonor(tgtI, allDonor[celli], srcI))
618 allStencil[celli].setSize(1);
619 allStencil[celli][0] = globalDonor;
620 allDonor[celli] = srcI;
932 for (label faceI = 0; faceI <
mesh.nInternalFaces(); faceI++)
938 (ownType ==
HOLE && neiType !=
HOLE)
939 || (ownType !=
HOLE && neiType ==
HOLE)
953 for (label faceI =
mesh.nInternalFaces(); faceI <
mesh.nFaces(); faceI++)
956 label neiType = nbrCellTypes[faceI-
mesh.nInternalFaces()];
960 (ownType ==
HOLE && neiType !=
HOLE)
961 || (ownType !=
HOLE && neiType ==
HOLE)
974 const label nRegions = cellRegion.
nRegions();
1002 << nRegions <<
endl;
1023 for (label faceI = 0; faceI <
mesh.nInternalFaces(); faceI++)
1027 label ownRegion = cellRegion[own[faceI]];
1031 if (regionType[ownRegion] == 0)
1033 regionType[ownRegion] = 1;
1037 label neiRegion = cellRegion[nei[faceI]];
1041 if (regionType[neiRegion] == 0)
1043 regionType[neiRegion] = 1;
1050 label faceI =
mesh.nInternalFaces();
1051 faceI <
mesh.nFaces();
1057 label ownRegion = cellRegion[own[faceI]];
1059 if (regionType[ownRegion] == 0)
1061 regionType[ownRegion] = 1;
1077 for (
const label celli : fvp.
faceCells())
1079 label regionI = cellRegion[celli];
1083 regionType[regionI] = 2;
1131 label cellI = fc[i];
1132 label regionI = cellRegion[cellI];
1134 if (regionType[regionI] != 2)
1136 const labelList& slots = compactStencil[cellI];
1139 label otherType = cellRegionType[slots[i]];
1146 regionType[regionI] = 2;
1158 << nChanged <<
endl;
1169 forAll(cellRegion, cellI)
1171 label
type = regionType[cellRegion[cellI]];
1190 weights.
setSize(donorCcs.size());
1194 const scalar d =
mag(
sample-donorCcs[i]);
1198 weights[i] = scalar(1)/d;
1204 weights = scalar(0);
1205 weights[i] = scalar(1);
1225 const labelList& owner = mesh_.faceOwner();
1226 const labelList& neighbour = mesh_.faceNeighbour();
1230 boolList isDonor(cellInterpolationMap().constructSize(),
false);
1231 label nHoleDonors = 0;
1233 for (
const label celli : interpolationCells_)
1235 const labelList& slots = cellStencil_[celli];
1244 cellInterpolationMap().constructMap(),
1246 cellInterpolationMap().subMap(),
1256 forAll(cellTypes_, celli)
1263 reduce(nHoleDonors, sumOp<label>());
1266 Pout<<
"Detected " << nHoleDonors
1267 <<
" hole cells that are used as donors" <<
endl;
1280 cellInterpolationMap().distribute(globalCellIDs);
1282 forAll(interpolationCells_, i)
1284 label cellI = interpolationCells_[i];
1285 const labelList& slots = cellStencil_[cellI];
1286 cellStencil_[cellI] = UIndirectList<label>(globalCellIDs, slots)();
1293 label nSpecialNear = 0;
1294 label nSpecialFar = 0;
1301 List<pointList> donorCcs(mesh_.nCells());
1304 for (label facei = 0; facei < mesh_.nInternalFaces(); ++facei)
1306 const label own = owner[facei];
1308 const label nbr = neighbour[facei];
1311 if (isDonor[own] && ownHole && !nbrHole)
1313 donorCells[own].append(globalCells.
toGlobal(nbr));
1314 donorCcs[own].append(mesh_.cellCentres()[nbr]);
1316 else if (isDonor[nbr] && nbrHole && !ownHole)
1318 donorCells[nbr].append(globalCells.
toGlobal(own));
1319 donorCcs[nbr].append(mesh_.cellCentres()[own]);
1330 const label facei = bFacei+mesh_.nInternalFaces();
1331 const label own = owner[facei];
1335 if (isDonor[own] && ownHole && !nbrHole)
1337 donorCells[own].append(nbrCells[bFacei]);
1338 donorCcs[own].append(nbrCc[bFacei]);
1344 if (donorCcs[celli].size())
1346 cellStencil_[celli] = std::move(donorCells[celli]);
1349 mesh_.cellCentres()[celli],
1351 cellInterpolationWeights_[celli]
1353 cellTypes_[celli] = SPECIAL;
1354 interpolationCells_.append(celli);
1355 cellInterpolationWeight_[celli] = scalar(1);
1369 List<topoDistanceData<int>> cellData(mesh_.nCells());
1370 List<topoDistanceData<int>> faceData(mesh_.nFaces());
1372 int dummyTrackData(0);
1376 forAll(cellTypes_, celli)
1378 label cType = cellTypes_[celli];
1385 cellData[celli] = topoDistanceData<int>(
labelMin, 0);
1389 DynamicList<label> seedFaces(nHoleDonors);
1390 DynamicList<topoDistanceData<int>> seedData(nHoleDonors);
1392 for (label facei = 0; facei < mesh_.nInternalFaces(); ++facei)
1394 const label own = owner[facei];
1395 const bool ownLive =
1401 const label nbr = neighbour[facei];
1402 const bool nbrLive =
1408 if (ownLive && !nbrLive)
1410 seedFaces.append(facei);
1411 const label globalOwn = globalCells.
toGlobal(own);
1412 seedData.append(topoDistanceData<int>(globalOwn, 0));
1414 else if (!ownLive && nbrLive)
1416 seedFaces.append(facei);
1417 const label globalNbr = globalCells.
toGlobal(nbr);
1418 seedData.append(topoDistanceData<int>(globalNbr, 0));
1424 const label facei = bFacei+mesh_.nInternalFaces();
1425 const label own = owner[facei];
1426 const bool ownLive =
1431 const bool nbrLive =
1437 if (ownLive && !nbrLive)
1439 seedFaces.append(facei);
1440 const label globalOwn = globalCells.
toGlobal(own);
1441 seedData.append(topoDistanceData<int>(globalOwn, 0));
1446 FaceCellWave<topoDistanceData<int>> distanceCalc
1453 mesh_.globalData().nTotalCells()+1,
1466 && cellData[celli].valid(dummyTrackData)
1469 cellStencil_[celli].setSize(1);
1470 cellStencil_[celli] = cellData[celli].data();
1471 cellInterpolationWeights_[celli].setSize(1);
1472 cellInterpolationWeights_[celli] = 1.0;
1473 cellTypes_[celli] = SPECIAL;
1474 interpolationCells_.append(celli);
1475 cellInterpolationWeight_[celli] = 1.0;
1482 reduce(nSpecialNear, sumOp<label>());
1483 reduce(nSpecialFar, sumOp<label>());
1485 Pout<<
"Detected " << nHoleDonors
1486 <<
" hole cells that are used as donors of which" <<
nl
1487 <<
" next to live cells : " << nSpecialNear <<
nl
1488 <<
" other : " << nSpecialFar <<
nl
1494 List<Map<label>> compactMap;
1495 cellInterpolationMap_.reset
1511 const bool allowHoleDonors
1529 const vector greatPoint(GREAT, GREAT, GREAT);
1531 boolList isValidDonor(mesh_.nCells(),
true);
1532 if (!allowHoleDonors)
1534 forAll(cellTypes_, celli)
1536 if (cellTypes_[celli] == HOLE)
1538 isValidDonor[celli] =
false;
1544 bitSet doneAcceptor(interpolationCells_.size());
1553 forAll(interpolationCells_, i)
1555 if (!doneAcceptor[i])
1557 label cellI = interpolationCells_[i];
1558 const point& cc = mesh_.cellCentres()[cellI];
1559 const labelList& slots = cellStencil_[cellI];
1563 if (slots.size() > 1)
1568 else if (slots.size())
1572 const label elemi = slots[sloti];
1577 minMagSqrEqOp<point>()(
samples[elemi], cc);
1596 cellInterpolationMap().constructMap(),
1598 cellInterpolationMap().subMap(),
1602 minMagSqrEqOp<point>(),
1605 cellInterpolationMap().comm()
1611 DynamicList<label> donorCells(mesh_.nCells());
1614 if (
samples[cellI] != greatPoint)
1616 donorCells.append(cellI);
1638 label cellI = donorCells[i];
1639 const pointList& donorCentres = donorCellCentres[cellI];
1651 cellInterpolationMap().distribute(donorCellCells);
1652 cellInterpolationMap().distribute(donorWeights);
1653 cellInterpolationMap().distribute(
samples);
1656 forAll(interpolationCells_, i)
1658 if (!doneAcceptor[i])
1660 label cellI = interpolationCells_[i];
1661 const labelList& slots = cellStencil_[cellI];
1663 if (slots.size() > 1)
1668 else if (slots.size() == 1)
1670 const label sloti = slots[0];
1673 if (
samples[sloti] == mesh_.cellCentres()[cellI])
1675 cellStencil_[cellI].transfer(donorCellCells[sloti]);
1676 cellInterpolationWeights_[cellI].transfer
1682 doneAcceptor.set(i);
1690 List<Map<label>> compactMap;
1691 cellInterpolationMap_.reset
1705Foam::cellCellStencils::inverseDistance::inverseDistance
1712 cellCellStencil(
mesh),
1717 dict.getOrDefault(
"allowInterpolatedDonors", true)
1729 "cellInterpolationWeight",
1730 mesh_.facesInstance(),
1751 mesh_.time().timeName(),
1761 Pout<<
"Reading cellTypes from time " <<
mesh_.time().timeName()
1766 forAll(volCellTypes, celli)
1790 scalar layerRelax(
dict_.getOrDefault(
"layerRelax", 1.0));
1792 scalar tol =
dict_.getOrDefault(
"tolerance", 1
e-10);
1801 nCellsPerZone[
zoneID[cellI]]++;
1823 const fvMesh& subMesh = meshParts[zonei].subMesh();
1856 bbs[procI] = procBb[procI][zoneI];
1872 if (
dict_.readIfPresent(
"searchBox", globalPatchBb))
1886 if (
dict_.readIfPresent(
"searchBoxDivisions", globalDivs))
1888 patchDivisions = globalDivs;
1894 if (
mesh_.nGeometricD() == 1)
1896 nDivs =
mesh_.nCells();
1898 else if (
mesh_.nGeometricD() == 2)
1919 forAll(patchParts, zoneI)
1926 patchDivisions[zoneI][0]
1927 *patchDivisions[zoneI][1]
1928 *patchDivisions[zoneI][2]
1933 meshParts[zoneI].subMesh(),
1937 patchDivisions[zoneI],
1940 meshParts[zoneI].cellMap(),
1948 Info<<
type() <<
" : detected " << nZones
1949 <<
" mesh regions" <<
endl;
1951 forAll(nCellsPerZone, zoneI)
1954 <<
" nCells:" << nCellsPerZone[zoneI]
1955 <<
" voxels:" << patchDivisions[zoneI]
1975 for (label srcI = 0; srcI < meshParts.
size()-1; srcI++)
1977 for (label tgtI = srcI+1; tgtI < meshParts.
size(); tgtI++)
2011 for (label srcI = 0; srcI < meshParts.
size()-1; srcI++)
2013 for (label tgtI = srcI+1; tgtI < meshParts.
size(); tgtI++)
2056 tallDonorID().write();
2060 forAll(allPatchTypes, cellI)
2062 if (allCellTypes[cellI] !=
HOLE)
2064 switch (allPatchTypes[cellI])
2069 if (allStencil[cellI].size())
2075 allCellTypes[cellI] =
HOLE;
2112 forAll(allStencil, celli)
2114 stencilSize[celli] = allStencil[celli].
size();
2124 forAll(allCellTypes, celli)
2126 if (allCellTypes[celli] ==
HOLE && allStencil[celli].size())
2128 allStencil[celli].
clear();
2178 mapDistribute map(globalCells, compactStencil, compactStencilMap);
2184 label useLayer =
dict_.getOrDefault(
"useLayer", -1);
2190 "oversetInterpolation"
2205 dict_.getOrDefault(
"holeLayers", 1),
2223 label nCalculated = 0;
2229 if (allStencil[celli].size() == 0)
2232 allCellTypes[celli] =
HOLE;
2233 allStencil[celli].
clear();
2245 Pout<<
"Detected " << nCalculated <<
" cells changing from hole"
2246 <<
" to calculated. Changed to interpolated"
2296 label nInterpolatedDonors = 0;
2301 const labelList& slots = compactStencil[celli];
2306 compactCellTypes[slots[0]] ==
HOLE
2317 nInterpolatedDonors++;
2338 <<
"interpolate Donors : "
2339 << nInterpolatedDonors <<
endl;
2362 mesh_.time().write();
2367 Pout<<
type() <<
" : dumping injectionStencil to "
2377 const point& accCc =
mesh_.cellCentres()[celli];
2380 const point& donorCc = cc[slots[i]];
2381 str.
writeLine(accCc, 0.1*accCc+0.9*donorCc);
2412 if (
mag(wghts[i]) >
mag(maxMagWeight[celli]))
2414 maxMagWeight[celli] = wghts[i];
2417 if (
mag(maxMagWeight[celli]) > 1)
2420 Pout<<
"cell:" << celli
2421 <<
" at:" << cc[celli]
2422 <<
" zone:" <<
zoneID[celli]
2424 <<
" weights:" << wghts
2470 mesh_.time().timePath()
2471 +
"/stencil_" +
name(zonei) +
".obj"
2475 const labelList& subMeshCellMap = meshParts[zonei].cellMap();
2477 forAll(subMeshCellMap, subcelli)
2479 const label celli = subMeshCellMap[subcelli];
2481 const point& accCc =
mesh_.cellCentres()[celli];
2484 const point& donorCc = cc[slots[i]];
2485 str.
writeLine(accCc, 0.1*accCc+0.9*donorCc);
2503 bool hasLocal =
false;
2504 bool hasRemote =
false;
2508 if (slots[sloti] >=
mesh_.nCells())
2535 Info<<
"Overset analysis : nCells : "
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const polyBoundaryMesh & pbm
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
Wave propagation of information through grid. Every iteration information goes through one layer of c...
Minimal example by using system/controlDict.functions:
@ NO_REGISTER
Do not request registration (bool: false).
@ READ_IF_PRESENT
Reading is optional [identical to LAZY_READ].
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void append(const T &val)
Append an element at the end of the list.
void setSize(label n)
Alias for resize().
void clear()
Clear the list, i.e. set size to zero.
static const List< T > & null() noexcept
Return a null List (reference to a nullObject). Behaves like an empty List.
An OFstream that keeps track of vertices and provides convenience output methods for OBJ files.
Ostream & writeLine(const point &p0, const point &p1)
Write line joining two points.
virtual const fileName & name() const override
Read/write access to the name of the stream.
A dynamic list of packed unsigned integers, with the number of bits per item specified by the <Width>...
Buffers for inter-processor communications streams (UOPstream, UIPstream).
void finishedSends(const bool wait=true)
Mark the send phase as being finished.
void clear()
Clear all send/recv buffers and reset states.
static void allGatherList(UList< T > &values, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Gather data, but keep individual values separate. Uses MPI_Allgather or manual communication.
static void listReduce(UList< T > &values, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce list elements (list must be equal size on all ranks), applying bop to each list element.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
Input inter-processor communications stream using MPI send/recv etc. - operating on external buffer.
A List with indirect addressing. Like IndirectList but does not store addressing.
T * data() noexcept
Return pointer to the underlying array serving as data storage.
void size(const label n)
Older name for setAddressableSize.
Output inter-processor communications stream using MPI send/recv etc. - operating on external buffer.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
@ nonBlocking
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
static int & msgType() noexcept
Message tag of standard messages.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run.
static rangeType allProcs(const label communicator=worldComm)
Range of process indices for all processes.
label size() const noexcept
The number of entries in the list.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void set(const bitSet &bitset)
Set specified bits from another bitset.
A bounding box defined in terms of min/max extrema points.
const point & max() const noexcept
Maximum describing the bounding box.
void grow(const scalar delta)
Expand box by adjusting min/max by specified amount in each dimension.
bool overlaps(const boundBox &bb) const
Overlaps/touches boundingBox?
const point & min() const noexcept
Minimum describing the bounding box.
vector span() const
The bounding box span (from minimum to maximum).
Calculation of interpolation stencils.
const fvMesh & mesh_
Reference to the mesh.
void walkFront(const globalIndex &globalCells, const scalar layerRelax, const labelListList &allStencil, labelList &allCellTypes, scalarField &allWeight, const scalarList &compactCellVol, const labelListList &compactStencil, const labelList &zoneID, const label holeLayers, const label useLayer) const
Surround holes with layer(s) of interpolated cells.
static labelList count(const label size, const labelUList &lst)
Count occurrences (in parallel).
const labelIOList & zoneID() const
Helper: get reference to registered zoneID. Loads volScalarField.
static const labelIOList & zoneID(const fvMesh &)
Helper: get reference to registered zoneID. Loads volScalarField.
void suppressMotionFields()
Helper: populate nonInterpolatedFields_ with motion solver.
static void globalCellCells(const globalIndex &gi, const polyMesh &mesh, const boolList &isValidDonor, const labelList &selectedCells, labelListList &cellCells, pointListList &cellCellCentres)
Helper: create cell-cell addressing in global numbering.
Inverse-distance-weighted interpolation stencil.
vector smallVec_
Small perturbation vector for geometric tests.
labelList cellTypes_
Per cell the cell type.
void markDonors(const globalIndex &globalCells, PstreamBuffers &pBufs, const PtrList< fvMeshSubset > &meshParts, const List< treeBoundBoxList > &meshBb, const labelList &allCellTypes, const label srcI, const label tgtI, labelListList &allStencil, labelList &allDonor) const
Determine donors for all tgt cells.
static bool overlaps(const boundBox &bb, const labelVector &nDivs, const PackedList< 2 > &voxels, const treeBoundBox &subBb, const unsigned int val)
Is any voxel inside subBb set to val.
virtual void stencilWeights(const point &sample, const pointList &donorCcs, scalarList &weights) const
Calculate inverse distance weights for a single acceptor.
static point position(const boundBox &bb, const labelVector &nDivs, const label boxI)
Convert index back into coordinate.
static label index(const labelVector &nDivs, const labelVector &)
Convert ijk indices into single index.
virtual ~inverseDistance()
Destructor.
virtual const labelUList & interpolationCells() const
Indices of interpolated cells.
static void markBoundaries(const fvMesh &mesh, const vector &smallVec, const boundBox &bb, const labelVector &nDivs, PackedList< 2 > &patchTypes, const labelList &cellMap, labelList &patchCellTypes)
Mark voxels of patchTypes with type of patch face.
void findHoles(const globalIndex &globalCells, const fvMesh &mesh, const labelList &zoneID, const labelListList &stencil, labelList &cellTypes) const
Do flood filling to detect unreachable (from patches) sections.
static labelVector index3(const labelVector &nDivs, const label)
Convert single index into ijk.
const bool allowHoleDonors_
Allow holes as donors.
bool betterDonor(const label destMesh, const label currentDonorMesh, const label newDonorMesh) const
If multiple donors meshes: decide which is best.
virtual const mapDistribute & cellInterpolationMap() const
Return a communication schedule.
labelListList cellStencil_
Interpolation stencil.
virtual const labelUList & cellTypes() const
Return the cell type list.
const bool allowInterpolatedDonors_
Allow interpolared as donors.
autoPtr< mapDistribute > cellInterpolationMap_
Fetch interpolated cells.
virtual bool update()
Update stencils. Return false if nothing changed.
void holeExtrapolationStencil(const globalIndex &globalCells)
Make holes next to live ones type SPECIAL and include in interpolation stencil.
const dictionary dict_
Dictionary of motion control parameters.
volScalarField cellInterpolationWeight_
Amount of interpolation.
scalarListList cellInterpolationWeights_
Interpolation weights.
static void fill(PackedList< 2 > &elems, const boundBox &bb, const labelVector &nDivs, const boundBox &subBb, const unsigned int val)
Fill all elements overlapping subBb with value val.
labelList interpolationCells_
Indices of interpolated cells.
void markPatchesAsHoles(PstreamBuffers &pBufs, const PtrList< fvMeshSubset > &meshParts, const List< treeBoundBoxList > &patchBb, const List< labelVector > &patchDivisions, const PtrList< PackedList< 2 > > &patchParts, const label srcI, const label tgtI, labelList &allCellTypes) const
Mark all cells overlapping (a voxel covered by) a src patch.
virtual void createStencil(const globalIndex &, const bool allowHoleDonors)
Create stencil starting from the donor containing the acceptor allowHoleDonors : allow donors of type...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
A fvBoundaryMesh is a fvPatch list with a reference to the associated fvMesh, with additional search ...
Holds a reference to the original mesh (the baseMesh) and optionally to a subset of that mesh (the su...
Mesh data needed to do the Finite Volume discretisation.
Template invariant parts for fvPatchField.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
const polyPatch & patch() const noexcept
Return the polyPatch.
static bool constraintType(const word &patchType)
Return true if the given type is a constraint type.
virtual const labelUList & faceCells() const
Return faceCells.
Selector class for finite volume differencing schemes. fvMesh is derived from fvSchemes so that all f...
Calculates a non-overlapping list of offsets based on an input size (eg, number of cells) from differ...
void inplaceToGlobal(const label proci, labelUList &labels) const
From local to global index on proci (inplace).
label toGlobal(const label proci, const label i) const
From local to global on proci.
static void distribute(const UPstream::commsTypes commsType, const UList< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &field, const T &nullValue, const CombineOp &cop, const NegateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Distribute combine data with specified combine operation and negate operator (for flips).
Class containing processor-to-processor mapping information.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute List data using default commsType, default flip/negate operator.
static void correctBoundaryConditions(typename GeoField::Boundary &bfld)
Correct boundary conditions of certain type (TypeOnly = true) or explicitly not of the type (TypeOnly...
Boundary condition for use on overset patches. To be run in combination with special dynamicFvMesh ty...
label nGeometricD() const
Return the number of valid geometric dimensions in the mesh.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
virtual const pointField & points() const
Return raw points.
A patch is a list of labels that address the faces in the global face list.
const vectorField & cellCentres() const
label nPoints() const noexcept
Number of mesh points.
label nCells() const noexcept
Number of mesh cells.
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
label nRegions() const
Return total number of regions.
A class for managing temporary objects.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
For use with FaceCellWave. Determines topological distance to starting faces. Templated on passive tr...
Standard boundBox with extra functionality for use in octree.
bool overlaps(const boundBox &bb) const
Overlaps with other bounding box, sphere etc?
static void calculate(const polyMesh &src, const polyMesh &tgt, labelList &srcToTgtAddr)
Calculate addressing.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
const bitSet isBlockedFace(intersectedFaces())
#define DebugInfo
Report an information message using Foam::Info.
Namespace for handling debugging switches.
List< scalarList > scalarListList
List of scalarList.
bool returnReduceOr(const bool value, const int communicator=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
Vector< label > labelVector
Vector of labels.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
UIndirectList< label > labelUIndList
UIndirectList of labels.
IOList< label > labelIOList
IO for a List of label.
List< treeBoundBox > treeBoundBoxList
A List of treeBoundBox.
messageStream Info
Information stream (stdout output on master, null elsewhere).
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & indent(Ostream &os)
Indent stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void reduce(T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce).
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
List< point > pointList
List of point.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
errorManip< error > abort(error &err)
vector point
Point is a vector.
List< bool > boolList
A List of bools.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
dimensionedScalar cbrt(const dimensionedScalar &ds)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
vectorField pointField
pointField is a vectorField.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
labelList findIndices(const ListType &input, typename ListType::const_reference val, label start=0)
Linear search to find all occurrences of given element.
errorManipArg< error, int > exit(error &err, const int errNo=1)
UList< label > labelUList
A UList of labels.
List< scalar > scalarList
List of scalar.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
Type gMax(const FieldField< Field, Type > &f)
List< pointList > pointListList
List of pointList.
static tmp< volScalarField > createField(const fvMesh &mesh, const scalar val)
constexpr char nl
The newline '\n' character (0x0a).
wordList patchTypes(nPatches)
List< treeBoundBox > meshBb(1, treeBoundBox(coarseMesh.points()).extend(rndGen, 1e-3))
Us boundaryFieldRef().evaluateCoupled< coupledFaPatch >()
#define forAll(list, i)
Loop across all elements in list.
Functor to negate primitives. Dummy for most other types.
const label nSamples(pdfDictionary.get< label >("nSamples"))
scalarField samples(nIntervals, Zero)