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 sendMap[proci].transfer(dynSendMap[proci]);
617 allSegments.transfer(dynAllSegments);
618 allSegmentMap.transfer(dynAllSegmentMap);
625 void Foam::distributedTriSurfaceMesh::findLine
627 const bool nearestIntersection,
630 List<pointIndexHit>& info
635 Pout<<
"distributedTriSurfaceMesh::findLine :" 638 << start.size() <<
" rays" <<
endl;
640 addProfiling(findLine,
"distributedTriSurfaceMesh::findLine");
642 const indexedOctree<treeDataTriSurface>& octree =
tree();
645 info.setSize(start.size());
652 const globalIndex& triIndexer = globalTris();
664 if (nearestIntersection)
666 info[i] = octree.findLine(start[i],
end[i]);
670 info[i] = octree.findLineAny(start[i],
end[i]);
675 info[i].setIndex(triIndexer.toGlobal(info[i].index()));
696 List<segment> allSegments(start.size());
700 const autoPtr<mapDistribute> mapPtr
710 const mapDistribute& map = mapPtr();
712 label nOldAllSegments = allSegments.size();
718 map.distribute(allSegments);
725 List<pointIndexHit> intersections(allSegments.size());
729 if (nearestIntersection)
731 intersections[i] = octree.findLine
733 allSegments[i].first(),
734 allSegments[i].second()
739 intersections[i] = octree.findLineAny
741 allSegments[i].first(),
742 allSegments[i].second()
747 if (intersections[i].hit())
749 intersections[i].setIndex
751 triIndexer.toGlobal(intersections[i].index())
760 map.reverseDistribute(nOldAllSegments, intersections);
769 label segmenti = allSegmentMap[i];
779 else if (nearestIntersection)
784 start[segmenti].distSqr(allInfo.point())
785 < start[segmenti].distSqr(hitInfo.point())
797 void Foam::distributedTriSurfaceMesh::convertTriIndices
799 List<pointIndexHit>& info
803 const globalIndex& triIndexer = globalTris();
809 pi.setIndex(triIndexer.toGlobal(
pi.index()));
819 Foam::distributedTriSurfaceMesh::calcLocalQueries
821 const List<pointIndexHit>& info,
829 triangleIndex.setSize(info.size());
831 const globalIndex& triIndexer = globalTris();
847 label proci = triIndexer.whichProcID(info[i].index());
856 sendMap[proci].setSize(nSend[proci]);
865 label proci = triIndexer.whichProcID(info[i].index());
866 triangleIndex[i] = triIndexer.toLocal(proci, info[i].index());
867 sendMap[proci][nSend[proci]++] = i;
871 triangleIndex[i] = -1;
880 mapPtr().distribute(triangleIndex);
886 bool Foam::distributedTriSurfaceMesh::contains
888 const List<treeBoundBox>& bbs,
894 if (bbs[bbi].contains(sample))
904 Foam::distributedTriSurfaceMesh::findBestProcs
907 const scalar radiusSqr,
918 procContains =
false;
921 procOverlaps =
false;
925 scalar minDistSqr = radiusSqr;
930 const List<treeBoundBox>& bbs = procBb_[proci];
934 if (bbs[bbi].contains(centre))
939 if (!procContains[proci])
941 procContains[proci] =
true;
946 bbs[bbi].calcExtremities(centre, near, far);
947 minDistSqr =
min(minDistSqr, centre.distSqr(far));
954 return Tuple2<label, scalar>(nContain, minDistSqr);
958 scalar maxDistSqr = radiusSqr;
965 const List<treeBoundBox>& bbs = procBb_[proci];
969 if (bbs[bbi].overlaps(centre, radiusSqr))
972 bbs[bbi].calcExtremities(centre, near, far);
974 scalar d2 = centre.distSqr(near);
978 maxDistSqr =
min(radiusSqr, centre.distSqr(far));
990 procOverlaps[minProci] =
true;
995 if (proci != minProci)
997 const List<treeBoundBox>& bbs = procBb_[proci];
1000 if (bbs[bbi].overlaps(centre, maxDistSqr))
1002 procOverlaps[proci] =
true;
1010 return Tuple2<label, scalar>(nOverlap, maxDistSqr);
1015 Foam::label Foam::distributedTriSurfaceMesh::calcOverlappingProcs
1017 const point& centre,
1018 const scalar radiusSqr,
1023 label nOverlaps = 0;
1027 const List<treeBoundBox>& bbs = procBb_[proci];
1031 if (bbs[bbi].overlaps(centre, radiusSqr))
1033 overlaps[proci] =
true;
1047 Foam::distributedTriSurfaceMesh::calcLocalQueries
1049 const bool includeLocalProcessor,
1065 DynamicList<point> dynAllCentres(centres.size());
1066 DynamicList<scalar> dynAllRadiusSqr(centres.size());
1068 DynamicList<label> dynAllSegmentMap(centres.size());
1073 forAll(dynSendMap, proci)
1075 dynSendMap[proci].reserve
1089 calcOverlappingProcs
1096 forAll(procBbOverlaps, proci)
1100 procBbOverlaps[proci]
1102 includeLocalProcessor
1107 dynSendMap[proci].append(dynAllCentres.size());
1108 dynAllSegmentMap.append(centrei);
1109 dynAllCentres.append(centres[centrei]);
1110 dynAllRadiusSqr.append(radiusSqr[centrei]);
1119 sendMap[proci].transfer(dynSendMap[proci]);
1122 allCentres.transfer(dynAllCentres);
1123 allRadiusSqr.transfer(dynAllRadiusSqr);
1124 allSegmentMap.transfer(dynAllSegmentMap);
1133 const point& sample,
1134 const point& nearestPoint,
1139 const triSurface& surf =
static_cast<const triSurface&
>(*this);
1149 if (((sample - nearestPoint) &
n) > 0)
1160 Foam::label Foam::distributedTriSurfaceMesh::findOtherFace
1163 const label nearFacei,
1164 const label nearLabel
1167 const triSurface& surf =
static_cast<const triSurface&
>(*this);
1170 const edge
e(nearF[nearLabel], nearF[nearF.fcIndex(nearLabel)]);
1173 for (
const label facei :
pFaces)
1175 if (facei != nearFacei)
1177 int dir = surf[facei].edgeDirection(
e);
1188 void Foam::distributedTriSurfaceMesh::calcFaceFaces
1190 const triSurface&
s,
1195 faceFaces.setSize(
s.size());
1197 DynamicList<label> nbrs;
1201 const labelledTri&
f =
s[facei];
1203 nbrs.reserve(
f.
size());
1210 for (
const label otherFacei :
pFaces)
1212 if (otherFacei != facei)
1214 if (
s[otherFacei].edgeDirection(
e) != 0)
1216 if (!nbrs.find(otherFacei))
1218 nbrs.append(otherFacei);
1224 faceFaces[facei] = std::move(nbrs);
1229 void Foam::distributedTriSurfaceMesh::surfaceSide
1232 const List<pointIndexHit>& nearestInfo,
1233 List<volumeType>& volType
1238 Pout<<
"distributedTriSurfaceMesh::surfaceSide :" 1240 <<
" finding surface side given points on surface for " 1247 labelList triangleIndex(nearestInfo.size());
1248 autoPtr<mapDistribute> mapPtr
1256 const mapDistribute& map = mapPtr();
1260 map.distribute(localSamples);
1266 volType.setSize(triangleIndex.size());
1269 const triSurface& surf =
static_cast<const triSurface&
>(*this);
1278 EdgeMap<labelPair> edgeToFaces;
1282 const label facei = triangleIndex[i];
1284 const point& sample = localSamples[i];
1287 label nearType, nearLabel;
1289 f.nearestPointClassify(sample,
points, nearType, nearLabel);
1291 const point& nearestPoint(pHit.point());
1295 const vector sampleNearestVec = (sample - nearestPoint);
1299 scalar
c = sampleNearestVec & surf[facei].areaNormal(
points);
1317 label otherFacei = findOtherFace(pointFaces, facei, nearLabel);
1318 if (otherFacei != -1)
1321 edgeSide(sample, nearestPoint, facei, otherFacei);
1335 const label pointi =
f[nearLabel];
1337 const vector sampleNearestVec = (sample - nearestPoint);
1341 edgeToFaces.clear();
1343 scalar maxCosAngle = -GREAT;
1346 for (
const label facei :
pFaces)
1350 label fp =
f.
find(pointi);
1362 for (
const edge&
e : edges)
1364 auto iter = edgeToFaces.find(
e);
1367 if (iter().second() == -1)
1370 iter().second() = facei;
1373 scalar magEVec =
mag(eVec);
1375 if (magEVec > VSMALL)
1381 scalar cosAngle(sampleNearestVec&eVec);
1382 if (cosAngle > maxCosAngle)
1384 maxCosAngle = cosAngle;
1385 maxEdgeFaces = iter();
1405 for (
auto iter : edgeToFaces)
1407 if (iter[0] == -1 || iter[1] == -1)
1415 volType[i] = edgeSide
1451 map.constructHasFlip(),
1498 Pout<<
"distributedTriSurfaceMesh::surfaceSide :" 1500 <<
" given points on surface " 1507 void Foam::distributedTriSurfaceMesh::collectLeafMids
1510 DynamicField<point>& midPoints
1513 const auto& nod =
tree().nodes()[nodeI];
1515 for (
direction octant = 0; octant < nod.subNodes_.size(); octant++)
1517 const labelBits index = nod.subNodes_[octant];
1534 const treeBoundBox subBb = nod.bb_.subBbox(octant);
1535 midPoints.append(subBb.centre());
1543 const List<volumeType>& midPointTypes,
1545 PackedList<2>& nodeTypes,
1553 const auto& nod =
tree().nodes()[nodeI];
1557 for (
direction octant = 0; octant < nod.subNodes_.size(); octant++)
1561 const labelBits index = nod.subNodes_[octant];
1566 subType = calcVolumeType
1588 subType = midPointTypes[midPointi++];
1600 else if (subType != myType)
1615 const auto& nod =
tree().nodes()[nodeI];
1617 direction octant = nod.bb_.subOctant(sample);
1639 labelBits index = nod.subNodes_[octant];
1644 volumeType subType = cachedVolumeType
1662 <<
"Sample:" << sample <<
" node:" << nodeI
1663 <<
" with bb:" << nod.bb_ <<
nl 1664 <<
"Empty subnode has invalid volume type MIXED." 1673 <<
"Sample:" << sample <<
" at node:" << nodeI
1674 <<
" octant:" << octant
1675 <<
" with bb:" << nod.bb_.subBbox(octant) <<
nl 1676 <<
"Node has invalid volume type " << octantType
1691 Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
1699 "distributedTriSurfaceMesh::independentlyDistributedBbs" 1707 const auto* dictPtr =
1720 if (!decomposeParDict_)
1722 decomposeParDict_.reset
1744 List<List<treeBoundBox>> bbs
1750 const globalIndex& triIndexer = globalTris();
1757 if (triIndexer.localSize(proci) != 0)
1769 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1770 <<
" determining master-only decomposition for " <<
s.size()
1778 triCentres[trii] =
s[trii].centre(
s.points());
1782 if (!isA<geomDecomp>(decomposer_()))
1788 calcFaceFaces(
s, pointFaces, faceFaces);
1792 distribution = decomposer_().decompose(faceFaces, triCentres);
1798 distribution = decomposer_().decompose(triCentres);
1803 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1804 <<
" determining processor bounding boxes for surface" 1811 treeBoundBox& bb = bbs[distribution[trii]][0];
1812 bb.add(
s.points(),
s[trii]);
1822 else if (distType_ == DISTRIBUTED)
1826 if (!decomposer_().parallelAware())
1829 <<
"The decomposition method " << decomposer_().typeName
1830 <<
" does not decompose in parallel." 1836 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1837 <<
" determining decomposition for " <<
s.size()
1846 triCentres[trii] =
s[trii].centre(
s.points());
1849 labelList distribution = decomposer_().decompose(triCentres);
1853 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1854 <<
" determining processor bounding boxes for " 1861 treeBoundBox& bb = bbs[distribution[trii]][0];
1862 bb.add(
s.points(),
s[trii]);
2075 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 2076 <<
" collecting all centroids for surface " 2085 allCentres[trii] =
s[trii].centre(
s.points());
2112 Pout<<
"distributedTriSurfaceMesh::" 2113 <<
"independentlyDistributedBbs :" 2115 <<
" merged " << allCentres.size()
2116 <<
" centroids down to " << nMerged <<
endl;
2121 UIndirectList<point>(mergedPoints, allToMerged) = allCentres;
2125 labelList mergedDist(decomposer_().decompose(mergedPoints));
2129 allDistribution = UIndirectList<label>
2137 globalTris().scatter
2146 Pout<<
"distributedTriSurfaceMesh::" 2147 <<
"independentlyDistributedBbs :" 2148 <<
" determined decomposition" <<
endl;
2155 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 2156 <<
" determining processor bounding boxes for " 2162 treeBoundBox& bb = bbs[distribution[trii]][0];
2163 bb.add(
s.points(),
s[trii]);
2178 bool Foam::distributedTriSurfaceMesh::overlaps
2180 const List<treeBoundBox>& bbs,
2184 treeBoundBox triBb(tri.a());
2188 for (
const treeBoundBox& bb : bbs)
2195 if (bb.overlaps(triBb) && bb.intersects(tri))
2204 void Foam::distributedTriSurfaceMesh::subsetMeshMap
2206 const triSurface&
s,
2208 const label nIncluded,
2214 newToOldFaces.setSize(nIncluded);
2215 newToOldPoints.setSize(
s.points().size());
2216 oldToNewPoints.setSize(
s.points().size());
2217 oldToNewPoints = -1;
2222 forAll(include, oldFacei)
2224 if (include[oldFacei])
2227 newToOldFaces[facei++] = oldFacei;
2230 for (
const label oldPointi :
s[oldFacei])
2232 if (oldToNewPoints[oldPointi] == -1)
2234 oldToNewPoints[oldPointi] = pointi;
2235 newToOldPoints[pointi++] = oldPointi;
2240 newToOldPoints.setSize(pointi);
2247 const triSurface&
s,
2255 forAll(newToOldPoints, i)
2257 newPoints[i] =
s.points()[newToOldPoints[i]];
2260 List<labelledTri> newTriangles(newToOldFaces.size());
2265 const labelledTri& tri =
s[newToOldFaces[i]];
2267 newTriangles[i][0] = oldToNewPoints[tri[0]];
2268 newTriangles[i][1] = oldToNewPoints[tri[1]];
2269 newTriangles[i][2] = oldToNewPoints[tri[2]];
2270 newTriangles[i].region() = tri.region();
2274 return triSurface(newTriangles,
s.patches(), newPoints,
true);
2280 const triSurface&
s,
2319 const triSurface&
s,
2326 ListOps::createWithValue<bool>(
s.size(), newToOldFaces,
true,
false)
2329 newToOldPoints.setSize(
s.points().size());
2330 labelList oldToNewPoints(
s.points().size(), -1);
2334 forAll(include, oldFacei)
2336 if (include[oldFacei])
2339 for (
const label oldPointi :
s[oldFacei])
2341 if (oldToNewPoints[oldPointi] == -1)
2343 oldToNewPoints[oldPointi] = pointi;
2344 newToOldPoints[pointi++] = oldPointi;
2349 newToOldPoints.setSize(pointi);
2362 Foam::label Foam::distributedTriSurfaceMesh::findTriangle
2364 const List<labelledTri>& allFaces,
2366 const labelledTri& otherF
2374 const labelledTri&
f = allFaces[
pFaces[i]];
2376 if (
f.region() == otherF.region())
2379 label fp0 =
f.
find(otherF[0]);
2384 if (
f[fp1] == otherF[1] &&
f[fp2] == otherF[2])
2395 void Foam::distributedTriSurfaceMesh::merge
2397 const scalar mergeDist,
2398 const List<labelledTri>& subTris,
2401 List<labelledTri>& allTris,
2424 label allPointi = nOldAllPoints;
2425 forAll(pointConstructMap, pointi)
2427 if (pointConstructMap[pointi] == -1)
2429 pointConstructMap[pointi] = allPointi++;
2433 if (allPointi > nOldAllPoints)
2437 forAll(pointConstructMap, pointi)
2439 if (pointConstructMap[pointi] >= nOldAllPoints)
2441 allPoints[pointConstructMap[pointi]] = subPoints[pointi];
2455 label allTrii = allTris.size();
2456 allTris.setSize(allTrii + subTris.size());
2458 faceConstructMap.setSize(subTris.size());
2462 const labelledTri& subTri = subTris[trii];
2465 labelledTri mappedTri
2467 pointConstructMap[subTri[0]],
2468 pointConstructMap[subTri[1]],
2469 pointConstructMap[subTri[2]],
2475 bool fullMatch =
true;
2479 if (mappedTri[fp] >= nOldAllPoints)
2490 label i = findTriangle
2500 faceConstructMap[trii] = allTrii;
2501 allTris[allTrii] = mappedTri;
2506 faceConstructMap[trii] = i;
2512 faceConstructMap[trii] = allTrii;
2513 allTris[allTrii] = mappedTri;
2517 allTris.setSize(allTrii);
2523 Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
2545 currentDistType_(FROZEN)
2569 Info<<
'\t' << proci <<
'\t' << nTris[proci]
2570 <<
'\t' << procBb_[proci] <<
endl;
2578 Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh(
const IOobject&
io)
2585 findLocalInstance(
io),
2608 currentDistType_(FROZEN)
2623 || actualFile !=
io.localFilePath(triSurfaceMesh::typeName)
2629 <<
"Read distributedTriSurface " <<
io.name()
2630 <<
" from parent path " << actualFile <<
endl;
2653 <<
"Read distributedTriSurface " <<
io.name()
2654 <<
" from actual path " << actualFile <<
':' <<
endl;
2666 Info<<
'\t' << proci <<
'\t' << nTris[proci]
2667 <<
'\t' << procBb_[proci] <<
endl;
2676 <<
"Read distributedTriSurface " <<
io.name() <<
':' <<
endl;
2682 Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
2693 findLocalInstance(
io),
2717 currentDistType_(FROZEN)
2744 "outsideVolumeType",
2761 || actualFile !=
io.localFilePath(triSurfaceMesh::typeName)
2767 <<
"Read distributedTriSurface " <<
io.name()
2768 <<
" from parent path " << actualFile
2769 <<
" and dictionary" <<
endl;
2792 <<
"Read distributedTriSurface " <<
io.name()
2793 <<
" from actual path " << actualFile
2794 <<
" and dictionary:" <<
endl;
2806 Info<<
'\t' << proci <<
'\t' << nTris[proci]
2807 <<
'\t' << procBb_[proci] <<
endl;
2816 <<
"Read distributedTriSurface " <<
io.name() <<
':' <<
endl;
2832 globalTris_.clear();
2845 return *globalTris_;
3089 "distributedTriSurfaceMesh::findNearest" 3094 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3096 <<
" trying to find nearest for " <<
samples.
size()
3097 <<
" samples with max sphere " 3127 forAll(dynSendMap, proci)
3134 label minProci = -1;
3144 label nContains = 0;
3147 if (procContains[proci])
3150 dynSendMap[proci].
append(samplei);
3151 distSqr[samplei] = best.
second();
3171 dynSendMap[minProci].
append(samplei);
3172 distSqr[samplei] = best.
second();
3180 sendMap[proci].
transfer(dynSendMap[proci]);
3199 <<
" outside\t" << nOutside <<
endl;
3212 convertTriIndices(localInfo);
3220 label nIgnoredHit = 0;
3246 ni.
second() = info.
point().distSqr(localPoints[i]);
3253 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3255 <<
" searched locally for " << localPoints.
size()
3256 <<
" samples with max sphere " 3258 <<
" found hits:" << nHit
3259 <<
" of which outside local bb:" << nIgnoredHit
3302 forAll(nearestInfo, samplei)
3328 calcOverlappingProcs(sample, d2, procBbOverlaps);
3330 forAll(procBbOverlaps, proci)
3332 if (procBbOverlaps[proci])
3338 if (proci != hitProci)
3340 dynSendMap[proci].
append(samplei);
3349 sendMap[proci].
transfer(dynSendMap[proci]);
3374 forAll(nearestInfo, samplei)
3377 if (ni.
first().hit())
3379 localDistSqr[samplei] = ni.
second();
3387 convertTriIndices(localInfo);
3392 label nIgnoredHit = 0;
3412 ni.
second() = info.
point().distSqr(localSamples[i]);
3419 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3421 <<
" searched locally for " << localSamples.
size()
3422 <<
" samples with max sphere " 3424 <<
" found hits:" << nHit
3425 <<
" of which outside local bb:" << nIgnoredHit
3453 info[samplei] = ni.
first();
3481 "distributedTriSurfaceMesh::findNearestRegion" 3486 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3488 <<
" trying to find nearest and region for " <<
samples.
size()
3489 <<
" samples with max sphere " 3494 if (regionIndices.
empty())
3496 findNearest(
samples, nearestDistSqr, info);
3540 convertTriIndices(allInfo);
3544 if (allInfo[i].hit())
3557 allInfo[i].setMiss();
3558 allInfo[i].setIndex(-1);
3575 if (allInfo[i].hit())
3577 label pointi = allSegmentMap[i];
3579 if (!info[pointi].hit())
3582 info[pointi] = allInfo[i];
3593 info[pointi] = allInfo[i];
3602 void Foam::distributedTriSurfaceMesh::findLine
3665 Pout<<
"distributedTriSurfaceMesh::findLineAll :" 3667 <<
" intersecting with " 3668 << start.
size() <<
" rays" <<
endl;
3674 "distributedTriSurfaceMesh::findLineAll" 3704 + vector::uniform(ROOTVSMALL)
3716 if (hitInfo[pointi].hit())
3718 info[pointi].setSize(1);
3719 info[pointi][0] = hitInfo[pointi];
3721 point pt = hitInfo[pointi].point() + smallVec[pointi];
3723 if (((pt-start[pointi])&dirVec[pointi]) <= magSqrDirVec[pointi])
3726 e1[compacti] =
end[pointi];
3727 pointMap[compacti] = pointi;
3733 info[pointi].
clear();
3737 e0.setSize(compacti);
3738 e1.setSize(compacti);
3739 pointMap.setSize(compacti);
3758 if (hitInfo[i].hit())
3760 label pointi = pointMap[i];
3762 label sz = info[pointi].size();
3763 info[pointi].setSize(sz+1);
3764 info[pointi][sz] = hitInfo[i];
3766 point pt = hitInfo[i].point() + smallVec[pointi];
3769 scalar d = ((pt-start[pointi])&dirVec[pointi]);
3773 if (d > 0 && d <= magSqrDirVec[pointi])
3776 e1[compacti] =
end[pointi];
3777 pointMap[compacti] = pointi;
3784 e0.setSize(compacti);
3785 e1.setSize(compacti);
3786 pointMap.setSize(compacti);
3792 Pout<<
"distributedTriSurfaceMesh::findLineAll :" 3793 <<
" Exiting loop due to excessive number of" 3794 <<
" intersections along ray" 3805 Pout<<
"distributedTriSurfaceMesh::findLineAll :" 3807 <<
" finished intersecting with " 3808 << start.
size() <<
" rays" <<
endl;
3821 Pout<<
"distributedTriSurfaceMesh::getRegion :" 3823 <<
" getting region for " 3824 << info.
size() <<
" triangles" <<
endl;
3827 addProfiling(getRegion,
"distributedTriSurfaceMesh::getRegion");
3846 Pout<<
"distributedTriSurfaceMesh::getRegion :" 3848 <<
" finished getting region for " 3849 << info.
size() <<
" triangles" <<
endl;
3875 region.
setSize(triangleIndex.size());
3879 label trii = triangleIndex[i];
3880 region[i] =
s[trii].region();
3891 Pout<<
"distributedTriSurfaceMesh::getRegion :" 3893 <<
" finished getting region for " 3894 << info.
size() <<
" triangles" <<
endl;
3913 Pout<<
"distributedTriSurfaceMesh::getNormal :" 3915 <<
" getting normal for " 3916 << info.
size() <<
" triangles" <<
endl;
3919 addProfiling(getNormal,
"distributedTriSurfaceMesh::getNormal");
3942 normal.
setSize(triangleIndex.size());
3946 label trii = triangleIndex[i];
3947 normal[i] =
s[trii].unitNormal(
s.points());
3958 Pout<<
"distributedTriSurfaceMesh::getNormal :" 3960 <<
" finished getting normal for " 3961 << info.
size() <<
" triangles" <<
endl;
4048 if (!hasVolumeType())
4051 <<
"Volume type only supported for closed distributed surfaces." 4063 "distributedTriSurfaceMesh::getCachedVolumeType" 4067 const point outsidePt(bounds().
max() + 0.5*bounds().span());
4070 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4072 <<
" triggering outsidePoint" << outsidePt
4073 <<
" orientation" <<
endl;
4086 surfaceSide(outsidePts, nearestInfo, outsideVolTypes);
4097 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4099 <<
" determined outsidePoint" << outsidePt
4111 const auto& nodes = t.
nodes();
4120 collectLeafMids(0, midPoints);
4125 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4127 <<
" triggering orientation caching for " 4128 << midPoints.
size() <<
" leaf mids" <<
endl;
4145 surfaceSide(midPoints, nearestInfo, midVolTypes);
4162 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4164 <<
" done orientation caching for " 4165 << midPoints.
size() <<
" leaf mids" <<
endl;
4173 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4176 <<
" samples" <<
endl;
4182 "distributedTriSurfaceMesh::getVolumeType" 4201 if (contains(procBb_[proci],
samples[samplei]))
4214 outsideSamples.
append(samplei);
4230 if (contains(procBb_[proci],
samples[samplei]))
4232 sendMap[proci][nSend[proci]++] = samplei;
4255 if (
tree().nodes().size())
4257 volType[i] = cachedVolumeType(0, localPoints[i]);
4261 fullSearchMap.append(i);
4262 fullSearchPoints.append(localPoints[i]);
4268 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4271 <<
" resulting in local queries:" 4272 << localPoints.
size()
4273 <<
" of which cached:" << localPoints.
size()-fullSearchPoints.size()
4288 surfaceSide(fullSearchPoints, nearestInfo, fullSearchType);
4293 volType[fullSearchMap[i]] = fullSearchType[i];
4358 for (label samplei : outsideSamples)
4360 volType[samplei] = outsideVolType_;
4365 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4367 <<
" finished finding orientation for " <<
samples.
size()
4368 <<
" samples" <<
endl;
4387 Pout<<
"distributedTriSurfaceMesh::getField :" 4389 <<
" retrieving field for " 4390 << info.
size() <<
" triangles" <<
endl;
4395 const auto* fldPtr = findObject<triSurfaceLabelField>(
"values");
4419 values.setSize(triangleIndex.size());
4423 label trii = triangleIndex[i];
4436 Pout<<
"distributedTriSurfaceMesh::getField :" 4438 <<
" finished retrieving field for " 4439 << info.
size() <<
" triangles" <<
endl;
4453 includedFace =
false;
4457 const scalar eps = 1.0e-4;
4460 const point mid = bbs[i].centre();
4461 const vector halfSpan = (1.0+eps)*(bbs[i].
max() - mid);
4463 bbsX[i].min() = mid - halfSpan;
4464 bbsX[i].max() = mid + halfSpan;
4473 if (overlaps(bbsX, tri))
4475 includedFace[trii] =
true;
4493 overlappingSurface(
s, bbs, includedFace);
4494 return subsetMesh(
s, includedFace, subPointMap, subFaceMap);
4526 label proci = triIndexer.
whichProcID(info[i].index());
4544 label proci = triIndexer.
whichProcID(info[i].index());
4545 triangleIndex[i] = triIndexer.
toLocal(proci, info[i].index());
4546 sendMap[proci][nSend[proci]++] = i;
4550 triangleIndex[i] = -1;
4559 mapPtr().distribute(triangleIndex);
4568 const bool keepNonLocal,
4580 Pout<<
"distributedTriSurfaceMesh::distribute :" 4582 <<
" distributing surface according to method:" 4583 << distributionTypeNames_[distType_]
4587 addProfiling(distribute,
"distributedTriSurfaceMesh::distribute");
4605 if (currentDistType_ == distType_)
4609 newProcBb = independentlyDistributedBbs(*
this);
4622 if (newProcBb == procBb_)
4628 procBb_.transfer(newProcBb);
4645 <<
"before distribution:" <<
endl <<
"\tproc\ttris" <<
endl;
4649 Info<<
'\t' << proci <<
'\t' << nTris[proci] <<
endl;
4668 pointSendMap[proci],
4682 forAll(faceSendMap, proci)
4686 forAll(faceSendMap[proci], i)
4688 includedFace[faceSendMap[proci][i]] =
false;
4737 allTris = subSurface;
4757 forAll(faceSendMap, proci)
4783 for (
const int proci : pBufs.
allProcs())
4801 faceConstructMap[proci],
4802 pointConstructMap[proci]
4813 std::move(faceSendMap),
4814 std::move(faceConstructMap)
4822 std::move(pointSendMap),
4823 std::move(pointConstructMap)
4836 currentDistType_ = distType_;
4841 distributeFields<label>(
faceMap());
4842 distributeFields<scalar>(
faceMap());
4843 distributeFields<vector>(
faceMap());
4844 distributeFields<sphericalTensor>(
faceMap());
4845 distributeFields<symmTensor>(
faceMap());
4846 distributeFields<tensor>(
faceMap());
4858 <<
"after distribution:" <<
endl <<
"\tproc\ttris" <<
endl;
4862 Info<<
'\t' << proci <<
'\t' << nTris[proci] <<
endl;
4874 Info<<
"Writing local bounding box to " << str.
name() <<
endl;
4878 str.
write(bb,
true);
4889 Info<<
"Writing all bounding boxes to " << str.
name() <<
endl;
4890 for (
const auto& myBbs : procBb_)
4894 str.
write(bb,
true);
4902 Pout<<
"distributedTriSurfaceMesh::distribute :" 4904 <<
" done distributing surface according to method:" 4905 << distributionTypeNames_[distType_]
4914 const bool writeOnProc
4919 Pout<<
"distributedTriSurfaceMesh::writeObject :" 4921 <<
" writing surface:" << writeOnProc <<
endl;
4949 bool ok = dict_.writeObject(streamOpt,
true);
4953 Pout<<
"distributedTriSurfaceMesh::writeObject :" 4955 <<
" done writing surface" <<
endl;
4972 <<
"Bounding Box : " << bb <<
endl 4973 <<
"Closed : " << surfaceClosed_ <<
endl 4975 <<
"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.
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 bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
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)
static rangeType allProcs(const label communicator=worldComm)
Range of process indices for all processes.
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 List 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.
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler()
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
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)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
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
Communicator for all ranks. May differ from commGlobal() 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.
List< labelList > labelListList
List of labelList.
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). It 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()
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.
Reading is optional [identical to LAZY_READ].
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.
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.
const Time & time() const noexcept
Return Time associated with the objectRegistry.
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...
label size() const noexcept
The number of elements in the List.
label recvDataCount(const label proci) const
Number of unconsumed receive bytes for the specified processor. Must call finishedSends() or other fi...
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 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).
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)
True if process corresponds to the master rank in the communicator.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
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)
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
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.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
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.
UPstream::rangeType allProcs() const noexcept
Range of ranks indices associated with PstreamBuffers.
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)