50namespace cellCellStencils
65 return (ijk[0]*nDivs[1] + ijk[1])*nDivs[2] + ijk[2];
75 label ij = boxI/nDivs[2];
76 label
k = boxI-ij*nDivs[2];
77 label i = ij/nDivs[1];
78 label j = ij-i*nDivs[1];
96 floor(relPt[0]/d[0]*nDivs[0]),
97 floor(relPt[1]/d[1]*nDivs[1]),
98 floor(relPt[2]/d[2]*nDivs[2])
114 const vector sz(d[0]/nDivs[0], d[1]/nDivs[1], d[2]/nDivs[2]);
116 return bb.
min()+0.5*sz+
vector(sz[0]*ids[0], sz[1]*ids[1], sz[2]*ids[2]);
126 const unsigned int val
132 for (
direction cmpt = 0; cmpt < 3; cmpt++)
134 if (maxIds[cmpt] < 0 || minIds[cmpt] > nDivs[cmpt])
142 maxIds =
min(maxIndex, maxIds);
144 for (label i = minIds[0]; i <= maxIds[0]; i++)
146 for (label j = minIds[1]; j <= maxIds[1]; j++)
148 for (label
k = minIds[2];
k <= maxIds[2];
k++)
180 const fvPatch& fvp = pbm[patchI];
191 patchCellTypes[cellMap[fc[i]]] = patchCellType::PATCH;
195 faceBb.
min() -= smallVec;
196 faceBb.
max() += smallVec;
200 fill(
patchTypes, bb, nDivs, faceBb, patchCellType::PATCH);
209 const fvPatch& fvp = pbm[patchI];
212 if (isA<oversetFvPatch>(fvp))
219 patchCellTypes[cellMap[fc[i]]] = patchCellType::OVERSET;
223 faceBb.
min() -= smallVec;
224 faceBb.
max() += smallVec;
228 fill(
patchTypes, bb, nDivs, faceBb, patchCellType::OVERSET);
248 vector(GREAT, GREAT, GREAT),
249 vector(-GREAT, -GREAT, -GREAT)
256 const face&
f = faces[cFaces[cFacei]];
276 const unsigned int val
284 for (
direction cmpt = 0; cmpt < 3; cmpt++)
286 if (maxIds[cmpt] < 0 || minIds[cmpt] > nDivs[cmpt])
294 maxIds =
min(maxIndex, maxIds);
296 for (label i = minIds[0]; i <= maxIds[0]; i++)
298 for (label j = minIds[1]; j <= maxIds[1]; j++)
300 for (label
k = minIds[2];
k <= maxIds[2];
k++)
303 if (vals[i1] == patchCellType::PATCH)
338 if (srcPatchBb.
overlaps(tgtPatchBb))
341 const labelVector& zoneDivs = patchDivisions[srcI];
343 forAll(tgtCellMap, tgtCelli)
345 label celli = tgtCellMap[tgtCelli];
347 cBb.
min() -= smallVec_;
348 cBb.
max() += smallVec_;
362 allCellTypes[celli] = HOLE;
378 if (srcPatchBb.
overlaps(tgtPatchBb))
383 os << srcPatchBb << patchDivisions[srcI] << patchParts[srcI];
396 if (srcPatchBb.
overlaps(tgtPatchBb))
401 if (srcPatchBb != receivedBb)
405 <<
" srcPatchBb:" << srcPatchBb
406 <<
" receivedBb:" << receivedBb
413 forAll(tgtCellMap, tgtCelli)
415 label celli = tgtCellMap[tgtCelli];
417 cBb.
min() -= smallVec_;
418 cBb.
max() += smallVec_;
431 allCellTypes[celli] = HOLE;
442 const label destMesh,
443 const label currentDonorMesh,
444 const label newDonorMesh
457 if (currentDonorMesh == -1)
463 const label currentDist =
mag(currentDonorMesh-destMesh);
464 const label newDist =
mag(newDonorMesh-destMesh);
466 if (newDist < currentDist)
470 else if (newDist == currentDist && newDonorMesh > currentDonorMesh)
509 waveMethod::calculate(tgtMesh, srcMesh, tgtToSrcAddr);
510 forAll(tgtCellMap, tgtCelli)
512 label srcCelli = tgtToSrcAddr[tgtCelli];
513 if (srcCelli != -1 && allCellTypes[srcCellMap[srcCelli]] != HOLE)
515 label celli = tgtCellMap[tgtCelli];
519 if (betterDonor(tgtI, allDonor[celli], srcI))
522 globalCells.
toGlobal(srcCellMap[srcCelli]);
524 allStencil[celli][0] = globalDonor;
525 allDonor[celli] = srcI;
546 tgtOverlapProcs.
append(procI);
550 srcOverlapProcs.
append(procI);
559 forAll(srcOverlapProcs, i)
561 label procI = srcOverlapProcs[i];
562 tgtSendCells[procI].reserve(tgtMesh.
nCells()/srcOverlapProcs.
size());
566 forAll(tgtCellMap, tgtCelli)
568 label celli = tgtCellMap[tgtCelli];
569 if (srcOverlapProcs.
size())
572 subBb.
min() -= smallVec_;
573 subBb.
max() += smallVec_;
575 forAll(srcOverlapProcs, i)
577 label procI = srcOverlapProcs[i];
580 tgtSendCells[procI].
append(tgtCelli);
589 forAll(srcOverlapProcs, i)
591 label procI = srcOverlapProcs[i];
595 os << UIndirectList<point>(tgtCc,
cellIDs);
601 forAll(tgtOverlapProcs, i)
603 label procI = tgtOverlapProcs[i];
613 if (srcCelli != -1 && allCellTypes[srcCellMap[srcCelli]] != HOLE)
615 donors[sampleI] = globalCells.
toGlobal(srcCellMap[srcCelli]);
625 forAll(srcOverlapProcs, i)
627 label procI = srcOverlapProcs[i];
641 label globalDonor = donors[donorI];
643 if (globalDonor != -1)
645 label celli = tgtCellMap[
cellIDs[donorI]];
649 if (betterDonor(tgtI, allDonor[celli], srcI))
652 allStencil[celli][0] = globalDonor;
653 allDonor[celli] = srcI;
963 for (label faceI = 0; faceI <
mesh.nInternalFaces(); faceI++)
969 (ownType == HOLE && neiType != HOLE)
970 || (ownType != HOLE && neiType == HOLE)
973 isBlockedFace[faceI] =
true;
984 for (label faceI =
mesh.nInternalFaces(); faceI <
mesh.nFaces(); faceI++)
987 label neiType = nbrCellTypes[faceI-
mesh.nInternalFaces()];
991 (ownType == HOLE && neiType != HOLE)
992 || (ownType != HOLE && neiType == HOLE)
995 isBlockedFace[faceI] =
true;
1001 << nBlocked <<
endl;
1005 const label nRegions = cellRegion.
nRegions();
1033 << nRegions <<
endl;
1054 for (label faceI = 0; faceI <
mesh.nInternalFaces(); faceI++)
1056 if (isBlockedFace[faceI])
1058 label ownRegion = cellRegion[own[faceI]];
1062 if (regionType[ownRegion] == 0)
1064 regionType[ownRegion] = 1;
1068 label neiRegion = cellRegion[nei[faceI]];
1072 if (regionType[neiRegion] == 0)
1074 regionType[neiRegion] = 1;
1081 label faceI =
mesh.nInternalFaces();
1082 faceI <
mesh.nFaces();
1086 if (isBlockedFace[faceI])
1088 label ownRegion = cellRegion[own[faceI]];
1090 if (regionType[ownRegion] == 0)
1092 regionType[ownRegion] = 1;
1102 const fvPatch& fvp = pbm[patchI];
1104 if (isA<oversetFvPatch>(fvp))
1111 label regionI = cellRegion[fc[i]];
1113 if (
cellTypes[fc[i]] != HOLE && regionType[regionI] != 2)
1115 regionType[regionI] = 2;
1156 const fvPatch& fvp = pbm[patchI];
1158 if (isA<oversetFvPatch>(fvp))
1163 label cellI = fc[i];
1164 label regionI = cellRegion[cellI];
1166 if (regionType[regionI] != 2)
1168 const labelList& slots = compactStencil[cellI];
1171 label otherType = cellRegionType[slots[i]];
1178 regionType[regionI] = 2;
1190 << nChanged <<
endl;
1200 forAll(cellRegion, cellI)
1202 label
type = regionType[cellRegion[cellI]];
1215 const scalar wantedFraction,
1220 const cell& cFaces = mesh_.cells()[cellI];
1223 label nbrFacei = cFaces[i];
1224 if (fraction[nbrFacei] < wantedFraction)
1226 fraction[nbrFacei] = wantedFraction;
1227 isFront.
set(nbrFacei);
1235 const scalar layerRelax,
1242 bitSet isFront(mesh_.nFaces());
1251 if (isA<oversetFvPatch>(fvm[patchI]))
1256 label cellI = fc[i];
1257 if (allCellTypes[cellI] == INTERPOLATED)
1262 isFront.
set(fvm[patchI].start()+i);
1271 const labelList& own = mesh_.faceOwner();
1272 const labelList& nei = mesh_.faceNeighbour();
1274 for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
1276 label ownType = allCellTypes[own[faceI]];
1277 label neiType = allCellTypes[nei[faceI]];
1280 (ownType == HOLE && neiType != HOLE)
1281 || (ownType != HOLE && neiType == HOLE)
1295 label faceI = mesh_.nInternalFaces();
1296 faceI < mesh_.nFaces();
1300 label ownType = allCellTypes[own[faceI]];
1301 label neiType = nbrCellTypes[faceI-mesh_.nInternalFaces()];
1305 (ownType == HOLE && neiType != HOLE)
1306 || (ownType != HOLE && neiType == HOLE)
1322 if (isFront.
test(faceI))
1324 fraction[faceI] = 1.0;
1332 bitSet newIsFront(mesh_.nFaces());
1336 if (isFront.
test(faceI))
1338 label own = mesh_.faceOwner()[faceI];
1339 if (allCellTypes[own] != HOLE)
1341 if (allWeight[own] < fraction[faceI])
1345 if (allStencil[own].size())
1347 allWeight[own] = fraction[faceI];
1348 allCellTypes[own] = INTERPOLATED;
1354 fraction[faceI]-layerRelax,
1361 allWeight[own] = 0.0;
1362 allCellTypes[own] = HOLE;
1374 if (mesh_.isInternalFace(faceI))
1376 label nei = mesh_.faceNeighbour()[faceI];
1377 if (allCellTypes[nei] != HOLE)
1379 if (allWeight[nei] < fraction[faceI])
1381 if (allStencil[nei].size())
1383 allWeight[nei] = fraction[faceI];
1384 allCellTypes[nei] = INTERPOLATED;
1388 fraction[faceI]-layerRelax,
1395 allWeight[nei] = 0.0;
1396 allCellTypes[nei] = HOLE;
1475 const vector greatPoint(GREAT, GREAT, GREAT);
1477 boolList isValidDonor(mesh_.nCells(),
true);
1478 forAll(cellTypes_, celli)
1480 if (cellTypes_[celli] == HOLE)
1482 isValidDonor[celli] =
false;
1488 bitSet doneAcceptor(interpolationCells_.size());
1497 forAll(interpolationCells_, i)
1499 if (!doneAcceptor[i])
1501 label cellI = interpolationCells_[i];
1502 const point& cc = mesh_.cellCentres()[cellI];
1503 const labelList& slots = cellStencil_[cellI];
1505 if (slots.
size() != 1)
1513 label elemI = slots[slotI];
1531 mapDistributeBase::distribute<point, minMagSqrEqOp<point>,
flipOp>
1536 cellInterpolationMap().constructMap(),
1538 cellInterpolationMap().subMap(),
1545 cellInterpolationMap().comm()
1554 if (
samples[cellI] != greatPoint)
1556 donorCells.append(cellI);
1578 label cellI = donorCells[i];
1579 const pointList& donorCentres = donorCellCentres[cellI];
1591 cellInterpolationMap().distribute(donorCellCells);
1592 cellInterpolationMap().distribute(donorWeights);
1593 cellInterpolationMap().distribute(
samples);
1596 forAll(interpolationCells_, i)
1598 if (!doneAcceptor[i])
1600 label cellI = interpolationCells_[i];
1601 const labelList& slots = cellStencil_[cellI];
1603 if (slots.
size() != 1)
1609 label slotI = slots[0];
1612 if (
samples[slotI] == mesh_.cellCentres()[cellI])
1614 cellStencil_[cellI].
transfer(donorCellCells[slotI]);
1615 cellInterpolationWeights_[cellI].transfer
1621 doneAcceptor.
set(i);
1629 cellInterpolationMap_.reset
1654 interpolationCells_(0),
1655 cellInterpolationMap_(),
1657 cellInterpolationWeights_(0),
1658 cellInterpolationWeight_
1662 "cellInterpolationWeight",
1663 mesh_.facesInstance(),
1671 zeroGradientFvPatchScalarField::typeName
1682 const word w(
"snGradCorr(cellDisplacement)");
1683 const word d(
"((viscosity*faceDiffusivity)*magSf)");
1708 forAll(volCellTypes, celli)
1732 scalar layerRelax(dict_.getOrDefault(
"layerRelax", 1.0));
1734 scalar tol = dict_.getOrDefault(
"tolerance", 1
e-10);
1735 smallVec_ = mesh_.bounds().span()*tol;
1747 const boundBox& allBb(mesh_.bounds());
1798 bbs[procI] = procBb[procI][zoneI];
1810 labelList allPatchTypes(mesh_.nCells(), OTHER);
1814 if (dict_.readIfPresent(
"searchBox", globalPatchBb))
1828 if (dict_.readIfPresent(
"searchBoxDivisions", globalDivs))
1830 patchDivisions = globalDivs;
1836 if (mesh_.nGeometricD() == 1)
1838 nDivs = mesh_.nCells();
1840 else if (mesh_.nGeometricD() == 2)
1842 nDivs = label(
Foam::sqrt(scalar(mesh_.nCells())));
1846 nDivs = label(
Foam::cbrt(scalar(mesh_.nCells())));
1861 forAll(patchParts, zoneI)
1868 patchDivisions[zoneI][0]
1869 *patchDivisions[zoneI][1]
1870 *patchDivisions[zoneI][2]
1879 patchDivisions[zoneI],
1891 <<
" mesh regions" <<
endl;
1897 <<
" voxels:" << patchDivisions[zoneI]
1907 labelList allCellTypes(mesh_.nCells(), CALCULATED);
1910 labelList allDonorID(mesh_.nCells(), -1);
1917 for (label srcI = 0; srcI <
meshParts.size()-1; srcI++)
1919 for (label tgtI = srcI+1; tgtI <
meshParts.size(); tgtI++)
1953 for (label srcI = 0; srcI <
meshParts.size()-1; srcI++)
1955 for (label tgtI = srcI+1; tgtI <
meshParts.size(); tgtI++)
1990 createField(mesh_,
"allCellTypes", allCellTypes)
1996 forAll(allPatchTypes, cellI)
1998 if (allCellTypes[cellI] != HOLE)
2000 switch (allPatchTypes[cellI])
2006 if (allStencil[cellI].size())
2008 allCellTypes[cellI] = INTERPOLATED;
2022 allCellTypes[cellI] = HOLE;
2033 createField(mesh_,
"allCellTypes_patch", allCellTypes)
2044 label nCalculated = 0;
2046 forAll(cellTypes_, celli)
2048 if (allCellTypes[celli] == CALCULATED && cellTypes_[celli] == HOLE)
2050 if (allStencil[celli].size() == 0)
2053 allCellTypes[celli] = HOLE;
2054 allStencil[celli].
clear();
2058 allCellTypes[celli] = INTERPOLATED;
2066 Pout<<
"Detected " << nCalculated <<
" cells changing from hole"
2067 <<
" to calculated. Changed to interpolated"
2074 findHoles(globalCells, mesh_,
zoneID, allStencil, allCellTypes);
2080 createField(mesh_,
"allCellTypes_hole", allCellTypes)
2087 forAll(allStencil, celli)
2089 stencilSize[celli] = allStencil[celli].
size();
2093 createField(mesh_,
"allStencil_hole", stencilSize)
2101 walkFront(layerRelax, allStencil, allCellTypes, allWeight);
2107 createField(mesh_,
"allCellTypes_front", allCellTypes)
2115 cellTypes_.transfer(allCellTypes);
2116 cellStencil_.setSize(mesh_.nCells());
2117 cellInterpolationWeights_.setSize(mesh_.nCells());
2119 forAll(cellTypes_, cellI)
2121 if (cellTypes_[cellI] == INTERPOLATED)
2123 cellStencil_[cellI].transfer(allStencil[cellI]);
2124 cellInterpolationWeights_[cellI].setSize(1);
2125 cellInterpolationWeights_[cellI][0] = 1.0;
2126 interpolationCells.
append(cellI);
2130 cellStencil_[cellI].clear();
2131 cellInterpolationWeights_[cellI].clear();
2134 interpolationCells_.transfer(interpolationCells);
2137 cellInterpolationMap_.reset
2141 cellInterpolationWeight_.
transfer(allWeight);
2146 >(cellInterpolationWeight_.boundaryFieldRef(),
false);
2152 mesh_.time().
write();
2155 mkDir(mesh_.time().timePath());
2156 OBJstream str(mesh_.time().timePath()/
"injectionStencil.obj");
2157 Pout<<
type() <<
" : dumping injectionStencil to "
2160 cellInterpolationMap().distribute(cc);
2162 forAll(cellStencil_, celli)
2164 const labelList& slots = cellStencil_[celli];
2167 const point& accCc = mesh_.cellCentres()[celli];
2170 const point& donorCc = cc[slots[i]];
2179 createStencil(globalCells);
2185 cellInterpolationWeight_.instance() = mesh_.time().timeName();
2186 cellInterpolationWeight_.write();
2191 forAll(cellStencil_, celli)
2193 const scalarList& wghts = cellInterpolationWeights_[celli];
2196 if (
mag(wghts[i]) >
mag(maxMagWeight[celli]))
2198 maxMagWeight[celli] = wghts[i];
2201 if (
mag(maxMagWeight[celli]) > 1)
2204 Pout<<
"cell:" << celli
2205 <<
" at:" << cc[celli]
2206 <<
" zone:" <<
zoneID[celli]
2207 <<
" donors:" << cellStencil_[celli]
2208 <<
" weights:" << wghts
2218 createField(mesh_,
"maxMagWeight", maxMagWeight)
2224 >(tfld.
ref().boundaryFieldRef(),
false);
2232 createField(mesh_,
"cellTypes", cellTypes_)
2239 >(tfld.
ref().boundaryFieldRef(),
false);
2245 mkDir(mesh_.time().timePath());
2247 cellInterpolationMap().distribute(cc);
2252 mesh_.time().timePath()
2253 +
"/stencil_" +
name(zonei) +
".obj"
2259 forAll(subMeshCellMap, subcelli)
2261 const label celli = subMeshCellMap[subcelli];
2262 const labelList& slots = cellStencil_[celli];
2263 const point& accCc = mesh_.cellCentres()[celli];
2266 const point& donorCc = cc[slots[i]];
2280 forAll(interpolationCells_, i)
2282 label celli = interpolationCells_[i];
2283 const labelList& slots = cellStencil_[celli];
2285 bool hasLocal =
false;
2286 bool hasRemote =
false;
2290 if (slots[sloti] >= mesh_.nCells())
2320 Info<<
"Overset analysis : nCells : "
2323 <<
indent <<
"calculated : " << nCells[CALCULATED] <<
nl
2324 <<
indent <<
"interpolated : " << nCells[INTERPOLATED]
2325 <<
" (interpolated from local:" << nLocal
2326 <<
" mixed local/remote:" << nMixed
2327 <<
" remote:" << nRemote <<
")" <<
nl
2328 <<
indent <<
"hole : " << nCells[HOLE] <<
nl
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
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.
Minimal example by using system/controlDict.functions:
void correctBoundaryConditions()
Correct boundary field.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (uses typeFilePath to find file) and check its info.
void transfer(List< T > &list)
void setSize(const label n)
Alias for resize()
void append(const T &val)
Append an element at the end of the list.
void clear()
Clear the list, i.e. set size to zero.
static const List< T > & null()
Return a null List.
OFstream that keeps track of vertices.
virtual Ostream & write(const char c)
Write character.
virtual const fileName & name() const
Read/write access to the name of the stream.
virtual char fill() const =0
Get padding character.
int overlaps
Flag to control which overlap calculations are performed.
A dynamic list of packed unsigned integers, with the number of bits per item specified by the <Width>...
const Field< point_type > & points() const noexcept
Return reference to global points.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
UPstream::rangeType allProcs() const noexcept
Range of ranks indices associated with PstreamBuffers.
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
void finishedSends(const bool wait=true)
Mark sends as done.
void clear()
Clear individual buffers and reset states.
static void allGatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
static void listCombineAllGather(const List< commsStruct > &comms, List< T > &values, const CombineOp &cop, const int tag, const label comm)
After completion all processors have the same data.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const T * set(const label i) const
static word timeName(const scalar t, const int precision=precision_)
A List with indirect addressing. Like IndirectList but does not store addressing.
void size(const label n)
Older name for setAddressableSize.
@ nonBlocking
"nonBlocking"
static int & msgType() noexcept
Message tag of standard messages.
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.
void transfer(bitSet &bitset)
bool test(const label pos) const
Test value at specified position, never auto-vivify entries.
bool any() const
True if any bits in this bitset are set.
A bounding box defined in terms of min/max extrema points.
bool overlaps(const boundBox &bb) const
Overlaps/touches boundingBox?
const point & min() const
Minimum describing the bounding box.
const point & max() const
Maximum 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.
const labelIOList & zoneID() const
Helper: get reference to registered zoneID. Loads volScalarField.
wordHashSet nonInterpolatedFields_
Set of fields that should not be interpolated.
Inverse-distance-weighted interpolation stencil.
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.
virtual void stencilWeights(const point &sample, const pointList &donorCcs, scalarList &weights) const
Calculate inverse distance weights for a single acceptor.
virtual void createStencil(const globalIndex &)
Create stencil starting from the donor containing the acceptor.
virtual ~inverseDistance()
Destructor.
static treeBoundBox cellBb(const primitiveMesh &mesh, const label celli)
Calculate bounding box of cell.
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 seedCell(const label cellI, const scalar wantedFraction, bitSet &isFront, scalarField &fraction) const
Seed faces of cell with wantedFraction (if higher than current)
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.
bool betterDonor(const label destMesh, const label currentDonorMesh, const label newDonorMesh) const
If multiple donors meshes: decide which is best.
virtual bool update()
Update stencils. Return false if nothing changed.
void walkFront(const scalar layerRelax, const labelListList &allStencil, labelList &allCellTypes, scalarField &allWeight) const
Surround holes with layer(s) 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.
A cell is defined as a list of faces with extra functionality.
virtual const word & constraintType() const
Return the constraint type this pointPatch implements.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A face is a list of labels corresponding to mesh vertices.
UPtrList< const labelUList > faceCells() const
Return a list of faceCells for each patch.
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.
const Time & time() const
Return the top-level database.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
const polyPatch & patch() const
Return the polyPatch.
virtual const labelUList & faceCells() const
Return faceCells.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
label toGlobal(const label i) const
From local to global index.
Class containing processor-to-processor mapping information.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
Boundary condition for use on overset patches. To be run in combination with special dynamicFvMesh ty...
virtual void write(Ostream &os) const
Write.
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.
Cell-face mesh analysis engine.
const vectorField & cellCentres() const
label nPoints() const noexcept
Number of mesh points.
label nCells() const noexcept
Number of mesh cells.
int myProcNo() const noexcept
Return processor number.
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.
Standard boundBox with extra functionality for use in octree.
bool overlaps(const boundBox &bb) const
Overlaps other bounding box?
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
labelList nCellsPerZone(nZones, Zero)
PtrList< fvMeshSubset > meshParts(nZones)
const labelIOList & zoneID
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
#define DebugInfo
Report an information message using Foam::Info.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
line< point, const point & > linePointRef
A line using referred points.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Vector< label > labelVector
Vector of labels.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
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.
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)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
List< treeBoundBox > treeBoundBoxList
List of bounding boxes.
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
dimensionedScalar cbrt(const dimensionedScalar &ds)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
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)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
Type gMax(const FieldField< Field, Type > &f)
UIndirectList< label > labelUIndList
UIndirectList of labels.
constexpr char nl
The newline '\n' character (0x0a)
wordList patchTypes(nPatches)
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(rndGen, 1e-3))
const labelList & cellTypes
#define forAll(list, i)
Loop across all elements in list.
Functor to negate primitives. Dummy for most other types.
A non-counting (dummy) refCount.
const label nSamples(pdfDictionary.get< label >("nSamples"))
scalarField samples(nIntervals, Zero)