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 if (surf[facei].contains(
e))
1187 void Foam::distributedTriSurfaceMesh::calcFaceFaces
1189 const triSurface&
s,
1194 faceFaces.setSize(
s.size());
1196 DynamicList<label> nbrs;
1200 const labelledTri&
f =
s[facei];
1202 nbrs.reserve(
f.
size());
1209 for (
const label otherFacei :
pFaces)
1211 if (otherFacei != facei)
1213 if (
s[otherFacei].contains(
e))
1215 if (!nbrs.find(otherFacei))
1217 nbrs.append(otherFacei);
1223 faceFaces[facei] = std::move(nbrs);
1228 void Foam::distributedTriSurfaceMesh::surfaceSide
1231 const List<pointIndexHit>& nearestInfo,
1232 List<volumeType>& volType
1237 Pout<<
"distributedTriSurfaceMesh::surfaceSide :" 1239 <<
" finding surface side given points on surface for " 1246 labelList triangleIndex(nearestInfo.size());
1247 autoPtr<mapDistribute> mapPtr
1255 const mapDistribute& map = mapPtr();
1259 map.distribute(localSamples);
1265 volType.setSize(triangleIndex.size());
1268 const triSurface& surf =
static_cast<const triSurface&
>(*this);
1277 EdgeMap<labelPair> edgeToFaces;
1281 const label facei = triangleIndex[i];
1283 const point& sample = localSamples[i];
1286 label nearType, nearLabel;
1288 f.nearestPointClassify(sample,
points, nearType, nearLabel);
1290 const point& nearestPoint(pHit.point());
1294 const vector sampleNearestVec = (sample - nearestPoint);
1298 scalar
c = sampleNearestVec & surf[facei].areaNormal(
points);
1316 label otherFacei = findOtherFace(pointFaces, facei, nearLabel);
1317 if (otherFacei != -1)
1320 edgeSide(sample, nearestPoint, facei, otherFacei);
1334 const label pointi =
f[nearLabel];
1336 const vector sampleNearestVec = (sample - nearestPoint);
1340 edgeToFaces.clear();
1342 scalar maxCosAngle = -GREAT;
1345 for (
const label facei :
pFaces)
1349 label fp =
f.
find(pointi);
1361 for (
const edge&
e : edges)
1363 auto iter = edgeToFaces.find(
e);
1366 if (iter().second() == -1)
1369 iter().second() = facei;
1372 scalar magEVec =
mag(eVec);
1374 if (magEVec > VSMALL)
1380 scalar cosAngle(sampleNearestVec&eVec);
1381 if (cosAngle > maxCosAngle)
1383 maxCosAngle = cosAngle;
1384 maxEdgeFaces = iter();
1404 for (
auto iter : edgeToFaces)
1406 if (iter[0] == -1 || iter[1] == -1)
1414 volType[i] = edgeSide
1450 map.constructHasFlip(),
1497 Pout<<
"distributedTriSurfaceMesh::surfaceSide :" 1499 <<
" given points on surface " 1506 void Foam::distributedTriSurfaceMesh::collectLeafMids
1509 DynamicField<point>& midPoints
1512 const auto& nod =
tree().nodes()[nodeI];
1514 for (
direction octant = 0; octant < nod.subNodes_.size(); octant++)
1516 const labelBits index = nod.subNodes_[octant];
1533 const treeBoundBox subBb = nod.bb_.subBbox(octant);
1534 midPoints.append(subBb.centre());
1542 const List<volumeType>& midPointTypes,
1544 PackedList<2>& nodeTypes,
1552 const auto& nod =
tree().nodes()[nodeI];
1556 for (
direction octant = 0; octant < nod.subNodes_.size(); octant++)
1560 const labelBits index = nod.subNodes_[octant];
1565 subType = calcVolumeType
1587 subType = midPointTypes[midPointi++];
1599 else if (subType != myType)
1614 const auto& nod =
tree().nodes()[nodeI];
1616 direction octant = nod.bb_.subOctant(sample);
1638 labelBits index = nod.subNodes_[octant];
1643 volumeType subType = cachedVolumeType
1661 <<
"Sample:" << sample <<
" node:" << nodeI
1662 <<
" with bb:" << nod.bb_ <<
nl 1663 <<
"Empty subnode has invalid volume type MIXED." 1672 <<
"Sample:" << sample <<
" at node:" << nodeI
1673 <<
" octant:" << octant
1674 <<
" with bb:" << nod.bb_.subBbox(octant) <<
nl 1675 <<
"Node has invalid volume type " << octantType
1690 Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
1698 "distributedTriSurfaceMesh::independentlyDistributedBbs" 1706 const auto* dictPtr =
1719 if (!decomposeParDict_)
1721 decomposeParDict_.reset
1743 List<List<treeBoundBox>> bbs
1749 const globalIndex& triIndexer = globalTris();
1756 if (triIndexer.localSize(proci) != 0)
1768 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1769 <<
" determining master-only decomposition for " <<
s.size()
1777 triCentres[trii] =
s[trii].centre(
s.points());
1781 if (!isA<geomDecomp>(decomposer_()))
1787 calcFaceFaces(
s, pointFaces, faceFaces);
1791 distribution = decomposer_().decompose(faceFaces, triCentres);
1797 distribution = decomposer_().decompose(triCentres);
1802 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1803 <<
" determining processor bounding boxes for surface" 1810 treeBoundBox& bb = bbs[distribution[trii]][0];
1811 bb.add(
s.points(),
s[trii]);
1821 else if (distType_ == DISTRIBUTED)
1825 if (!decomposer_().parallelAware())
1828 <<
"The decomposition method " << decomposer_().typeName
1829 <<
" does not decompose in parallel." 1835 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1836 <<
" determining decomposition for " <<
s.size()
1845 triCentres[trii] =
s[trii].centre(
s.points());
1848 labelList distribution = decomposer_().decompose(triCentres);
1852 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1853 <<
" determining processor bounding boxes for " 1860 treeBoundBox& bb = bbs[distribution[trii]][0];
1861 bb.add(
s.points(),
s[trii]);
2074 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 2075 <<
" collecting all centroids for surface " 2084 allCentres[trii] =
s[trii].centre(
s.points());
2111 Pout<<
"distributedTriSurfaceMesh::" 2112 <<
"independentlyDistributedBbs :" 2114 <<
" merged " << allCentres.size()
2115 <<
" centroids down to " << nMerged <<
endl;
2120 UIndirectList<point>(mergedPoints, allToMerged) = allCentres;
2124 labelList mergedDist(decomposer_().decompose(mergedPoints));
2128 allDistribution = UIndirectList<label>
2136 globalTris().scatter
2145 Pout<<
"distributedTriSurfaceMesh::" 2146 <<
"independentlyDistributedBbs :" 2147 <<
" determined decomposition" <<
endl;
2154 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 2155 <<
" determining processor bounding boxes for " 2161 treeBoundBox& bb = bbs[distribution[trii]][0];
2162 bb.add(
s.points(),
s[trii]);
2177 bool Foam::distributedTriSurfaceMesh::overlaps
2179 const List<treeBoundBox>& bbs,
2183 treeBoundBox triBb(tri.a());
2187 for (
const treeBoundBox& bb : bbs)
2194 if (bb.overlaps(triBb) && bb.intersects(tri))
2203 void Foam::distributedTriSurfaceMesh::subsetMeshMap
2205 const triSurface&
s,
2207 const label nIncluded,
2213 newToOldFaces.setSize(nIncluded);
2214 newToOldPoints.setSize(
s.points().size());
2215 oldToNewPoints.setSize(
s.points().size());
2216 oldToNewPoints = -1;
2221 forAll(include, oldFacei)
2223 if (include[oldFacei])
2226 newToOldFaces[facei++] = oldFacei;
2229 for (
const label oldPointi :
s[oldFacei])
2231 if (oldToNewPoints[oldPointi] == -1)
2233 oldToNewPoints[oldPointi] = pointi;
2234 newToOldPoints[pointi++] = oldPointi;
2239 newToOldPoints.setSize(pointi);
2246 const triSurface&
s,
2254 forAll(newToOldPoints, i)
2256 newPoints[i] =
s.points()[newToOldPoints[i]];
2259 List<labelledTri> newTriangles(newToOldFaces.size());
2264 const labelledTri& tri =
s[newToOldFaces[i]];
2266 newTriangles[i][0] = oldToNewPoints[tri[0]];
2267 newTriangles[i][1] = oldToNewPoints[tri[1]];
2268 newTriangles[i][2] = oldToNewPoints[tri[2]];
2269 newTriangles[i].region() = tri.region();
2273 return triSurface(newTriangles,
s.patches(), newPoints,
true);
2279 const triSurface&
s,
2318 const triSurface&
s,
2325 ListOps::createWithValue<bool>(
s.size(), newToOldFaces,
true,
false)
2328 newToOldPoints.setSize(
s.points().size());
2329 labelList oldToNewPoints(
s.points().size(), -1);
2333 forAll(include, oldFacei)
2335 if (include[oldFacei])
2338 for (
const label oldPointi :
s[oldFacei])
2340 if (oldToNewPoints[oldPointi] == -1)
2342 oldToNewPoints[oldPointi] = pointi;
2343 newToOldPoints[pointi++] = oldPointi;
2348 newToOldPoints.setSize(pointi);
2361 Foam::label Foam::distributedTriSurfaceMesh::findTriangle
2363 const List<labelledTri>& allFaces,
2365 const labelledTri& otherF
2373 const labelledTri&
f = allFaces[
pFaces[i]];
2375 if (
f.region() == otherF.region())
2378 label fp0 =
f.
find(otherF[0]);
2383 if (
f[fp1] == otherF[1] &&
f[fp2] == otherF[2])
2394 void Foam::distributedTriSurfaceMesh::merge
2396 const scalar mergeDist,
2397 const List<labelledTri>& subTris,
2400 List<labelledTri>& allTris,
2423 label allPointi = nOldAllPoints;
2424 forAll(pointConstructMap, pointi)
2426 if (pointConstructMap[pointi] == -1)
2428 pointConstructMap[pointi] = allPointi++;
2432 if (allPointi > nOldAllPoints)
2436 forAll(pointConstructMap, pointi)
2438 if (pointConstructMap[pointi] >= nOldAllPoints)
2440 allPoints[pointConstructMap[pointi]] = subPoints[pointi];
2454 label allTrii = allTris.size();
2455 allTris.setSize(allTrii + subTris.size());
2457 faceConstructMap.setSize(subTris.size());
2461 const labelledTri& subTri = subTris[trii];
2464 labelledTri mappedTri
2466 pointConstructMap[subTri[0]],
2467 pointConstructMap[subTri[1]],
2468 pointConstructMap[subTri[2]],
2474 bool fullMatch =
true;
2478 if (mappedTri[fp] >= nOldAllPoints)
2489 label i = findTriangle
2499 faceConstructMap[trii] = allTrii;
2500 allTris[allTrii] = mappedTri;
2505 faceConstructMap[trii] = i;
2511 faceConstructMap[trii] = allTrii;
2512 allTris[allTrii] = mappedTri;
2516 allTris.setSize(allTrii);
2522 Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
2544 currentDistType_(FROZEN)
2568 Info<<
'\t' << proci <<
'\t' << nTris[proci]
2569 <<
'\t' << procBb_[proci] <<
endl;
2577 Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh(
const IOobject&
io)
2584 findLocalInstance(
io),
2607 currentDistType_(FROZEN)
2622 || actualFile !=
io.localFilePath(triSurfaceMesh::typeName)
2628 <<
"Read distributedTriSurface " <<
io.name()
2629 <<
" from parent path " << actualFile <<
endl;
2652 <<
"Read distributedTriSurface " <<
io.name()
2653 <<
" from actual path " << actualFile <<
':' <<
endl;
2665 Info<<
'\t' << proci <<
'\t' << nTris[proci]
2666 <<
'\t' << procBb_[proci] <<
endl;
2675 <<
"Read distributedTriSurface " <<
io.name() <<
':' <<
endl;
2681 Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
2692 findLocalInstance(
io),
2716 currentDistType_(FROZEN)
2743 "outsideVolumeType",
2760 || actualFile !=
io.localFilePath(triSurfaceMesh::typeName)
2766 <<
"Read distributedTriSurface " <<
io.name()
2767 <<
" from parent path " << actualFile
2768 <<
" and dictionary" <<
endl;
2791 <<
"Read distributedTriSurface " <<
io.name()
2792 <<
" from actual path " << actualFile
2793 <<
" and dictionary:" <<
endl;
2805 Info<<
'\t' << proci <<
'\t' << nTris[proci]
2806 <<
'\t' << procBb_[proci] <<
endl;
2815 <<
"Read distributedTriSurface " <<
io.name() <<
':' <<
endl;
2831 globalTris_.clear();
2844 return *globalTris_;
3088 "distributedTriSurfaceMesh::findNearest" 3093 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3095 <<
" trying to find nearest for " <<
samples.
size()
3096 <<
" samples with max sphere " 3126 forAll(dynSendMap, proci)
3133 label minProci = -1;
3143 label nContains = 0;
3146 if (procContains[proci])
3149 dynSendMap[proci].
append(samplei);
3150 distSqr[samplei] = best.
second();
3170 dynSendMap[minProci].
append(samplei);
3171 distSqr[samplei] = best.
second();
3179 sendMap[proci].
transfer(dynSendMap[proci]);
3198 <<
" outside\t" << nOutside <<
endl;
3211 convertTriIndices(localInfo);
3219 label nIgnoredHit = 0;
3245 ni.
second() = info.
point().distSqr(localPoints[i]);
3252 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3254 <<
" searched locally for " << localPoints.
size()
3255 <<
" samples with max sphere " 3257 <<
" found hits:" << nHit
3258 <<
" of which outside local bb:" << nIgnoredHit
3301 forAll(nearestInfo, samplei)
3327 calcOverlappingProcs(sample, d2, procBbOverlaps);
3329 forAll(procBbOverlaps, proci)
3331 if (procBbOverlaps[proci])
3337 if (proci != hitProci)
3339 dynSendMap[proci].
append(samplei);
3348 sendMap[proci].
transfer(dynSendMap[proci]);
3373 forAll(nearestInfo, samplei)
3376 if (ni.
first().hit())
3378 localDistSqr[samplei] = ni.
second();
3386 convertTriIndices(localInfo);
3391 label nIgnoredHit = 0;
3411 ni.
second() = info.
point().distSqr(localSamples[i]);
3418 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3420 <<
" searched locally for " << localSamples.
size()
3421 <<
" samples with max sphere " 3423 <<
" found hits:" << nHit
3424 <<
" of which outside local bb:" << nIgnoredHit
3452 info[samplei] = ni.
first();
3480 "distributedTriSurfaceMesh::findNearestRegion" 3485 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3487 <<
" trying to find nearest and region for " <<
samples.
size()
3488 <<
" samples with max sphere " 3493 if (regionIndices.
empty())
3495 findNearest(
samples, nearestDistSqr, info);
3539 convertTriIndices(allInfo);
3543 if (allInfo[i].hit())
3556 allInfo[i].setMiss();
3557 allInfo[i].setIndex(-1);
3574 if (allInfo[i].hit())
3576 label pointi = allSegmentMap[i];
3578 if (!info[pointi].hit())
3581 info[pointi] = allInfo[i];
3592 info[pointi] = allInfo[i];
3601 void Foam::distributedTriSurfaceMesh::findLine
3664 Pout<<
"distributedTriSurfaceMesh::findLineAll :" 3666 <<
" intersecting with " 3667 << start.
size() <<
" rays" <<
endl;
3673 "distributedTriSurfaceMesh::findLineAll" 3703 + vector::uniform(ROOTVSMALL)
3715 if (hitInfo[pointi].hit())
3717 info[pointi].setSize(1);
3718 info[pointi][0] = hitInfo[pointi];
3720 point pt = hitInfo[pointi].point() + smallVec[pointi];
3722 if (((pt-start[pointi])&dirVec[pointi]) <= magSqrDirVec[pointi])
3725 e1[compacti] =
end[pointi];
3726 pointMap[compacti] = pointi;
3732 info[pointi].
clear();
3736 e0.setSize(compacti);
3737 e1.setSize(compacti);
3738 pointMap.setSize(compacti);
3757 if (hitInfo[i].hit())
3759 label pointi = pointMap[i];
3761 label sz = info[pointi].size();
3762 info[pointi].setSize(sz+1);
3763 info[pointi][sz] = hitInfo[i];
3765 point pt = hitInfo[i].point() + smallVec[pointi];
3768 scalar d = ((pt-start[pointi])&dirVec[pointi]);
3772 if (d > 0 && d <= magSqrDirVec[pointi])
3775 e1[compacti] =
end[pointi];
3776 pointMap[compacti] = pointi;
3783 e0.setSize(compacti);
3784 e1.setSize(compacti);
3785 pointMap.setSize(compacti);
3791 Pout<<
"distributedTriSurfaceMesh::findLineAll :" 3792 <<
" Exiting loop due to excessive number of" 3793 <<
" intersections along ray" 3804 Pout<<
"distributedTriSurfaceMesh::findLineAll :" 3806 <<
" finished intersecting with " 3807 << start.
size() <<
" rays" <<
endl;
3820 Pout<<
"distributedTriSurfaceMesh::getRegion :" 3822 <<
" getting region for " 3823 << info.
size() <<
" triangles" <<
endl;
3826 addProfiling(getRegion,
"distributedTriSurfaceMesh::getRegion");
3845 Pout<<
"distributedTriSurfaceMesh::getRegion :" 3847 <<
" finished getting region for " 3848 << info.
size() <<
" triangles" <<
endl;
3874 region.
setSize(triangleIndex.size());
3878 label trii = triangleIndex[i];
3879 region[i] =
s[trii].region();
3890 Pout<<
"distributedTriSurfaceMesh::getRegion :" 3892 <<
" finished getting region for " 3893 << info.
size() <<
" triangles" <<
endl;
3912 Pout<<
"distributedTriSurfaceMesh::getNormal :" 3914 <<
" getting normal for " 3915 << info.
size() <<
" triangles" <<
endl;
3918 addProfiling(getNormal,
"distributedTriSurfaceMesh::getNormal");
3941 normal.
setSize(triangleIndex.size());
3945 label trii = triangleIndex[i];
3946 normal[i] =
s[trii].unitNormal(
s.points());
3957 Pout<<
"distributedTriSurfaceMesh::getNormal :" 3959 <<
" finished getting normal for " 3960 << info.
size() <<
" triangles" <<
endl;
4047 if (!hasVolumeType())
4050 <<
"Volume type only supported for closed distributed surfaces." 4062 "distributedTriSurfaceMesh::getCachedVolumeType" 4066 const point outsidePt(bounds().
max() + 0.5*bounds().span());
4069 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4071 <<
" triggering outsidePoint" << outsidePt
4072 <<
" orientation" <<
endl;
4085 surfaceSide(outsidePts, nearestInfo, outsideVolTypes);
4096 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4098 <<
" determined outsidePoint" << outsidePt
4110 const auto& nodes = t.
nodes();
4119 collectLeafMids(0, midPoints);
4124 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4126 <<
" triggering orientation caching for " 4127 << midPoints.
size() <<
" leaf mids" <<
endl;
4144 surfaceSide(midPoints, nearestInfo, midVolTypes);
4161 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4163 <<
" done orientation caching for " 4164 << midPoints.
size() <<
" leaf mids" <<
endl;
4172 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4175 <<
" samples" <<
endl;
4181 "distributedTriSurfaceMesh::getVolumeType" 4200 if (contains(procBb_[proci],
samples[samplei]))
4213 outsideSamples.
append(samplei);
4229 if (contains(procBb_[proci],
samples[samplei]))
4231 sendMap[proci][nSend[proci]++] = samplei;
4254 if (
tree().nodes().size())
4256 volType[i] = cachedVolumeType(0, localPoints[i]);
4260 fullSearchMap.append(i);
4261 fullSearchPoints.append(localPoints[i]);
4267 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4270 <<
" resulting in local queries:" 4271 << localPoints.
size()
4272 <<
" of which cached:" << localPoints.
size()-fullSearchPoints.size()
4287 surfaceSide(fullSearchPoints, nearestInfo, fullSearchType);
4292 volType[fullSearchMap[i]] = fullSearchType[i];
4357 for (label samplei : outsideSamples)
4359 volType[samplei] = outsideVolType_;
4364 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4366 <<
" finished finding orientation for " <<
samples.
size()
4367 <<
" samples" <<
endl;
4386 Pout<<
"distributedTriSurfaceMesh::getField :" 4388 <<
" retrieving field for " 4389 << info.
size() <<
" triangles" <<
endl;
4394 const auto* fldPtr = findObject<triSurfaceLabelField>(
"values");
4418 values.setSize(triangleIndex.size());
4422 label trii = triangleIndex[i];
4435 Pout<<
"distributedTriSurfaceMesh::getField :" 4437 <<
" finished retrieving field for " 4438 << info.
size() <<
" triangles" <<
endl;
4452 includedFace =
false;
4456 const scalar eps = 1.0e-4;
4459 const point mid = bbs[i].centre();
4460 const vector halfSpan = (1.0+eps)*(bbs[i].
max() - mid);
4462 bbsX[i].min() = mid - halfSpan;
4463 bbsX[i].max() = mid + halfSpan;
4472 if (overlaps(bbsX, tri))
4474 includedFace[trii] =
true;
4492 overlappingSurface(
s, bbs, includedFace);
4493 return subsetMesh(
s, includedFace, subPointMap, subFaceMap);
4525 label proci = triIndexer.
whichProcID(info[i].index());
4543 label proci = triIndexer.
whichProcID(info[i].index());
4544 triangleIndex[i] = triIndexer.
toLocal(proci, info[i].index());
4545 sendMap[proci][nSend[proci]++] = i;
4549 triangleIndex[i] = -1;
4558 mapPtr().distribute(triangleIndex);
4567 const bool keepNonLocal,
4579 Pout<<
"distributedTriSurfaceMesh::distribute :" 4581 <<
" distributing surface according to method:" 4582 << distributionTypeNames_[distType_]
4586 addProfiling(distribute,
"distributedTriSurfaceMesh::distribute");
4604 if (currentDistType_ == distType_)
4608 newProcBb = independentlyDistributedBbs(*
this);
4621 if (newProcBb == procBb_)
4627 procBb_.transfer(newProcBb);
4644 <<
"before distribution:" <<
endl <<
"\tproc\ttris" <<
endl;
4648 Info<<
'\t' << proci <<
'\t' << nTris[proci] <<
endl;
4667 pointSendMap[proci],
4681 forAll(faceSendMap, proci)
4685 forAll(faceSendMap[proci], i)
4687 includedFace[faceSendMap[proci][i]] =
false;
4736 allTris = subSurface;
4756 forAll(faceSendMap, proci)
4782 for (
const int proci : pBufs.
allProcs())
4800 faceConstructMap[proci],
4801 pointConstructMap[proci]
4812 std::move(faceSendMap),
4813 std::move(faceConstructMap)
4821 std::move(pointSendMap),
4822 std::move(pointConstructMap)
4835 currentDistType_ = distType_;
4840 distributeFields<label>(
faceMap());
4841 distributeFields<scalar>(
faceMap());
4842 distributeFields<vector>(
faceMap());
4843 distributeFields<sphericalTensor>(
faceMap());
4844 distributeFields<symmTensor>(
faceMap());
4845 distributeFields<tensor>(
faceMap());
4857 <<
"after distribution:" <<
endl <<
"\tproc\ttris" <<
endl;
4861 Info<<
'\t' << proci <<
'\t' << nTris[proci] <<
endl;
4873 Info<<
"Writing local bounding box to " << str.
name() <<
endl;
4877 str.
write(bb,
true);
4888 Info<<
"Writing all bounding boxes to " << str.
name() <<
endl;
4889 for (
const auto& myBbs : procBb_)
4893 str.
write(bb,
true);
4901 Pout<<
"distributedTriSurfaceMesh::distribute :" 4903 <<
" done distributing surface according to method:" 4904 << distributionTypeNames_[distType_]
4913 const bool writeOnProc
4918 Pout<<
"distributedTriSurfaceMesh::writeObject :" 4920 <<
" writing surface:" << writeOnProc <<
endl;
4948 bool ok = dict_.writeObject(streamOpt,
true);
4952 Pout<<
"distributedTriSurfaceMesh::writeObject :" 4954 <<
" done writing surface" <<
endl;
4971 <<
"Bounding Box : " << bb <<
endl 4972 <<
"Closed : " << surfaceClosed_ <<
endl 4974 <<
"Distribution : " << distributionTypeNames_[distType_] <<
endl;
label toLocal(const label proci, const label i) const
From global to local on proci.
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.
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.
void size(const label n)
Older name for setAddressableSize.
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)
virtual Ostream & write(const char c) override
Write character.
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.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute List data using default commsType, default flip/negate operator.
virtual const fileName & name() const override
Read/write access to the name of the stream.
const word & name() const noexcept
Return the object name.
bool readIfPresent(const word &key, const dictionary &dict, EnumType &val, const bool warnOnly=false) const
Find an entry if present, and assign to T val.
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)
label whichProcID(const label proci, const label i) const
Which processor does global id come from? Checks proci first (assumed to occur reasonably frequently)...
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.
EnumType getOrDefault(const word &key, const dictionary &dict, const EnumType deflt, const bool warnOnly=false) const
Find the key in the dictionary and return the corresponding enumeration element based on its name...
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 communicator ranks. Does nothing in non-paral...
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. ...
#define addProfiling(Name, Descr)
Define profiling trigger with specified name and description string.
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 expressions::valueTypeCode::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), works like std::iota() but returning a...
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.
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 the send phase as being finished.
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)
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.
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.
label find(const T &val) const
Find index of the first occurrence of the value.
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 container.
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
tmp< GeoField > getField(const IOobject &io, const typename GeoField::Mesh &mesh)
Get the field or FatalError.
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.
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.
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...
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...
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)
List< instant > instantList
List of instants.
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.
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.
static void distribute(const UPstream::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 T &nullValue, const CombineOp &cop, const NegateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Distribute combine data with specified combine operation and negate operator (for flips)...
virtual void getField(const List< pointIndexHit > &, labelList &) const
WIP. From a set of hits (points and.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
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)