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
236 io.time().findInstance
259 io.rootPath()/
io.globalCaseName()
260 /
io.instance()/
io.db().dbDir()/
io.local()/
io.name()
265 return io.instance();
269 const scalar startValue =
io.time().timeOutputValue();
273 label instIndex = ts.size()-1;
276 for (; instIndex >= 0; --instIndex)
278 if (ts[instIndex].value() <= startValue)
285 for (; instIndex >= 0; --instIndex)
288 if (ts[instIndex].
name() ==
io.instance())
295 io.rootPath()/
io.globalCaseName()
296 /ts[instIndex].name()/
io.db().dbDir()/
io.local()/
io.name()
301 return ts[instIndex].name();
310 if (!ts.size() || ts[0].name() !=
io.time().constant())
318 io.rootPath()/
io.globalCaseName()
319 /
io.time().constant()/
io.db().dbDir()/
io.local()/
io.name()
324 return io.time().constant();
336 return io.time().constant();
341 bool Foam::distributedTriSurfaceMesh::read()
359 distType_ = DISTRIBUTED;
360 dict_.add(
"distributionType", distributionTypeNames_[distType_]);
364 dict_.add(
"mergeDistance", mergeDist_);
370 dict_.add(
"closed", surfaceClosed_);
393 distType_ = distributionTypeNames_.get(
"distributionType", dict_);
396 dict_.readEntry(
"mergeDistance", mergeDist_);
399 surfaceClosed_ = dict_.getOrDefault<
bool>(
"closed",
false);
416 bool Foam::distributedTriSurfaceMesh::isLocal
418 const List<treeBoundBox>& myBbs,
425 if (myBbs[bbi].contains(start) && myBbs[bbi].contains(
end))
496 void Foam::distributedTriSurfaceMesh::distributeSegment
498 const label segmenti,
502 DynamicList<segment>& allSegments,
503 DynamicList<label>& allSegmentMap,
504 List<DynamicList<label>>& sendMap
521 const List<treeBoundBox>& bbs = procBb_[proci];
523 if (isLocal(bbs, start,
end))
525 sendMap[proci].
append(allSegments.size());
526 allSegmentMap.append(segmenti);
538 const List<treeBoundBox>& bbs = procBb_[proci];
542 const treeBoundBox& bb = bbs[bbi];
550 if (bb.intersects(start,
end, clipPt))
552 sendMap[proci].append(allSegments.size());
553 allSegmentMap.append(segmenti);
577 Foam::distributedTriSurfaceMesh::distributeSegments
582 List<segment>& allSegments,
597 DynamicList<segment> dynAllSegments(start.size());
599 DynamicList<label> dynAllSegmentMap(start.size());
606 dynSendMap[proci].reserve
632 sendMap[proci].transfer(dynSendMap[proci]);
635 allSegments.transfer(dynAllSegments);
636 allSegmentMap.transfer(dynAllSegmentMap);
643 void Foam::distributedTriSurfaceMesh::findLine
645 const bool nearestIntersection,
648 List<pointIndexHit>& info
653 Pout<<
"distributedTriSurfaceMesh::findLine :" 656 << start.size() <<
" rays" <<
endl;
658 addProfiling(findLine,
"distributedTriSurfaceMesh::findLine");
660 const indexedOctree<treeDataTriSurface>& octree =
tree();
663 info.setSize(start.size());
670 const globalIndex& triIndexer = globalTris();
682 if (nearestIntersection)
684 info[i] = octree.findLine(start[i],
end[i]);
688 info[i] = octree.findLineAny(start[i],
end[i]);
693 info[i].setIndex(triIndexer.toGlobal(info[i].index()));
714 List<segment> allSegments(start.size());
718 const autoPtr<mapDistribute> mapPtr
728 const mapDistribute& map = mapPtr();
730 label nOldAllSegments = allSegments.size();
736 map.distribute(allSegments);
743 List<pointIndexHit> intersections(allSegments.size());
747 if (nearestIntersection)
749 intersections[i] = octree.findLine
751 allSegments[i].first(),
752 allSegments[i].second()
757 intersections[i] = octree.findLineAny
759 allSegments[i].first(),
760 allSegments[i].second()
765 if (intersections[i].hit())
767 intersections[i].setIndex
769 triIndexer.toGlobal(intersections[i].index())
778 map.reverseDistribute(nOldAllSegments, intersections);
787 label segmenti = allSegmentMap[i];
797 else if (nearestIntersection)
802 start[segmenti].distSqr(allInfo.point())
803 < start[segmenti].distSqr(hitInfo.point())
815 void Foam::distributedTriSurfaceMesh::convertTriIndices
817 List<pointIndexHit>& info
821 const globalIndex& triIndexer = globalTris();
827 pi.setIndex(triIndexer.toGlobal(
pi.index()));
837 Foam::distributedTriSurfaceMesh::calcLocalQueries
839 const List<pointIndexHit>& info,
847 triangleIndex.setSize(info.size());
849 const globalIndex& triIndexer = globalTris();
865 label proci = triIndexer.whichProcID(info[i].index());
874 sendMap[proci].setSize(nSend[proci]);
883 label proci = triIndexer.whichProcID(info[i].index());
884 triangleIndex[i] = triIndexer.toLocal(proci, info[i].index());
885 sendMap[proci][nSend[proci]++] = i;
889 triangleIndex[i] = -1;
898 mapPtr().distribute(triangleIndex);
904 bool Foam::distributedTriSurfaceMesh::contains
906 const List<treeBoundBox>& bbs,
912 if (bbs[bbi].contains(sample))
922 Foam::distributedTriSurfaceMesh::findBestProcs
925 const scalar radiusSqr,
936 procContains =
false;
939 procOverlaps =
false;
943 scalar minDistSqr = radiusSqr;
948 const List<treeBoundBox>& bbs = procBb_[proci];
952 if (bbs[bbi].contains(centre))
957 if (!procContains[proci])
959 procContains[proci] =
true;
964 bbs[bbi].calcExtremities(centre, near, far);
965 minDistSqr =
min(minDistSqr, centre.distSqr(far));
972 return Tuple2<label, scalar>(nContain, minDistSqr);
976 scalar maxDistSqr = radiusSqr;
983 const List<treeBoundBox>& bbs = procBb_[proci];
987 if (bbs[bbi].overlaps(centre, radiusSqr))
990 bbs[bbi].calcExtremities(centre, near, far);
992 scalar d2 = centre.distSqr(near);
996 maxDistSqr =
min(radiusSqr, centre.distSqr(far));
1008 procOverlaps[minProci] =
true;
1013 if (proci != minProci)
1015 const List<treeBoundBox>& bbs = procBb_[proci];
1018 if (bbs[bbi].overlaps(centre, maxDistSqr))
1020 procOverlaps[proci] =
true;
1028 return Tuple2<label, scalar>(nOverlap, maxDistSqr);
1033 Foam::label Foam::distributedTriSurfaceMesh::calcOverlappingProcs
1035 const point& centre,
1036 const scalar radiusSqr,
1041 label nOverlaps = 0;
1045 const List<treeBoundBox>& bbs = procBb_[proci];
1049 if (bbs[bbi].overlaps(centre, radiusSqr))
1051 overlaps[proci] =
true;
1065 Foam::distributedTriSurfaceMesh::calcLocalQueries
1067 const bool includeLocalProcessor,
1083 DynamicList<point> dynAllCentres(centres.size());
1084 DynamicList<scalar> dynAllRadiusSqr(centres.size());
1086 DynamicList<label> dynAllSegmentMap(centres.size());
1091 forAll(dynSendMap, proci)
1093 dynSendMap[proci].reserve
1107 calcOverlappingProcs
1114 forAll(procBbOverlaps, proci)
1118 procBbOverlaps[proci]
1120 includeLocalProcessor
1125 dynSendMap[proci].append(dynAllCentres.size());
1126 dynAllSegmentMap.append(centrei);
1127 dynAllCentres.append(centres[centrei]);
1128 dynAllRadiusSqr.append(radiusSqr[centrei]);
1137 sendMap[proci].transfer(dynSendMap[proci]);
1140 allCentres.transfer(dynAllCentres);
1141 allRadiusSqr.transfer(dynAllRadiusSqr);
1142 allSegmentMap.transfer(dynAllSegmentMap);
1151 const point& sample,
1152 const point& nearestPoint,
1157 const triSurface& surf =
static_cast<const triSurface&
>(*this);
1167 if (((sample - nearestPoint) &
n) > 0)
1178 Foam::label Foam::distributedTriSurfaceMesh::findOtherFace
1181 const label nearFacei,
1182 const label nearLabel
1185 const triSurface& surf =
static_cast<const triSurface&
>(*this);
1188 const edge
e(nearF[nearLabel], nearF[nearF.fcIndex(nearLabel)]);
1191 for (
const label facei :
pFaces)
1193 if (facei != nearFacei)
1195 if (surf[facei].contains(
e))
1205 void Foam::distributedTriSurfaceMesh::calcFaceFaces
1207 const triSurface&
s,
1212 faceFaces.setSize(
s.size());
1214 DynamicList<label> nbrs;
1218 const labelledTri&
f =
s[facei];
1220 nbrs.reserve(
f.
size());
1227 for (
const label otherFacei :
pFaces)
1229 if (otherFacei != facei)
1231 if (
s[otherFacei].contains(
e))
1233 if (!nbrs.find(otherFacei))
1235 nbrs.append(otherFacei);
1241 faceFaces[facei] = std::move(nbrs);
1246 void Foam::distributedTriSurfaceMesh::surfaceSide
1249 const List<pointIndexHit>& nearestInfo,
1250 List<volumeType>& volType
1255 Pout<<
"distributedTriSurfaceMesh::surfaceSide :" 1257 <<
" finding surface side given points on surface for " 1264 labelList triangleIndex(nearestInfo.size());
1265 autoPtr<mapDistribute> mapPtr
1273 const mapDistribute& map = mapPtr();
1277 map.distribute(localSamples);
1283 volType.setSize(triangleIndex.size());
1286 const triSurface& surf =
static_cast<const triSurface&
>(*this);
1295 EdgeMap<labelPair> edgeToFaces;
1299 const label facei = triangleIndex[i];
1301 const point& sample = localSamples[i];
1304 label nearType, nearLabel;
1306 f.nearestPointClassify(sample,
points, nearType, nearLabel);
1308 const point& nearestPoint(pHit.point());
1312 const vector sampleNearestVec = (sample - nearestPoint);
1316 scalar
c = sampleNearestVec & surf[facei].areaNormal(
points);
1334 label otherFacei = findOtherFace(pointFaces, facei, nearLabel);
1335 if (otherFacei != -1)
1338 edgeSide(sample, nearestPoint, facei, otherFacei);
1352 const label pointi =
f[nearLabel];
1354 const vector sampleNearestVec = (sample - nearestPoint);
1358 edgeToFaces.clear();
1360 scalar maxCosAngle = -GREAT;
1363 for (
const label facei :
pFaces)
1367 label fp =
f.
find(pointi);
1379 for (
const edge&
e : edges)
1381 auto iter = edgeToFaces.find(
e);
1384 if (iter().second() == -1)
1387 iter().second() = facei;
1390 scalar magEVec =
mag(eVec);
1392 if (magEVec > VSMALL)
1398 scalar cosAngle(sampleNearestVec&eVec);
1399 if (cosAngle > maxCosAngle)
1401 maxCosAngle = cosAngle;
1402 maxEdgeFaces = iter();
1422 for (
auto iter : edgeToFaces)
1424 if (iter[0] == -1 || iter[1] == -1)
1432 volType[i] = edgeSide
1468 map.constructHasFlip(),
1515 Pout<<
"distributedTriSurfaceMesh::surfaceSide :" 1517 <<
" given points on surface " 1524 void Foam::distributedTriSurfaceMesh::collectLeafMids
1527 DynamicField<point>& midPoints
1530 const auto& nod =
tree().nodes()[nodeI];
1532 for (
direction octant = 0; octant < nod.subNodes_.size(); octant++)
1534 const labelBits index = nod.subNodes_[octant];
1551 const treeBoundBox subBb = nod.bb_.subBbox(octant);
1552 midPoints.append(subBb.centre());
1560 const List<volumeType>& midPointTypes,
1562 PackedList<2>& nodeTypes,
1570 const auto& nod =
tree().nodes()[nodeI];
1574 for (
direction octant = 0; octant < nod.subNodes_.size(); octant++)
1578 const labelBits index = nod.subNodes_[octant];
1583 subType = calcVolumeType
1605 subType = midPointTypes[midPointi++];
1617 else if (subType != myType)
1632 const auto& nod =
tree().nodes()[nodeI];
1634 direction octant = nod.bb_.subOctant(sample);
1656 labelBits index = nod.subNodes_[octant];
1661 volumeType subType = cachedVolumeType
1679 <<
"Sample:" << sample <<
" node:" << nodeI
1680 <<
" with bb:" << nod.bb_ <<
nl 1681 <<
"Empty subnode has invalid volume type MIXED." 1690 <<
"Sample:" << sample <<
" at node:" << nodeI
1691 <<
" octant:" << octant
1692 <<
" with bb:" << nod.bb_.subBbox(octant) <<
nl 1693 <<
"Node has invalid volume type " << octantType
1708 Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
1716 "distributedTriSurfaceMesh::independentlyDistributedBbs" 1724 const auto* dictPtr =
1737 if (!decomposeParDict_)
1739 decomposeParDict_.reset
1761 List<List<treeBoundBox>> bbs
1767 const globalIndex& triIndexer = globalTris();
1774 if (triIndexer.localSize(proci) != 0)
1786 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1787 <<
" determining master-only decomposition for " <<
s.size()
1795 triCentres[trii] =
s[trii].centre(
s.points());
1799 if (!isA<geomDecomp>(decomposer_()))
1805 calcFaceFaces(
s, pointFaces, faceFaces);
1809 distribution = decomposer_().decompose(faceFaces, triCentres);
1815 distribution = decomposer_().decompose(triCentres);
1820 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1821 <<
" determining processor bounding boxes for surface" 1828 treeBoundBox& bb = bbs[distribution[trii]][0];
1829 bb.add(
s.points(),
s[trii]);
1836 for (
auto& bb : bbs[proci])
1838 bb.grow(mergeDist_);
1844 else if (distType_ == DISTRIBUTED)
1848 if (!decomposer_().parallelAware())
1851 <<
"The decomposition method " << decomposer_().typeName
1852 <<
" does not decompose in parallel." 1858 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1859 <<
" determining decomposition for " <<
s.size()
1868 triCentres[trii] =
s[trii].centre(
s.points());
1871 labelList distribution = decomposer_().decompose(triCentres);
1875 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 1876 <<
" determining processor bounding boxes for " 1883 treeBoundBox& bb = bbs[distribution[trii]][0];
1884 bb.add(
s.points(),
s[trii]);
1891 for (
auto& bb : bbs[proci])
1893 bb.grow(mergeDist_);
2102 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 2103 <<
" collecting all centroids for surface " 2112 allCentres[trii] =
s[trii].centre(
s.points());
2139 Pout<<
"distributedTriSurfaceMesh::" 2140 <<
"independentlyDistributedBbs :" 2142 <<
" merged " << allCentres.size()
2143 <<
" centroids down to " << nMerged <<
endl;
2148 UIndirectList<point>(mergedPoints, allToMerged) = allCentres;
2152 labelList mergedDist(decomposer_().decompose(mergedPoints));
2156 allDistribution = UIndirectList<label>
2164 globalTris().scatter
2173 Pout<<
"distributedTriSurfaceMesh::" 2174 <<
"independentlyDistributedBbs :" 2175 <<
" determined decomposition" <<
endl;
2182 Pout<<
"distributedTriSurfaceMesh::independentlyDistributedBbs :" 2183 <<
" determining processor bounding boxes for " 2189 treeBoundBox& bb = bbs[distribution[trii]][0];
2190 bb.add(
s.points(),
s[trii]);
2197 for (
auto& bb : bbs[proci])
2199 bb.grow(mergeDist_);
2210 bool Foam::distributedTriSurfaceMesh::overlaps
2212 const List<treeBoundBox>& bbs,
2216 treeBoundBox triBb(tri.a());
2220 for (
const treeBoundBox& bb : bbs)
2227 if (bb.overlaps(triBb) && bb.intersects(tri))
2236 void Foam::distributedTriSurfaceMesh::subsetMeshMap
2238 const triSurface&
s,
2240 const label nIncluded,
2246 newToOldFaces.setSize(nIncluded);
2247 newToOldPoints.setSize(
s.points().size());
2248 oldToNewPoints.setSize(
s.points().size());
2249 oldToNewPoints = -1;
2254 forAll(include, oldFacei)
2256 if (include[oldFacei])
2259 newToOldFaces[facei++] = oldFacei;
2262 for (
const label oldPointi :
s[oldFacei])
2264 if (oldToNewPoints[oldPointi] == -1)
2266 oldToNewPoints[oldPointi] = pointi;
2267 newToOldPoints[pointi++] = oldPointi;
2272 newToOldPoints.setSize(pointi);
2279 const triSurface&
s,
2287 forAll(newToOldPoints, i)
2289 newPoints[i] =
s.points()[newToOldPoints[i]];
2292 List<labelledTri> newTriangles(newToOldFaces.size());
2297 const labelledTri& tri =
s[newToOldFaces[i]];
2299 newTriangles[i][0] = oldToNewPoints[tri[0]];
2300 newTriangles[i][1] = oldToNewPoints[tri[1]];
2301 newTriangles[i][2] = oldToNewPoints[tri[2]];
2302 newTriangles[i].region() = tri.region();
2306 return triSurface(newTriangles,
s.patches(), newPoints,
true);
2312 const triSurface&
s,
2351 const triSurface&
s,
2358 ListOps::createWithValue<bool>(
s.size(), newToOldFaces,
true,
false)
2361 newToOldPoints.setSize(
s.points().size());
2362 labelList oldToNewPoints(
s.points().size(), -1);
2366 forAll(include, oldFacei)
2368 if (include[oldFacei])
2371 for (
const label oldPointi :
s[oldFacei])
2373 if (oldToNewPoints[oldPointi] == -1)
2375 oldToNewPoints[oldPointi] = pointi;
2376 newToOldPoints[pointi++] = oldPointi;
2381 newToOldPoints.setSize(pointi);
2394 Foam::label Foam::distributedTriSurfaceMesh::findTriangle
2396 const List<labelledTri>& allFaces,
2398 const labelledTri& otherF
2406 const labelledTri&
f = allFaces[
pFaces[i]];
2408 if (
f.region() == otherF.region())
2411 label fp0 =
f.
find(otherF[0]);
2416 if (
f[fp1] == otherF[1] &&
f[fp2] == otherF[2])
2427 void Foam::distributedTriSurfaceMesh::merge
2429 const scalar mergeDist,
2430 const List<labelledTri>& subTris,
2433 List<labelledTri>& allTris,
2456 label allPointi = nOldAllPoints;
2457 forAll(pointConstructMap, pointi)
2459 if (pointConstructMap[pointi] == -1)
2461 pointConstructMap[pointi] = allPointi++;
2465 if (allPointi > nOldAllPoints)
2469 forAll(pointConstructMap, pointi)
2471 if (pointConstructMap[pointi] >= nOldAllPoints)
2473 allPoints[pointConstructMap[pointi]] = subPoints[pointi];
2487 label allTrii = allTris.size();
2488 allTris.setSize(allTrii + subTris.size());
2490 faceConstructMap.setSize(subTris.size());
2494 const labelledTri& subTri = subTris[trii];
2497 labelledTri mappedTri
2499 pointConstructMap[subTri[0]],
2500 pointConstructMap[subTri[1]],
2501 pointConstructMap[subTri[2]],
2507 bool fullMatch =
true;
2511 if (mappedTri[fp] >= nOldAllPoints)
2522 label i = findTriangle
2532 faceConstructMap[trii] = allTrii;
2533 allTris[allTrii] = mappedTri;
2538 faceConstructMap[trii] = i;
2544 faceConstructMap[trii] = allTrii;
2545 allTris[allTrii] = mappedTri;
2549 allTris.setSize(allTrii);
2555 Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
2577 currentDistType_(FROZEN)
2601 Info<<
'\t' << proci <<
'\t' << nTris[proci]
2602 <<
'\t' << procBb_[proci] <<
endl;
2610 Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh(
const IOobject&
io)
2617 findLocalInstance(
io),
2640 currentDistType_(FROZEN)
2655 || actualFile !=
io.localFilePath(triSurfaceMesh::typeName)
2661 <<
"Read distributedTriSurface " <<
io.name()
2662 <<
" from parent path " << actualFile <<
endl;
2685 <<
"Read distributedTriSurface " <<
io.name()
2686 <<
" from actual path " << actualFile <<
':' <<
endl;
2698 Info<<
'\t' << proci <<
'\t' << nTris[proci]
2699 <<
'\t' << procBb_[proci] <<
endl;
2708 <<
"Read distributedTriSurface " <<
io.name() <<
':' <<
endl;
2714 Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
2725 findLocalInstance(
io),
2749 currentDistType_(FROZEN)
2765 dict.readIfPresent(
"mergeDistance", mergeDist_);
2769 if (
dict.readIfPresent<
bool>(
"closed", closed))
2776 "outsideVolumeType",
2793 || actualFile !=
io.localFilePath(triSurfaceMesh::typeName)
2799 <<
"Read distributedTriSurface " <<
io.name()
2800 <<
" from parent path " << actualFile
2801 <<
" and dictionary" <<
endl;
2824 <<
"Read distributedTriSurface " <<
io.name()
2825 <<
" from actual path " << actualFile
2826 <<
" and dictionary:" <<
endl;
2838 Info<<
'\t' << proci <<
'\t' << nTris[proci]
2839 <<
'\t' << procBb_[proci] <<
endl;
2848 <<
"Read distributedTriSurface " <<
io.name() <<
':' <<
endl;
2864 globalTris_.clear();
2877 return *globalTris_;
3121 "distributedTriSurfaceMesh::findNearest" 3126 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3128 <<
" trying to find nearest for " <<
samples.
size()
3129 <<
" samples with max sphere " 3159 forAll(dynSendMap, proci)
3166 label minProci = -1;
3176 label nContains = 0;
3179 if (procContains[proci])
3182 dynSendMap[proci].
append(samplei);
3183 distSqr[samplei] = best.
second();
3203 dynSendMap[minProci].
append(samplei);
3204 distSqr[samplei] = best.
second();
3212 sendMap[proci].
transfer(dynSendMap[proci]);
3231 <<
" outside\t" << nOutside <<
endl;
3244 convertTriIndices(localInfo);
3252 label nIgnoredHit = 0;
3278 ni.
second() = info.
point().distSqr(localPoints[i]);
3285 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3287 <<
" searched locally for " << localPoints.
size()
3288 <<
" samples with max sphere " 3290 <<
" found hits:" << nHit
3291 <<
" of which outside local bb:" << nIgnoredHit
3334 forAll(nearestInfo, samplei)
3360 calcOverlappingProcs(sample, d2, procBbOverlaps);
3362 forAll(procBbOverlaps, proci)
3364 if (procBbOverlaps[proci])
3370 if (proci != hitProci)
3372 dynSendMap[proci].
append(samplei);
3381 sendMap[proci].
transfer(dynSendMap[proci]);
3406 forAll(nearestInfo, samplei)
3409 if (ni.
first().hit())
3411 localDistSqr[samplei] = ni.
second();
3419 convertTriIndices(localInfo);
3424 label nIgnoredHit = 0;
3444 ni.
second() = info.
point().distSqr(localSamples[i]);
3451 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3453 <<
" searched locally for " << localSamples.
size()
3454 <<
" samples with max sphere " 3456 <<
" found hits:" << nHit
3457 <<
" of which outside local bb:" << nIgnoredHit
3485 info[samplei] = ni.
first();
3513 "distributedTriSurfaceMesh::findNearestRegion" 3518 Pout<<
"distributedTriSurfaceMesh::findNearest :" 3520 <<
" trying to find nearest and region for " <<
samples.
size()
3521 <<
" samples with max sphere " 3526 if (regionIndices.
empty())
3528 findNearest(
samples, nearestDistSqr, info);
3572 convertTriIndices(allInfo);
3576 if (allInfo[i].hit())
3589 allInfo[i].setMiss();
3590 allInfo[i].setIndex(-1);
3607 if (allInfo[i].hit())
3609 label pointi = allSegmentMap[i];
3611 if (!info[pointi].hit())
3614 info[pointi] = allInfo[i];
3625 info[pointi] = allInfo[i];
3634 void Foam::distributedTriSurfaceMesh::findLine
3697 Pout<<
"distributedTriSurfaceMesh::findLineAll :" 3699 <<
" intersecting with " 3700 << start.
size() <<
" rays" <<
endl;
3706 "distributedTriSurfaceMesh::findLineAll" 3736 + vector::uniform(ROOTVSMALL)
3748 if (hitInfo[pointi].hit())
3750 info[pointi].setSize(1);
3751 info[pointi][0] = hitInfo[pointi];
3753 point pt = hitInfo[pointi].point() + smallVec[pointi];
3755 if (((pt-start[pointi])&dirVec[pointi]) <= magSqrDirVec[pointi])
3758 e1[compacti] =
end[pointi];
3759 pointMap[compacti] = pointi;
3765 info[pointi].
clear();
3769 e0.setSize(compacti);
3770 e1.setSize(compacti);
3771 pointMap.setSize(compacti);
3790 if (hitInfo[i].hit())
3792 label pointi = pointMap[i];
3794 label sz = info[pointi].size();
3795 info[pointi].setSize(sz+1);
3796 info[pointi][sz] = hitInfo[i];
3798 point pt = hitInfo[i].point() + smallVec[pointi];
3801 scalar d = ((pt-start[pointi])&dirVec[pointi]);
3805 if (d > 0 && d <= magSqrDirVec[pointi])
3808 e1[compacti] =
end[pointi];
3809 pointMap[compacti] = pointi;
3816 e0.setSize(compacti);
3817 e1.setSize(compacti);
3818 pointMap.setSize(compacti);
3824 Pout<<
"distributedTriSurfaceMesh::findLineAll :" 3825 <<
" Exiting loop due to excessive number of" 3826 <<
" intersections along ray" 3837 Pout<<
"distributedTriSurfaceMesh::findLineAll :" 3839 <<
" finished intersecting with " 3840 << start.
size() <<
" rays" <<
endl;
3853 Pout<<
"distributedTriSurfaceMesh::getRegion :" 3855 <<
" getting region for " 3856 << info.
size() <<
" triangles" <<
endl;
3859 addProfiling(getRegion,
"distributedTriSurfaceMesh::getRegion");
3878 Pout<<
"distributedTriSurfaceMesh::getRegion :" 3880 <<
" finished getting region for " 3881 << info.
size() <<
" triangles" <<
endl;
3907 region.
setSize(triangleIndex.size());
3911 label trii = triangleIndex[i];
3912 region[i] =
s[trii].region();
3923 Pout<<
"distributedTriSurfaceMesh::getRegion :" 3925 <<
" finished getting region for " 3926 << info.
size() <<
" triangles" <<
endl;
3945 Pout<<
"distributedTriSurfaceMesh::getNormal :" 3947 <<
" getting normal for " 3948 << info.
size() <<
" triangles" <<
endl;
3951 addProfiling(getNormal,
"distributedTriSurfaceMesh::getNormal");
3974 normal.
setSize(triangleIndex.size());
3978 label trii = triangleIndex[i];
3979 normal[i] =
s[trii].unitNormal(
s.points());
3990 Pout<<
"distributedTriSurfaceMesh::getNormal :" 3992 <<
" finished getting normal for " 3993 << info.
size() <<
" triangles" <<
endl;
4080 if (!hasVolumeType())
4083 <<
"Volume type only supported for closed distributed surfaces." 4095 "distributedTriSurfaceMesh::getCachedVolumeType" 4099 const point outsidePt(bounds().
max() + 0.5*bounds().span());
4102 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4104 <<
" triggering outsidePoint" << outsidePt
4105 <<
" orientation" <<
endl;
4118 surfaceSide(outsidePts, nearestInfo, outsideVolTypes);
4129 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4131 <<
" determined outsidePoint" << outsidePt
4143 const auto& nodes = t.
nodes();
4152 collectLeafMids(0, midPoints);
4157 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4159 <<
" triggering orientation caching for " 4160 << midPoints.
size() <<
" leaf mids" <<
endl;
4177 surfaceSide(midPoints, nearestInfo, midVolTypes);
4194 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4196 <<
" done orientation caching for " 4197 << midPoints.
size() <<
" leaf mids" <<
endl;
4205 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4208 <<
" samples" <<
endl;
4214 "distributedTriSurfaceMesh::getVolumeType" 4233 if (contains(procBb_[proci],
samples[samplei]))
4246 outsideSamples.
append(samplei);
4262 if (contains(procBb_[proci],
samples[samplei]))
4264 sendMap[proci][nSend[proci]++] = samplei;
4287 if (
tree().nodes().size())
4289 volType[i] = cachedVolumeType(0, localPoints[i]);
4293 fullSearchMap.append(i);
4294 fullSearchPoints.append(localPoints[i]);
4300 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4303 <<
" resulting in local queries:" 4304 << localPoints.
size()
4305 <<
" of which cached:" << localPoints.
size()-fullSearchPoints.size()
4320 surfaceSide(fullSearchPoints, nearestInfo, fullSearchType);
4325 volType[fullSearchMap[i]] = fullSearchType[i];
4390 for (label samplei : outsideSamples)
4392 volType[samplei] = outsideVolType_;
4397 Pout<<
"distributedTriSurfaceMesh::getVolumeType :" 4399 <<
" finished finding orientation for " <<
samples.
size()
4400 <<
" samples" <<
endl;
4419 Pout<<
"distributedTriSurfaceMesh::getField :" 4421 <<
" retrieving field for " 4422 << info.
size() <<
" triangles" <<
endl;
4427 const auto* fldPtr = findObject<triSurfaceLabelField>(
"values");
4451 values.setSize(triangleIndex.size());
4455 label trii = triangleIndex[i];
4468 Pout<<
"distributedTriSurfaceMesh::getField :" 4470 <<
" finished retrieving field for " 4471 << info.
size() <<
" triangles" <<
endl;
4485 includedFace =
false;
4489 const scalar eps = 1.0e-4;
4492 const point mid = bbs[i].centre();
4493 const vector halfSpan = (1.0+eps)*(bbs[i].
max() - mid);
4495 bbsX[i].min() = mid - halfSpan;
4496 bbsX[i].max() = mid + halfSpan;
4505 if (overlaps(bbsX, tri))
4507 includedFace[trii] =
true;
4525 overlappingSurface(
s, bbs, includedFace);
4526 return subsetMesh(
s, includedFace, subPointMap, subFaceMap);
4558 label proci = triIndexer.
whichProcID(info[i].index());
4576 label proci = triIndexer.
whichProcID(info[i].index());
4577 triangleIndex[i] = triIndexer.
toLocal(proci, info[i].index());
4578 sendMap[proci][nSend[proci]++] = i;
4582 triangleIndex[i] = -1;
4591 mapPtr().distribute(triangleIndex);
4600 const bool keepNonLocal,
4612 Pout<<
"distributedTriSurfaceMesh::distribute :" 4614 <<
" distributing surface according to method:" 4615 << distributionTypeNames_[distType_]
4619 addProfiling(distribute,
"distributedTriSurfaceMesh::distribute");
4637 if (currentDistType_ == distType_)
4641 newProcBb = independentlyDistributedBbs(*
this);
4654 if (newProcBb == procBb_)
4660 procBb_.transfer(newProcBb);
4677 <<
"before distribution:" <<
endl <<
"\tproc\ttris" <<
endl;
4681 Info<<
'\t' << proci <<
'\t' << nTris[proci] <<
endl;
4700 pointSendMap[proci],
4714 forAll(faceSendMap, proci)
4718 forAll(faceSendMap[proci], i)
4720 includedFace[faceSendMap[proci][i]] =
false;
4769 allTris = subSurface;
4789 forAll(faceSendMap, proci)
4815 for (
const int proci : pBufs.
allProcs())
4833 faceConstructMap[proci],
4834 pointConstructMap[proci]
4845 std::move(faceSendMap),
4846 std::move(faceConstructMap)
4854 std::move(pointSendMap),
4855 std::move(pointConstructMap)
4868 currentDistType_ = distType_;
4873 distributeFields<label>(
faceMap());
4874 distributeFields<scalar>(
faceMap());
4875 distributeFields<vector>(
faceMap());
4876 distributeFields<sphericalTensor>(
faceMap());
4877 distributeFields<symmTensor>(
faceMap());
4878 distributeFields<tensor>(
faceMap());
4890 <<
"after distribution:" <<
endl <<
"\tproc\ttris" <<
endl;
4894 Info<<
'\t' << proci <<
'\t' << nTris[proci] <<
endl;
4906 Info<<
"Writing local bounding box to " << str.
name() <<
endl;
4910 str.
write(bb,
true);
4921 Info<<
"Writing all bounding boxes to " << str.
name() <<
endl;
4922 for (
const auto& myBbs : procBb_)
4926 str.
write(bb,
true);
4934 Pout<<
"distributedTriSurfaceMesh::distribute :" 4936 <<
" done distributing surface according to method:" 4937 << distributionTypeNames_[distType_]
4946 const bool writeOnProc
4951 Pout<<
"distributedTriSurfaceMesh::writeObject :" 4953 <<
" writing surface:" << writeOnProc <<
endl;
4981 bool ok = dict_.writeObject(streamOpt,
true);
4985 Pout<<
"distributedTriSurfaceMesh::writeObject :" 4987 <<
" done writing surface" <<
endl;
5004 <<
"Bounding Box : " << bb <<
endl 5005 <<
"Closed : " << surfaceClosed_ <<
endl 5007 <<
"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 void listCombineGather(UList< T > &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Combines List elements.
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)
#define addProfiling(Name,...)
Define profiling trigger with specified name and description string. The description is generated by ...
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 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 subHasFlip() const noexcept
Does subMap include a sign.
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 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.
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 void allGatherList(UList< T > &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, but keep individual values separate. Uses MPI_Allgather or manual linear/tree communicat...
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" (immediate) : (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 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.
static const List< T > & null() noexcept
Return a null List (reference to a nullObject). Behaves like an empty List.
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)