56 distributedTriSurfaceMesh,
198 if (
y.first().hit() &&
y.second() <
x.second())
203 else if (
y.first().hit())
218 { distributionType::FOLLOW,
"follow" },
219 { distributionType::INDEPENDENT,
"independent" },
220 { distributionType::DISTRIBUTED,
"distributed" },
221 { distributionType::FROZEN,
"frozen" }
227 Foam::word Foam::distributedTriSurfaceMesh::findLocalInstance
235 io.time().findInstance
253 io.rootPath()/
io.time().globalCaseName()
254 /
io.instance()/
io.db().dbDir()/
io.local()/
io.name();
258 return io.instance();
264 const scalar startValue =
io.time().timeOutputValue();
266 for (instanceI = ts.size()-1; instanceI >= 0; --instanceI)
268 if (ts[instanceI].value() <= startValue)
275 for (; instanceI >= 0; --instanceI)
278 if (ts[instanceI].
name() ==
io.instance())
284 io.rootPath()/
io.time().globalCaseName()
285 /ts[instanceI].name()/
io.db().dbDir()/
io.local()/
io.name();
289 return ts[instanceI].name();
298 if (!ts.size() || ts[0].name() !=
io.time().constant())
305 io.rootPath()/
io.time().globalCaseName()
306 /
io.time().constant()/
io.db().dbDir()/
io.local()/
io.name();
310 return io.time().constant();
315 <<
"Cannot find directory " <<
io.local() <<
" in times " << ts
323 bool Foam::distributedTriSurfaceMesh::read()
341 distType_ = DISTRIBUTED;
342 dict_.add(
"distributionType", distributionTypeNames_[distType_]);
346 dict_.add(
"mergeDistance", mergeDist_);
352 dict_.add(
"closed", surfaceClosed_);
375 distType_ = distributionTypeNames_.get(
"distributionType", dict_);
378 dict_.readEntry(
"mergeDistance", mergeDist_);
381 surfaceClosed_ = dict_.getOrDefault<
bool>(
"closed",
false);
398 bool Foam::distributedTriSurfaceMesh::isLocal
400 const List<treeBoundBox>& myBbs,
407 if (myBbs[bbi].contains(start) && myBbs[bbi].contains(
end))
478 void Foam::distributedTriSurfaceMesh::distributeSegment
480 const label segmenti,
484 DynamicList<segment>& allSegments,
485 DynamicList<label>& allSegmentMap,
486 List<DynamicList<label>>& sendMap
503 const List<treeBoundBox>& bbs = procBb_[proci];
505 if (isLocal(bbs, start,
end))
507 sendMap[proci].
append(allSegments.size());
508 allSegmentMap.append(segmenti);
520 const List<treeBoundBox>& bbs = procBb_[proci];
524 const treeBoundBox& bb = bbs[bbi];
532 if (bb.intersects(start,
end, clipPt))
534 sendMap[proci].append(allSegments.size());
535 allSegmentMap.append(segmenti);
559 Foam::distributedTriSurfaceMesh::distributeSegments
564 List<segment>& allSegments,
579 DynamicList<segment> dynAllSegments(start.size());
581 DynamicList<label> dynAllSegmentMap(start.size());
588 dynSendMap[proci].reserve
614 dynSendMap[proci].shrink();
615 sendMap[proci].transfer(dynSendMap[proci]);
618 allSegments.transfer(dynAllSegments);
619 allSegmentMap.transfer(dynAllSegmentMap);
626 void Foam::distributedTriSurfaceMesh::findLine
628 const bool nearestIntersection,
631 List<pointIndexHit>& info
636 Pout<<
"distributedTriSurfaceMesh::findLine :" 639 << start.size() <<
" rays" <<
endl;
641 addProfiling(findLine,
"distributedTriSurfaceMesh::findLine");
643 const indexedOctree<treeDataTriSurface>& octree =
tree();
646 info.setSize(start.size());
653 const globalIndex& triIndexer = globalTris();
665 if (nearestIntersection)
667 info[i] = octree.findLine(start[i],
end[i]);
671 info[i] = octree.findLineAny(start[i],
end[i]);
676 info[i].setIndex(triIndexer.toGlobal(info[i].index()));
697 List<segment> allSegments(start.size());
701 const autoPtr<mapDistribute> mapPtr
711 const mapDistribute& map = mapPtr();
713 label nOldAllSegments = allSegments.size();
719 map.distribute(allSegments);
726 List<pointIndexHit> intersections(allSegments.size());
730 if (nearestIntersection)
732 intersections[i] = octree.findLine
734 allSegments[i].first(),
735 allSegments[i].second()
740 intersections[i] = octree.findLineAny
742 allSegments[i].first(),
743 allSegments[i].second()
748 if (intersections[i].hit())
750 intersections[i].setIndex
752 triIndexer.toGlobal(intersections[i].index())
761 map.reverseDistribute(nOldAllSegments, intersections);
770 label segmenti = allSegmentMap[i];
780 else if (nearestIntersection)
785 start[segmenti].distSqr(allInfo.point())
786 < start[segmenti].distSqr(hitInfo.point())
798 void Foam::distributedTriSurfaceMesh::convertTriIndices
800 List<pointIndexHit>& info
804 const globalIndex& triIndexer = globalTris();
810 pi.setIndex(triIndexer.toGlobal(
pi.index()));
820 Foam::distributedTriSurfaceMesh::calcLocalQueries
822 const List<pointIndexHit>& info,
830 triangleIndex.setSize(info.size());
832 const globalIndex& triIndexer = globalTris();
848 label proci = triIndexer.whichProcID(info[i].index());
857 sendMap[proci].setSize(nSend[proci]);
866 label proci = triIndexer.whichProcID(info[i].index());
867 triangleIndex[i] = triIndexer.toLocal(proci, info[i].index());
868 sendMap[proci][nSend[proci]++] = i;
872 triangleIndex[i] = -1;
880 autoPtr<mapDistribute> mapPtr(
new mapDistribute(std::move(sendMap)));
886 mapPtr().distribute(triangleIndex);
892 bool Foam::distributedTriSurfaceMesh::contains
894 const List<treeBoundBox>& bbs,
900 if (bbs[bbi].contains(sample))
910 Foam::distributedTriSurfaceMesh::findBestProcs
913 const scalar radiusSqr,
924 procContains =
false;
927 procOverlaps =
false;
931 scalar minDistSqr = radiusSqr;
936 const List<treeBoundBox>& bbs = procBb_[proci];
940 if (bbs[bbi].contains(centre))
945 if (!procContains[proci])
947 procContains[proci] =
true;
952 bbs[bbi].calcExtremities(centre, near, far);
953 minDistSqr =
min(minDistSqr, centre.distSqr(far));
960 return Tuple2<label, scalar>(nContain, minDistSqr);
964 scalar maxDistSqr = radiusSqr;
971 const List<treeBoundBox>& bbs = procBb_[proci];
975 if (bbs[bbi].overlaps(centre, radiusSqr))
978 bbs[bbi].calcExtremities(centre, near, far);
980 scalar d2 = centre.distSqr(near);
984 maxDistSqr =
min(radiusSqr, centre.distSqr(far));
996 procOverlaps[minProci] =
true;
1001 if (proci != minProci)
1003 const List<treeBoundBox>& bbs = procBb_[proci];
1006 if (bbs[bbi].overlaps(centre, maxDistSqr))
1008 procOverlaps[proci] =
true;
1016 return Tuple2<label, scalar>(nOverlap, maxDistSqr);
1021 Foam::label Foam::distributedTriSurfaceMesh::calcOverlappingProcs
1023 const point& centre,
1024 const scalar radiusSqr,
1029 label nOverlaps = 0;
1033 const List<treeBoundBox>& bbs = procBb_[proci];
1037 if (bbs[bbi].overlaps(centre, radiusSqr))
1039 overlaps[proci] =
true;
1053 Foam::distributedTriSurfaceMesh::calcLocalQueries
1055 const bool includeLocalProcessor,
1071 DynamicList<point> dynAllCentres(centres.size());
1072 DynamicList<scalar> dynAllRadiusSqr(centres.size());
1074 DynamicList<label> dynAllSegmentMap(centres.size());
1079 forAll(dynSendMap, proci)
1081 dynSendMap[proci].reserve
1095 calcOverlappingProcs
1102 forAll(procBbOverlaps, proci)
1106 procBbOverlaps[proci]
1108 includeLocalProcessor
1113 dynSendMap[proci].append(dynAllCentres.size());
1114 dynAllSegmentMap.append(centrei);
1115 dynAllCentres.append(centres[centrei]);
1116 dynAllRadiusSqr.append(radiusSqr[centrei]);
1125 dynSendMap[proci].shrink();
1126 sendMap[proci].transfer(dynSendMap[proci]);
1129 allCentres.transfer(dynAllCentres);
1130 allRadiusSqr.transfer(dynAllRadiusSqr);
1131 allSegmentMap.transfer(dynAllSegmentMap);
1140 const point& sample,
1141 const point& nearestPoint,
1146 const triSurface& surf =
static_cast<const triSurface&
>(*this);
1156 if (((sample - nearestPoint) &
n) > 0)
1167 Foam::label Foam::distributedTriSurfaceMesh::findOtherFace
1170 const label nearFacei,
1171 const label nearLabel
1174 const triSurface& surf =
static_cast<const triSurface&
>(*this);
1177 const edge
e(nearF[nearLabel], nearF[nearF.fcIndex(nearLabel)]);
1180 for (
const label facei :
pFaces)
1182 if (facei != nearFacei)
1184 int dir = surf[facei].edgeDirection(
e);
1195 void Foam::distributedTriSurfaceMesh::calcFaceFaces
1197 const triSurface&
s,
1202 faceFaces.setSize(
s.size());
1204 DynamicList<label> nbrs;
1208 const labelledTri&
f =
s[facei];
1210 nbrs.reserve(
f.
size());
1217 for (
const label otherFacei :
pFaces)
1219 if (otherFacei != facei)
1221 if (
s[otherFacei].edgeDirection(
e) != 0)
1223 if (!nbrs.find(otherFacei))
1225 nbrs.append(otherFacei);
1231 faceFaces[facei] = std::move(nbrs);
1236 void Foam::distributedTriSurfaceMesh::surfaceSide
1239 const List<pointIndexHit>& nearestInfo,
1240 List<volumeType>& volType
1245 Pout<<
"distributedTriSurfaceMesh::surfaceSide :" 1247 <<
" finding surface side given points on surface for " 1254 labelList triangleIndex(nearestInfo.size());
1255 autoPtr<mapDistribute> mapPtr
1263 const mapDistribute& map = mapPtr();
1267 map.distribute(localSamples);
1273 volType.setSize(triangleIndex.size());
1276 const triSurface& surf =
static_cast<const triSurface&
>(*this);
1285 EdgeMap<labelPair> edgeToFaces;
1289 const label facei = triangleIndex[i];
1291 const point& sample = localSamples[i];
1294 label nearType, nearLabel;
1296 f.nearestPointClassify(sample,
points, nearType, nearLabel);
1298 const point& nearestPoint(pHit.point());
1302 const vector sampleNearestVec = (sample - nearestPoint);
1306 scalar
c = sampleNearestVec & surf[facei].areaNormal(
points);
1324 label otherFacei = findOtherFace(pointFaces, facei, nearLabel);
1325 if (otherFacei != -1)
1328 edgeSide(sample, nearestPoint, facei, otherFacei);
1342 const label pointi =
f[nearLabel];
1344 const vector sampleNearestVec = (sample - nearestPoint);
1348 edgeToFaces.clear();
1350 scalar maxCosAngle = -GREAT;
1353 for (
const label facei :
pFaces)
1357 label fp =
f.
find(pointi);
1369 for (
const edge&
e : edges)
1371 auto iter = edgeToFaces.find(
e);
1374 if (iter().second() == -1)
1377 iter().second() = facei;
1380 scalar magEVec =
mag(eVec);
1382 if (magEVec > VSMALL)
1388 scalar cosAngle(sampleNearestVec&eVec);
1389 if (cosAngle > maxCosAngle)
1391 maxCosAngle = cosAngle;
1392 maxEdgeFaces = iter();
1412 for (
auto iter : edgeToFaces)
1414 if (iter[0] == -1 || iter[1] == -1)
1422 volType[i] = edgeSide
1458 map.constructHasFlip(),
1505 Pout<<
"distributedTriSurfaceMesh::surfaceSide :" 1507 <<
" given points on surface " 1514 void Foam::distributedTriSurfaceMesh::collectLeafMids
1517 DynamicField<point>& midPoints
1520 const auto& nod =
tree().nodes()[nodeI];
1522 for (
direction octant = 0; octant < nod.subNodes_.size(); octant++)
1524 const labelBits index = nod.subNodes_[octant];
1541 const treeBoundBox subBb = nod.bb_.subBbox(octant);
1542 midPoints.append(subBb.centre());
1550 const List<volumeType>& midPointTypes,
1552 PackedList<2>& nodeTypes,
1560 const auto& nod =
tree().nodes()[nodeI];
1564 for (
direction octant = 0; octant < nod.subNodes_.size(); octant++)
1568 const labelBits index = nod.subNodes_[octant];
1573 subType = calcVolumeType
1595 subType = midPointTypes[midPointi++];
1607 else if (subType != myType)
1622 const auto& nod =
tree().nodes()[nodeI];
1624 direction octant = nod.bb_.subOctant(sample);
1646 labelBits index = nod.subNodes_[octant];
1651 volumeType subType = cachedVolumeType
1669 <<
"Sample:" << sample <<
" node:" << nodeI
1670 <<
" with bb:" << nod.bb_ <<
nl 1671 <<
"Empty subnode has invalid volume type MIXED." 1680 <<
"Sample:" << sample <<
" at node:" << nodeI
1681 <<
" octant:" << octant
1682 <<
" with bb:" << nod.bb_.subBbox(octant) <<
nl 1683 <<
"Node has invalid volume type " << octantType
1698 Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
1706 "distributedTriSurfaceMesh::independentlyDistributedBbs" 1714 const auto* dictPtr =
1727 if (!decomposeParDict_)
1729 decomposeParDict_.reset
1751 List<List<treeBoundBox>> bbs
1757 const globalIndex& triIndexer = globalTris();
1764 if (triIndexer.localSize(proci) != 0)
1776 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1777 <<
" determining master-only decomposition for " <<
s.size()
1785 triCentres[trii] =
s[trii].centre(
s.points());
1789 if (!isA<geomDecomp>(decomposer_()))
1795 calcFaceFaces(
s, pointFaces, faceFaces);
1799 distribution = decomposer_().decompose(faceFaces, triCentres);
1805 distribution = decomposer_().decompose(triCentres);
1810 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1811 <<
" determining processor bounding boxes for surface" 1818 treeBoundBox& bb = bbs[distribution[trii]][0];
1819 bb.add(
s.points(),
s[trii]);
1829 else if (distType_ == DISTRIBUTED)
1833 if (!decomposer_().parallelAware())
1836 <<
"The decomposition method " << decomposer_().typeName
1837 <<
" does not decompose in parallel." 1843 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1844 <<
" determining decomposition for " <<
s.size()
1853 triCentres[trii] =
s[trii].centre(
s.points());
1856 labelList distribution = decomposer_().decompose(triCentres);
1860 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1861 <<
" determining processor bounding boxes for " 1868 treeBoundBox& bb = bbs[distribution[trii]][0];
1869 bb.add(
s.points(),
s[trii]);
2082 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 2083 <<
" collecting all centroids for surface " 2092 allCentres[trii] =
s[trii].centre(
s.points());
2119 Pout<<
"distributedTriSurfaceMesh::" 2120 <<
"independentlyDistributedBbs :" 2122 <<
" merged " << allCentres.size()
2123 <<
" centroids down to " << nMerged <<
endl;
2128 UIndirectList<point>(mergedPoints, allToMerged) = allCentres;
2132 labelList mergedDist(decomposer_().decompose(mergedPoints));
2136 allDistribution = UIndirectList<label>
2144 globalTris().scatter
2153 Pout<<
"distributedTriSurfaceMesh::" 2154 <<
"independentlyDistributedBbs :" 2155 <<
" determined decomposition" <<
endl;
2162 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 2163 <<
" determining processor bounding boxes for " 2169 treeBoundBox& bb = bbs[distribution[trii]][0];
2170 bb.add(
s.points(),
s[trii]);
2185 bool Foam::distributedTriSurfaceMesh::overlaps
2187 const List<treeBoundBox>& bbs,
2191 treeBoundBox triBb(tri.a());
2195 for (
const treeBoundBox& bb : bbs)
2202 if (bb.overlaps(triBb) && bb.intersects(tri))
2211 void Foam::distributedTriSurfaceMesh::subsetMeshMap
2213 const triSurface&
s,
2215 const label nIncluded,
2221 newToOldFaces.setSize(nIncluded);
2222 newToOldPoints.setSize(
s.points().size());
2223 oldToNewPoints.setSize(
s.points().size());
2224 oldToNewPoints = -1;
2229 forAll(include, oldFacei)
2231 if (include[oldFacei])
2234 newToOldFaces[facei++] = oldFacei;
2237 for (
const label oldPointi :
s[oldFacei])
2239 if (oldToNewPoints[oldPointi] == -1)
2241 oldToNewPoints[oldPointi] = pointi;
2242 newToOldPoints[pointi++] = oldPointi;
2247 newToOldPoints.setSize(pointi);
2254 const triSurface&
s,
2262 forAll(newToOldPoints, i)
2264 newPoints[i] =
s.points()[newToOldPoints[i]];
2267 List<labelledTri> newTriangles(newToOldFaces.size());
2272 const labelledTri& tri =
s[newToOldFaces[i]];
2274 newTriangles[i][0] = oldToNewPoints[tri[0]];
2275 newTriangles[i][1] = oldToNewPoints[tri[1]];
2276 newTriangles[i][2] = oldToNewPoints[tri[2]];
2277 newTriangles[i].region() = tri.region();
2281 return triSurface(newTriangles,
s.patches(), newPoints,
true);
2287 const triSurface&
s,
2326 const triSurface&
s,
2333 ListOps::createWithValue<bool>(
s.size(), newToOldFaces,
true,
false)
2336 newToOldPoints.setSize(
s.points().size());
2337 labelList oldToNewPoints(
s.points().size(), -1);
2341 forAll(include, oldFacei)
2343 if (include[oldFacei])
2346 for (
const label oldPointi :
s[oldFacei])
2348 if (oldToNewPoints[oldPointi] == -1)
2350 oldToNewPoints[oldPointi] = pointi;
2351 newToOldPoints[pointi++] = oldPointi;
2356 newToOldPoints.setSize(pointi);
2369 Foam::label Foam::distributedTriSurfaceMesh::findTriangle
2371 const List<labelledTri>& allFaces,
2373 const labelledTri& otherF
2381 const labelledTri&
f = allFaces[
pFaces[i]];
2383 if (
f.region() == otherF.region())
2386 label fp0 =
f.
find(otherF[0]);
2391 if (
f[fp1] == otherF[1] &&
f[fp2] == otherF[2])
2402 void Foam::distributedTriSurfaceMesh::merge
2404 const scalar mergeDist,
2405 const List<labelledTri>& subTris,
2408 List<labelledTri>& allTris,
2431 label allPointi = nOldAllPoints;
2432 forAll(pointConstructMap, pointi)
2434 if (pointConstructMap[pointi] == -1)
2436 pointConstructMap[pointi] = allPointi++;
2440 if (allPointi > nOldAllPoints)
2444 forAll(pointConstructMap, pointi)
2446 if (pointConstructMap[pointi] >= nOldAllPoints)
2448 allPoints[pointConstructMap[pointi]] = subPoints[pointi];
2462 label allTrii = allTris.size();
2463 allTris.setSize(allTrii + subTris.size());
2465 faceConstructMap.setSize(subTris.size());
2469 const labelledTri& subTri = subTris[trii];
2472 labelledTri mappedTri
2474 pointConstructMap[subTri[0]],
2475 pointConstructMap[subTri[1]],
2476 pointConstructMap[subTri[2]],
2482 bool fullMatch =
true;
2486 if (mappedTri[fp] >= nOldAllPoints)
2497 label i = findTriangle
2507 faceConstructMap[trii] = allTrii;
2508 allTris[allTrii] = mappedTri;
2513 faceConstructMap[trii] = i;
2519 faceConstructMap[trii] = allTrii;
2520 allTris[allTrii] = mappedTri;
2524 allTris.setSize(allTrii);
2530 Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
2552 currentDistType_(FROZEN)
2576 Info<<
'\t' << proci <<
'\t' << nTris[proci]
2577 <<
'\t' << procBb_[proci] <<
endl;
2585 Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh(
const IOobject&
io)
2592 findLocalInstance(
io),
2619 currentDistType_(FROZEN)
2634 || actualFile !=
io.localFilePath(triSurfaceMesh::typeName)
2640 <<
"Read distributedTriSurface " <<
io.name()
2641 <<
" from parent path " << actualFile <<
endl;
2664 <<
"Read distributedTriSurface " <<
io.name()
2665 <<
" from actual path " << actualFile <<
':' <<
endl;
2677 Info<<
'\t' << proci <<
'\t' << nTris[proci]
2678 <<
'\t' << procBb_[proci] <<
endl;
2687 <<
"Read distributedTriSurface " <<
io.name() <<
':' <<
endl;
2693 Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
2704 findLocalInstance(
io),
2732 currentDistType_(FROZEN)
2759 "outsideVolumeType",
2776 || actualFile !=
io.localFilePath(triSurfaceMesh::typeName)
2782 <<
"Read distributedTriSurface " <<
io.name()
2783 <<
" from parent path " << actualFile
2784 <<
" and dictionary" <<
endl;
2807 <<
"Read distributedTriSurface " <<
io.name()
2808 <<
" from actual path " << actualFile
2809 <<
" and dictionary:" <<
endl;
2821 Info<<
'\t' << proci <<
'\t' << nTris[proci]
2822 <<
'\t' << procBb_[proci] <<
endl;
2831 <<
"Read distributedTriSurface " <<
io.name() <<
':' <<
endl;
2847 globalTris_.clear();
2860 return *globalTris_;
3104 "distributedTriSurfaceMesh::findNearest" 3109 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3111 <<
" trying to find nearest for " <<
samples.
size()
3112 <<
" samples with max sphere " 3142 forAll(dynSendMap, proci)
3149 label minProci = -1;
3159 label nContains = 0;
3162 if (procContains[proci])
3165 dynSendMap[proci].
append(samplei);
3166 distSqr[samplei] = best.
second();
3186 dynSendMap[minProci].
append(samplei);
3187 distSqr[samplei] = best.
second();
3195 sendMap[proci].
transfer(dynSendMap[proci]);
3214 <<
" outside\t" << nOutside <<
endl;
3227 convertTriIndices(localInfo);
3235 label nIgnoredHit = 0;
3261 ni.
second() = info.
point().distSqr(localPoints[i]);
3268 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3270 <<
" searched locally for " << localPoints.
size()
3271 <<
" samples with max sphere " 3273 <<
" found hits:" << nHit
3274 <<
" of which outside local bb:" << nIgnoredHit
3317 forAll(nearestInfo, samplei)
3343 calcOverlappingProcs(sample, d2, procBbOverlaps);
3345 forAll(procBbOverlaps, proci)
3347 if (procBbOverlaps[proci])
3353 if (proci != hitProci)
3355 dynSendMap[proci].
append(samplei);
3364 sendMap[proci].
transfer(dynSendMap[proci]);
3389 forAll(nearestInfo, samplei)
3392 if (ni.
first().hit())
3394 localDistSqr[samplei] = ni.
second();
3402 convertTriIndices(localInfo);
3407 label nIgnoredHit = 0;
3427 ni.
second() = info.
point().distSqr(localSamples[i]);
3434 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3436 <<
" searched locally for " << localSamples.
size()
3437 <<
" samples with max sphere " 3439 <<
" found hits:" << nHit
3440 <<
" of which outside local bb:" << nIgnoredHit
3468 info[samplei] = ni.
first();
3496 "distributedTriSurfaceMesh::findNearestRegion" 3501 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3503 <<
" trying to find nearest and region for " <<
samples.
size()
3504 <<
" samples with max sphere " 3509 if (regionIndices.
empty())
3511 findNearest(
samples, nearestDistSqr, info);
3555 convertTriIndices(allInfo);
3559 if (allInfo[i].hit())
3572 allInfo[i].setMiss();
3573 allInfo[i].setIndex(-1);
3590 if (allInfo[i].hit())
3592 label pointi = allSegmentMap[i];
3594 if (!info[pointi].hit())
3597 info[pointi] = allInfo[i];
3608 info[pointi] = allInfo[i];
3617 void Foam::distributedTriSurfaceMesh::findLine
3680 Pout<<
"distributedTriSurfaceMesh::findLineAll :" 3682 <<
" intersecting with " 3683 << start.
size() <<
" rays" <<
endl;
3689 "distributedTriSurfaceMesh::findLineAll" 3719 + vector::uniform(ROOTVSMALL)
3731 if (hitInfo[pointi].hit())
3733 info[pointi].setSize(1);
3734 info[pointi][0] = hitInfo[pointi];
3736 point pt = hitInfo[pointi].point() + smallVec[pointi];
3738 if (((pt-start[pointi])&dirVec[pointi]) <= magSqrDirVec[pointi])
3741 e1[compacti] =
end[pointi];
3742 pointMap[compacti] = pointi;
3748 info[pointi].
clear();
3752 e0.setSize(compacti);
3753 e1.setSize(compacti);
3754 pointMap.setSize(compacti);
3773 if (hitInfo[i].hit())
3775 label pointi = pointMap[i];
3777 label sz = info[pointi].size();
3778 info[pointi].setSize(sz+1);
3779 info[pointi][sz] = hitInfo[i];
3781 point pt = hitInfo[i].point() + smallVec[pointi];
3784 scalar d = ((pt-start[pointi])&dirVec[pointi]);
3788 if (d > 0 && d <= magSqrDirVec[pointi])
3791 e1[compacti] =
end[pointi];
3792 pointMap[compacti] = pointi;
3799 e0.setSize(compacti);
3800 e1.setSize(compacti);
3801 pointMap.setSize(compacti);
3807 Pout<<
"distributedTriSurfaceMesh::findLineAll :" 3808 <<
" Exiting loop due to excessive number of" 3809 <<
" intersections along ray" 3820 Pout<<
"distributedTriSurfaceMesh::findLineAll :" 3822 <<
" finished intersecting with " 3823 << start.
size() <<
" rays" <<
endl;
3836 Pout<<
"distributedTriSurfaceMesh::getRegion :" 3838 <<
" getting region for " 3839 << info.
size() <<
" triangles" <<
endl;
3842 addProfiling(getRegion,
"distributedTriSurfaceMesh::getRegion");
3861 Pout<<
"distributedTriSurfaceMesh::getRegion :" 3863 <<
" finished getting region for " 3864 << info.
size() <<
" triangles" <<
endl;
3890 region.
setSize(triangleIndex.size());
3894 label trii = triangleIndex[i];
3895 region[i] =
s[trii].region();
3906 Pout<<
"distributedTriSurfaceMesh::getRegion :" 3908 <<
" finished getting region for " 3909 << info.
size() <<
" triangles" <<
endl;
3928 Pout<<
"distributedTriSurfaceMesh::getNormal :" 3930 <<
" getting normal for " 3931 << info.
size() <<
" triangles" <<
endl;
3934 addProfiling(getNormal,
"distributedTriSurfaceMesh::getNormal");
3957 normal.
setSize(triangleIndex.size());
3961 label trii = triangleIndex[i];
3962 normal[i] =
s[trii].unitNormal(
s.points());
3973 Pout<<
"distributedTriSurfaceMesh::getNormal :" 3975 <<
" finished getting normal for " 3976 << info.
size() <<
" triangles" <<
endl;
4063 if (!hasVolumeType())
4066 <<
"Volume type only supported for closed distributed surfaces." 4078 "distributedTriSurfaceMesh::getCachedVolumeType" 4082 const point outsidePt(bounds().
max() + 0.5*bounds().span());
4085 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4087 <<
" triggering outsidePoint" << outsidePt
4088 <<
" orientation" <<
endl;
4101 surfaceSide(outsidePts, nearestInfo, outsideVolTypes);
4112 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4114 <<
" determined outsidePoint" << outsidePt
4126 const auto& nodes = t.
nodes();
4135 collectLeafMids(0, midPoints);
4140 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4142 <<
" triggering orientation caching for " 4143 << midPoints.
size() <<
" leaf mids" <<
endl;
4160 surfaceSide(midPoints, nearestInfo, midVolTypes);
4177 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4179 <<
" done orientation caching for " 4180 << midPoints.
size() <<
" leaf mids" <<
endl;
4188 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4191 <<
" samples" <<
endl;
4197 "distributedTriSurfaceMesh::getVolumeType" 4216 if (contains(procBb_[proci],
samples[samplei]))
4229 outsideSamples.
append(samplei);
4235 sendMap[proci].
setSize(nSend[proci]);
4245 if (contains(procBb_[proci],
samples[samplei]))
4248 procSend[nSend[proci]++] = samplei;
4271 if (
tree().nodes().size())
4273 volType[i] = cachedVolumeType(0, localPoints[i]);
4277 fullSearchMap.append(i);
4278 fullSearchPoints.append(localPoints[i]);
4284 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4287 <<
" resulting in local queries:" 4288 << localPoints.
size()
4289 <<
" of which cached:" << localPoints.
size()-fullSearchPoints.size()
4304 surfaceSide(fullSearchPoints, nearestInfo, fullSearchType);
4309 volType[fullSearchMap[i]] = fullSearchType[i];
4374 for (label samplei : outsideSamples)
4376 volType[samplei] = outsideVolType_;
4381 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4383 <<
" finished finding orientation for " <<
samples.
size()
4384 <<
" samples" <<
endl;
4403 Pout<<
"distributedTriSurfaceMesh::getField :" 4405 <<
" retrieving field for " 4406 << info.
size() <<
" triangles" <<
endl;
4411 const auto* fldPtr = findObject<triSurfaceLabelField>(
"values");
4435 values.setSize(triangleIndex.size());
4439 label trii = triangleIndex[i];
4452 Pout<<
"distributedTriSurfaceMesh::getField :" 4454 <<
" finished retrieving field for " 4455 << info.
size() <<
" triangles" <<
endl;
4469 includedFace =
false;
4473 const scalar eps = 1.0e-4;
4476 const point mid = bbs[i].centre();
4477 const vector halfSpan = (1.0+eps)*(bbs[i].
max() - mid);
4479 bbsX[i].min() = mid - halfSpan;
4480 bbsX[i].max() = mid + halfSpan;
4489 if (overlaps(bbsX, tri))
4491 includedFace[trii] =
true;
4509 overlappingSurface(
s, bbs, includedFace);
4510 return subsetMesh(
s, includedFace, subPointMap, subFaceMap);
4542 label proci = triIndexer.
whichProcID(info[i].index());
4551 sendMap[proci].
setSize(nSend[proci]);
4560 label proci = triIndexer.
whichProcID(info[i].index());
4561 triangleIndex[i] = triIndexer.
toLocal(proci, info[i].index());
4562 sendMap[proci][nSend[proci]++] = i;
4566 triangleIndex[i] = -1;
4595 forAll(constructMap, proci)
4601 constructMap[proci].
setSize(nRecv);
4603 for (label i = 0; i < nRecv; i++)
4605 constructMap[proci][i] = segmenti++;
4620 std::move(constructMap)
4638 const bool keepNonLocal,
4650 Pout<<
"distributedTriSurfaceMesh::distribute :" 4652 <<
" distributing surface according to method:" 4653 << distributionTypeNames_[distType_]
4657 addProfiling(distribute,
"distributedTriSurfaceMesh::distribute");
4675 if (currentDistType_ == distType_)
4679 newProcBb = independentlyDistributedBbs(*
this);
4692 if (newProcBb == procBb_)
4698 procBb_.transfer(newProcBb);
4715 <<
"before distribution:" <<
endl <<
"\tproc\ttris" <<
endl;
4719 Info<<
'\t' << proci <<
'\t' << nTris[proci] <<
endl;
4738 pointSendMap[proci],
4752 forAll(faceSendMap, proci)
4756 forAll(faceSendMap[proci], i)
4758 includedFace[faceSendMap[proci][i]] =
false;
4814 allTris = subSurface;
4834 forAll(faceSendMap, proci)
4838 if (faceSendMap[proci].size() > 0)
4863 forAll(faceRecvSizes, proci)
4867 if (faceRecvSizes[proci] > 0)
4883 faceConstructMap[proci],
4884 pointConstructMap[proci]
4896 std::move(faceSendMap),
4897 std::move(faceConstructMap)
4905 std::move(pointSendMap),
4906 std::move(pointConstructMap)
4919 currentDistType_ = distType_;
4924 distributeFields<label>(
faceMap());
4925 distributeFields<scalar>(
faceMap());
4926 distributeFields<vector>(
faceMap());
4927 distributeFields<sphericalTensor>(
faceMap());
4928 distributeFields<symmTensor>(
faceMap());
4929 distributeFields<tensor>(
faceMap());
4941 <<
"after distribution:" <<
endl <<
"\tproc\ttris" <<
endl;
4945 Info<<
'\t' << proci <<
'\t' << nTris[proci] <<
endl;
4957 Info<<
"Writing local bounding box to " << str.
name() <<
endl;
4961 str.
write(bb,
true);
4972 Info<<
"Writing all bounding boxes to " << str.
name() <<
endl;
4973 for (
const auto& myBbs : procBb_)
4977 str.
write(bb,
true);
4985 Pout<<
"distributedTriSurfaceMesh::distribute :" 4987 <<
" done distributing surface according to method:" 4988 << distributionTypeNames_[distType_]
5002 Pout<<
"distributedTriSurfaceMesh::writeObject :" 5004 <<
" writing surface valid:" << valid <<
endl;
5032 bool ok = dict_.writeObject(streamOpt,
true);
5036 Pout<<
"distributedTriSurfaceMesh::writeObject :" 5038 <<
" done writing surface" <<
endl;
5055 <<
"Bounding Box : " << bb <<
endl 5056 <<
"Closed : " << surfaceClosed_ <<
endl 5058 <<
"Distribution : " << distributionTypeNames_[distType_] <<
endl;
virtual void getField(const List< pointIndexHit > &, labelList &) const
WIP. From a set of hits (points and.
static const Enum< distributionType > distributionTypeNames_
static label getNode(const labelBits i)
Return real (dereferenced) index for a parent node.
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Find first intersection on segment from start to end.
List< instant > instantList
List of instants.
List< labelList > labelListList
A List of labelList.
void reset(const label localSize, const label comm=UPstream::worldComm, const bool parallel=UPstream::parRun())
Reset from local size, using gather/broadcast with default/specified communicator if parallel...
virtual Ostream & write(const char c)
Write character.
void size(const label n)
Older name for setAddressableSize.
#define addProfiling(name, descr)
Define profiling trigger with specified name and description string.
A triangle primitive used to calculate face normals and swept volumes. Uses referred points...
static const treeBoundBox & null() noexcept
The null treeBoundBox is the same as an inverted box.
A class for handling file names.
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
static void overlappingSurface(const triSurface &, const List< treeBoundBox > &, boolList &includedFace)
Calculate the triangles that are overlapping bounds.
type
Volume classification types.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void clearOut()
Clear storage.
const List< node > & nodes() const noexcept
List of all nodes.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
void append(const T &val)
Append an element at the end of the list.
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
const word & name() const noexcept
Return the object name.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const globalIndex & globalTris() const
Triangle indexing (demand driven)
constexpr char nl
The newline '\n' character (0x0a)
static constexpr label pack(const label val, const direction bits) noexcept
Pack integer value and bits (octant) into a label.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
virtual void distribute(const List< treeBoundBox > &, const bool keepNonLocal, autoPtr< mapDistribute > &faceMap, autoPtr< mapDistribute > &pointMap)
Set bounds of surface. Bounds currently set as list of.
virtual void findNearest(const pointField &sample, const scalarField &nearestDistSqr, List< pointIndexHit > &) const
scalarField samples(nIntervals, Zero)
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
static bool & parRun() noexcept
Test if this a parallel run.
void clear() noexcept
Same as reset(nullptr)
label comm() const noexcept
The communicator used.
autoPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler.
A bounding box defined in terms of min/max extrema points.
static int & msgType() noexcept
Message tag of standard messages.
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
This class describes the interaction of an object (often a face) and a point. It carries the info of ...
List< treeBoundBox > treeBoundBoxList
A List of treeBoundBox.
A simple container for options an IOstream can normally have.
static std::string path(const std::string &str)
Return directory path name (part before last /)
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
Ignore writing from objectRegistry::writeObject()
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
An enumeration wrapper for classification of a location as being inside/outside of a volume...
static const List< T > & null()
Return a null List.
static label worldComm
Default world communicator (all processors). May differ from globalComm if local worlds are in use...
virtual const boundBox & bounds() const
Return const reference to boundBox.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
void write(Ostream &os) const
Write to Ostream in simple OpenFOAM format.
Determine correspondence between points. See below.
fileName objectPath() const
The complete path + object name.
Macros for easy insertion into run-time selection tables.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
virtual void getVolumeType(const pointField &, List< volumeType > &) const
Determine type (inside/outside/mixed) for point. unknown if.
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all processes in communicator.
void resize(const label numElem, const unsigned int val=0u)
Reset addressable list size, does not shrink the allocated size.
#define forAll(list, i)
Loop across all elements in list.
IOoject and searching on triSurface.
T & operator[](const label i)
Return element of UList.
label fcIndex(const label i) const noexcept
The forward circular index. The next index in the list which returns to the first at the end of the l...
virtual bool hasVolumeType() const
Whether supports volume type (below) - i.e. whether is closed.
label mergePoints(const PointList &points, labelList &pointToUnique, labelList &uniquePoints, const scalar mergeTol=SMALL, const bool verbose=false)
Calculate merge mapping, preserving the original point order. All points closer/equal mergeTol are to...
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
bool subHasFlip() const noexcept
Does subMap include a sign.
static void allGatherList(List< T > &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, but keep individual values separate. Uses linear/tree communication. ...
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Input inter-processor communications stream using MPI send/recv etc. - operating on external buffer...
const point_type & point() const noexcept
Return point, no checks.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
bool matchPoints(const UList< point > &pts0, const UList< point > &pts1, const UList< scalar > &matchDistance, const bool verbose, labelList &from0To1, const point &origin=point::zero)
Determine correspondence between pointFields. Gets passed.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator) is 1 for serial run.
volumeType outsideVolType_
If surface is closed, what is type of outside points.
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
void setSize(const label n)
Alias for resize()
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
virtual void getVolumeType(const pointField &points, List< volumeType > &volType) const
Determine type (inside/outside/mixed) for point.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
static bool isContent(labelBits i) noexcept
Node with content (leaf)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
virtual ~distributedTriSurfaceMesh()
Destructor.
virtual void getRegion(const List< pointIndexHit > &, labelList ®ion) const
From a set of points and indices get the region.
A class for handling words, derived from Foam::string.
tmp< GeoField > getField(const IOobject *io, const typename GeoField::Mesh &mesh)
Get the field or return nullptr.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
#define DebugInFunction
Report an information message using Foam::Info.
labelledTri face_type
The face type (same as the underlying PrimitivePatch)
void finishedSends(const bool wait=true)
Mark sends as done.
void clearOut()
Clear storage.
PackedList< 2 > & nodeTypes() const noexcept
Per node, per octant whether is fully inside/outside/mixed.
Tree tree(triangles.begin(), triangles.end())
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit >> &) const
Get all intersections in order from start to end.
Tuple2< pointIndexHit, scalar > nearestAndDist
Combine operator for nearest.
static const word null
An empty word.
void operator()(volumeType &x, const volumeType &y) const
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
constexpr scalar pi(M_PI)
label toLocal(const label i) const
From global to local on current processor.
A triFace with additional (region) index.
const Field< point_type > & points() const noexcept
Return reference to global points.
A location inside the volume.
void append(const T &val)
Copy append an element to the end of this list.
label whichProcID(const label i) const
Which processor does global id come from?
A location outside the volume.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
label index() const noexcept
Return the hit index.
errorManip< error > abort(error &err)
void reverseDistribute(const label constructSize, List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Reverse distribute data using default commsType.
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit >> &) const
Get all intersections in order from start to end.
void reduce()
Inplace parallel reduction of min/max values.
A location that is partly inside and outside.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Output inter-processor communications stream using MPI send/recv etc. - operating on external buffer...
A functor that returns its argument unchanged (cf. C++20 std::identity) Should never be specialized...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
An OFstream that keeps track of vertices and provides convenience output methods for OBJ files...
bool constructHasFlip() const noexcept
Does constructMap include a sign.
int debug
Static debugging option.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
Pair< label > labelPair
A pair of labels.
virtual void findNearest(const pointField &sample, const scalarField &nearestDistSqr, List< pointIndexHit > &) const
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
OBJstream os(runTime.globalPath()/outputName)
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
defineTypeNameAndDebug(combustionModel, 0)
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Combine operator for volume types.
virtual const fileName & name() const
Read/write access to the name of the stream.
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=cellModel::ref(cellModel::HEX);labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells].reset(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< SMALL) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &oldCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]
const fileName & instance() const noexcept
Read access to instance path component.
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
const labelListList & constructMap() const noexcept
From subsetted data to new reconstructed data.
bool isFile(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
static bool isNode(labelBits i) noexcept
A parent node.
static commsTypes defaultCommsType
Default commsType.
static autoPtr< decompositionMethod > New(const dictionary &decompDict, const word ®ionName="")
Return a reference to the selected decomposition method, optionally region-specific.
void operator()(nearestAndDist &x, const nearestAndDist &y) const
bool hit() const noexcept
Is there a hit?
Class containing processor-to-processor mapping information.
vector point
Point is a vector.
static fileName findFile(const IOobject &io, const bool isGlobal=true)
Use IOobject information to resolve file to load from, or empty if the file does not exist...
Non-pointer based hierarchical recursive searching.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
static void distribute(const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &field, const NegateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Distribute data with specified negate operator (for flips).
static List< int > & procID(const label communicator)
Process IDs within a given communicator.
const Time & time() const
Return Time associated with the objectRegistry.
label surfaceClosed_
Is surface closed.
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
A List with indirect addressing. Like IndirectList but does not store addressing. ...
const T2 & second() const noexcept
Access the second element.
const dimensionedScalar c
Speed of light in a vacuum.
static bool master(const label communicator=worldComm)
Am I the master rank.
const polyBoundaryMesh & patches
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
bool readIfPresent(const word &key, const dictionary &dict, EnumType &val) const
Find an entry if present, and assign to T val.
triangle< point, const point & > triPointRef
A triangle using referred points.
Standard boundBox with extra functionality for use in octree.
"nonBlocking" : (MPI_Isend, MPI_Irecv)
messageStream Info
Information stream (stdout output on master, null elsewhere)
label size() const noexcept
The number of elements in the UList.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
static void exchangeSizes(const labelUList &sendProcs, const labelUList &recvProcs, const Container &sendData, labelList &sizes, const label tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Helper: exchange sizes of sendData for specified set of send/receive processes.
static void listCombineGather(const List< commsStruct > &comms, List< T > &values, const CombineOp &cop, const int tag, const label comm)
static rangeType subProcs(const label communicator=worldComm)
Range of process indices for sub-processes.
List< label > labelList
A List of labels.
int system(const std::string &command, const bool bg=false)
Execute the specified command via the shell.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
virtual autoPtr< mapDistribute > localQueries(const List< pointIndexHit > &, labelList &triangleIndex) const
Obtains global indices from pointIndexHit and swaps them back.
const labelListList & subMap() const noexcept
From subsetted data back to original data.
const T1 & first() const noexcept
Access the first element.
Triangulated surface description with patch information.
label rcIndex(const label i) const noexcept
The reverse circular index. The previous index in the list which returns to the last at the beginning...
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
void invertManyToMany(const label len, const UList< InputIntListType > &input, List< OutputIntListType > &output)
Invert many-to-many.
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
const nearestAndDist nearestZero(nearestAndDist(pointIndexHit(), -GREAT))
void operator=(const triSurface &surf)
Copy assignment.
EnumType getOrDefault(const word &key, const dictionary &dict, const EnumType deflt, const bool failsafe=false) const
Find the key in the dictionary and return the corresponding enumeration element based on its name...
Defines the attributes of an object for which implicit objectRegistry management is supported...
List< bool > boolList
A List of bools.
streamFormat format() const noexcept
Get the current stream format.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
PointHit< point > pointHit
A PointHit with a 3D point.
virtual void getField(const List< pointIndexHit > &, labelList &) const
WIP. From a set of hits (points and.
void writeStats(Ostream &os) const
Print some stats. Parallel aware version of.
static const Enum< volumeType::type > names
Names for the classification enumeration.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
#define InfoInFunction
Report an information message using Foam::Info.
static constexpr const zero Zero
Global zero (0)