55 { pointStatus::CONVEX,
"convex" },
56 { pointStatus::CONCAVE,
"concave" },
57 { pointStatus::MIXED,
"mixed" },
58 { pointStatus::NONFEATURE,
"nonFeature" },
68 { edgeStatus::EXTERNAL,
"external" },
69 { edgeStatus::INTERNAL,
"internal" },
70 { edgeStatus::FLAT,
"flat" },
71 { edgeStatus::OPEN,
"open" },
72 { edgeStatus::MULTIPLE,
"multiple" },
73 { edgeStatus::NONE,
"none" },
83 { sideVolumeType::INSIDE,
"inside" },
84 { sideVolumeType::OUTSIDE,
"outside" },
85 { sideVolumeType::BOTH,
"both" },
86 { sideVolumeType::NEITHER,
"neither" },
103 return wordHashSet(*fileExtensionConstructorTablePtr_);
109 return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
115 return edgeMeshFormatsCore::checkSupport
127 return edgeMeshFormatsCore::checkSupport
144 return canReadType(ext, verbose);
156 const labelList& ptEds(pointEdges()[ptI]);
158 label nPtEds = ptEds.
size();
172 if (edStat == EXTERNAL)
176 else if (edStat == INTERNAL)
182 if (nExternal == nPtEds)
186 else if (nInternal == nPtEds)
206 const edgeList& edges = this->edges();
216 const edge&
e = edges[edgeI];
227 nHits += edgeHits[edgeI].
size();
253 label prevPtI = edges[edgeI][0];
256 label newPtI = newPoints.
size();
258 newPoints.
append(eHits[eHitI].hitPoint());
259 newToOldPoint.
append(edges[edgeI][0]);
260 dynPointsFromEdge.
append(newPtI);
262 dynSurfTri.
append(eHits[eHitI].index());
266 newEdges[edgeI] =
edge(prevPtI, newPtI);
271 newToOldEdge.
append(edgeI);
275 newEdges.
append(
edge(prevPtI, edges[edgeI][1]));
276 newToOldEdge.
append(edgeI);
281 allPoints.transfer(newPoints);
288 pointsFromEdge.
transfer(dynPointsFromEdge);
293 autoMap(allPoints, allEdges, pointMap, edgeMap);
305 const edgeList& edges = this->edges();
312 forAll(edgeCentres, edgeI)
314 const edge&
e = edges[edgeI];
315 edgeCentres[edgeI] =
e.centre(
points);
322 label compactEdgeI = 0;
326 if (volTypes[edgeI] == volType)
328 edgeMap[compactEdgeI++] = edgeI;
337 const edge&
e = edges[edgeMap[i]];
343 label compactPointI = 0;
344 forAll(pointToCompact, pointI)
346 if (pointToCompact[pointI] != -1)
348 pointToCompact[pointI] = compactPointI;
349 pointMap[compactPointI++] = pointI;
352 pointMap.
setSize(compactPointI);
359 const edge&
e = edges[edgeMap[i]];
360 subEdges[i][0] = pointToCompact[
e[0]];
361 subEdges[i][1] = pointToCompact[
e[1]];
365 autoMap(subPoints, subEdges, pointMap, edgeMap);
388 normalVolumeTypes_(0),
390 normalDirections_(0),
392 featurePointNormals_(0),
393 featurePointEdges_(0),
406 nonFeatureStart_(-1),
412 normalVolumeTypes_(0),
414 normalDirections_(0),
416 featurePointNormals_(0),
417 featurePointEdges_(0),
428 concaveStart_(fem.concaveStart()),
429 mixedStart_(fem.mixedStart()),
430 nonFeatureStart_(fem.nonFeatureStart()),
431 internalStart_(fem.internalStart()),
432 flatStart_(fem.flatStart()),
433 openStart_(fem.openStart()),
434 multipleStart_(fem.multipleStart()),
435 normals_(fem.normals()),
436 normalVolumeTypes_(fem.normalVolumeTypes()),
437 edgeDirections_(fem.edgeDirections()),
438 normalDirections_(fem.normalDirections()),
439 edgeNormals_(fem.edgeNormals()),
440 featurePointNormals_(fem.featurePointNormals()),
441 featurePointEdges_(fem.featurePointEdges()),
442 regionEdges_(fem.regionEdges()),
516 label sFEI = featureEdges[i];
519 const labelList& eFaces = edgeFaces[sFEI];
523 label eFI = eFaces[j];
530 surfBaffleRegions[surf[eFI].region()]
568 label nonFeatureStart,
584 concaveStart_(concaveStart),
585 mixedStart_(mixedStart),
586 nonFeatureStart_(nonFeatureStart),
587 internalStart_(internalStart),
588 flatStart_(flatStart),
589 openStart_(openStart),
590 multipleStart_(multipleStart),
592 normalVolumeTypes_(normalVolumeTypes),
593 edgeDirections_(edgeDirections),
594 normalDirections_(normalDirections),
595 edgeNormals_(edgeNormals),
596 featurePointNormals_(featurePointNormals),
597 featurePointEdges_(featurePointEdges),
598 regionEdges_(regionEdges),
633 return read(unzipName, unzipName.
ext());
647 transfer(*
New(
name, fileType));
655 scalar searchDistSqr,
659 info = pointTree().findNearest
670 scalar searchDistSqr,
674 info = edgeTree().findNearest
716 sliceStarts[0] = externalStart_;
717 sliceStarts[1] = internalStart_;
718 sliceStarts[2] = flatStart_;
719 sliceStarts[3] = openStart_;
720 sliceStarts[4] = multipleStart_;
724 info[i] = edgeTrees[i].findNearest
734 info[i].setIndex(info[i].index() + sliceStarts[i]);
742 scalar searchRadiusSqr,
757 label index = elems[elemI];
758 label ptI = pointTree().shapes().pointLabels()[index];
763 dynPointHit.
append(nearHit);
773 const scalar searchRadiusSqr,
783 sliceStarts[0] = externalStart_;
784 sliceStarts[1] = internalStart_;
785 sliceStarts[2] = flatStart_;
786 sliceStarts[3] = openStart_;
787 sliceStarts[4] = multipleStart_;
795 labelList elems = edgeTrees[i].findSphere
803 label index = elems[elemI];
804 label edgeI = edgeTrees[i].shapes().edgeLabels()[index];
805 const edge&
e = edges()[edgeI];
809 label hitIndex = index + sliceStarts[i];
818 dynEdgeHit.
append(nearHit);
911 if (edgeTreesByType_.empty())
929 identity((internalStart_ - externalStart_), externalStart_);
932 sliceEdges[1] =
identity((flatStart_ - internalStart_), internalStart_);
935 sliceEdges[2] =
identity((openStart_ - flatStart_), flatStart_);
938 sliceEdges[3] =
identity((multipleStart_ - openStart_), openStart_);
942 identity((edges().size() - multipleStart_), multipleStart_);
945 edgeTreesByType_.resize(nEdgeTypes);
947 forAll(edgeTreesByType_, i)
970 return edgeTreesByType_;
983 concaveStart_ =
mesh.concaveStart_;
984 mixedStart_ =
mesh.mixedStart_;
985 nonFeatureStart_ =
mesh.nonFeatureStart_;
986 internalStart_ =
mesh.internalStart_;
987 flatStart_ =
mesh.flatStart_;
988 openStart_ =
mesh.openStart_;
989 multipleStart_ =
mesh.multipleStart_;
991 normalVolumeTypes_.transfer(
mesh.normalVolumeTypes_);
992 edgeDirections_.transfer(
mesh.edgeDirections_);
993 normalDirections_.transfer(
mesh.normalDirections_);
994 edgeNormals_.transfer(
mesh.edgeNormals_);
995 featurePointNormals_.transfer(
mesh.featurePointNormals_);
996 featurePointEdges_.transfer(
mesh.featurePointEdges_);
997 regionEdges_.transfer(
mesh.regionEdges_);
998 pointTree_ = std::move(
mesh.pointTree_);
999 edgeTree_ = std::move(
mesh.edgeTree_);
1000 edgeTreesByType_.transfer(
mesh.edgeTreesByType_);
1011 nonFeatureStart_ = 0;
1017 normalVolumeTypes_.clear();
1018 edgeDirections_.clear();
1019 normalDirections_.clear();
1020 edgeNormals_.clear();
1021 featurePointNormals_.clear();
1022 featurePointEdges_.clear();
1023 regionEdges_.clear();
1024 pointTree_.reset(
nullptr);
1025 edgeTree_.reset(
nullptr);
1026 edgeTreesByType_.clear();
1040 for (label i = 0; i < concaveStart(); i++)
1051 for (label i = concaveStart(); i < mixedStart(); i++)
1062 for (label i = mixedStart(); i < nonFeatureStart(); i++)
1073 for (label i = nonFeatureStart(); i <
points().
size(); i++)
1084 newPoints.
rmap(fem.
points(), reverseFemPointMap);
1091 labelList reverseEdgeMap(edges().size());
1096 for (label i = 0; i < internalStart(); i++)
1098 reverseEdgeMap[i] = newEdgeI++;
1102 reverseFemEdgeMap[i] = newEdgeI++;
1106 label newInternalStart = newEdgeI;
1107 for (label i = internalStart(); i < flatStart(); i++)
1109 reverseEdgeMap[i] = newEdgeI++;
1113 reverseFemEdgeMap[i] = newEdgeI++;
1117 label newFlatStart = newEdgeI;
1118 for (label i = flatStart(); i < openStart(); i++)
1120 reverseEdgeMap[i] = newEdgeI++;
1124 reverseFemEdgeMap[i] = newEdgeI++;
1128 label newOpenStart = newEdgeI;
1129 for (label i = openStart(); i < multipleStart(); i++)
1131 reverseEdgeMap[i] = newEdgeI++;
1135 reverseFemEdgeMap[i] = newEdgeI++;
1139 label newMultipleStart = newEdgeI;
1140 for (label i = multipleStart(); i < edges().size(); i++)
1142 reverseEdgeMap[i] = newEdgeI++;
1146 reverseFemEdgeMap[i] = newEdgeI++;
1152 const edge&
e = edges()[i];
1153 newEdges[reverseEdgeMap[i]] =
edge
1155 reversePointMap[
e[0]],
1156 reversePointMap[
e[1]]
1162 newEdges[reverseFemEdgeMap[i]] =
edge
1164 reverseFemPointMap[
e[0]],
1165 reverseFemPointMap[
e[1]]
1171 edgeDirections().size()
1174 newEdgeDirections.
rmap(edgeDirections(), reverseEdgeMap);
1187 newNormals.
append(normals());
1194 edgeNormals().size()
1211 const label mapI = reverseFemEdgeMap[i];
1215 en[j] += normals().
size();
1223 featurePointNormals().size()
1230 newFeaturePointNormals,
1232 ) = featurePointNormals();
1235 newFeaturePointNormals,
1241 const label mapI = reverseFemPointMap[i];
1242 labelList& fn = newFeaturePointNormals[mapI];
1245 fn[j] += normals().
size();
1253 regionEdges().size()
1258 newRegionEdges.
append(reverseEdgeMap[regionEdges()[i]]);
1270 concaveStart_ = newConcaveStart;
1271 mixedStart_ = newMixedStart;
1272 nonFeatureStart_ = newNonFeatureStart;
1276 edgeMesh newmesh(std::move(newPoints), std::move(newEdges));
1281 internalStart_ = newInternalStart;
1282 flatStart_ = newFlatStart;
1283 openStart_ = newOpenStart;
1284 multipleStart_ = newMultipleStart;
1286 edgeDirections_.transfer(newEdgeDirections);
1288 normals_.transfer(newNormals);
1289 edgeNormals_.transfer(newEdgeNormals);
1290 featurePointNormals_.transfer(newFeaturePointNormals);
1292 regionEdges_.transfer(newRegionEdges);
1294 pointTree_.reset(
nullptr);
1295 edgeTree_.reset(
nullptr);
1296 edgeTreesByType_.clear();
1312 for (label i = concaveStart(); i < mixedStart(); i++)
1318 for (label i = 0; i < concaveStart(); i++)
1334 for (label i = internalStart(); i < flatStart(); i++)
1336 reverseEdgeMap[i] = newEdgeI++;
1339 label newInternalStart = newEdgeI;
1340 for (label i = 0; i < internalStart(); i++)
1342 reverseEdgeMap[i] = newEdgeI++;
1352 const edge&
e = edges()[i];
1353 newEdges[reverseEdgeMap[i]] =
edge
1355 reversePointMap[
e[0]],
1356 reversePointMap[
e[1]]
1364 pointField newEdgeDirections(edges().size());
1365 newEdgeDirections.
rmap(-1.0*edgeDirections(), reverseEdgeMap);
1372 labelListList newFeaturePointNormals(featurePointNormals().size());
1377 newFeaturePointNormals,
1379 ) = featurePointNormals();
1381 labelList newRegionEdges(regionEdges().size());
1384 newRegionEdges[i] = reverseEdgeMap[regionEdges()[i]];
1388 concaveStart_ = newConcaveStart;
1392 edgeMesh newmesh(std::move(newPoints), std::move(newEdges));
1397 internalStart_ = newInternalStart;
1399 edgeDirections_.transfer(newEdgeDirections);
1400 normals_.transfer(newNormals);
1401 edgeNormals_.transfer(newEdgeNormals);
1402 featurePointNormals_.transfer(newFeaturePointNormals);
1403 regionEdges_.transfer(newRegionEdges);
1405 pointTree_.reset(
nullptr);
1406 edgeTree_.reset(
nullptr);
1407 edgeTreesByType_.clear();
1420 label subIntStart = edgeMap.
size();
1421 label subFlatStart = edgeMap.
size();
1422 label subOpenStart = edgeMap.
size();
1423 label subMultipleStart = edgeMap.
size();
1425 forAll(edgeMap, subEdgeI)
1427 label edgeI = edgeMap[subEdgeI];
1428 if (edgeI >= internalStart() && subIntStart == edgeMap.
size())
1430 subIntStart = subEdgeI;
1432 if (edgeI >= flatStart() && subFlatStart == edgeMap.
size())
1434 subFlatStart = subEdgeI;
1436 if (edgeI >= openStart() && subOpenStart == edgeMap.
size())
1438 subOpenStart = subEdgeI;
1440 if (edgeI >= multipleStart() && subMultipleStart == edgeMap.
size())
1442 subMultipleStart = subEdgeI;
1449 label subConcaveStart = pointMap.
size();
1450 label subMixedStart = pointMap.
size();
1451 label subNonFeatStart = pointMap.
size();
1453 forAll(pointMap, subPointI)
1455 label pointI = pointMap[subPointI];
1456 if (pointI >= concaveStart() && subConcaveStart == pointMap.
size())
1458 subConcaveStart = subPointI;
1460 if (pointI >= mixedStart() && subMixedStart == pointMap.
size())
1462 subMixedStart = subPointI;
1466 pointI >= nonFeatureStart()
1467 && subNonFeatStart == pointMap.
size()
1470 subNonFeatStart = subPointI;
1479 bitSet isRegionEdge(edges().size(), regionEdges());
1482 forAll(edgeMap, subEdgeI)
1484 if (isRegionEdge.
test(edgeMap[subEdgeI]))
1486 newRegionEdges.
append(subEdgeI);
1489 subRegionEdges.
transfer(newRegionEdges);
1494 if (featurePointEdges().size())
1496 subFeaturePointEdges.
setSize(subNonFeatStart);
1497 for (label subPointI = 0; subPointI < subNonFeatStart; subPointI++)
1499 label pointI = pointMap[subPointI];
1500 const labelList& pEdges = featurePointEdges()[pointI];
1502 labelList& subPEdges = subFeaturePointEdges[subPointI];
1509 subPEdges[i] = edgeMap[pEdges[i]];
1516 vectorField subEdgeDirections(edgeDirections(), edgeMap);
1519 labelList reverseNormalMap(normals().size(), -1);
1523 bitSet isSubNormal(normals().size());
1524 for (label subPointI = 0; subPointI < subNonFeatStart; subPointI++)
1526 label pointI = pointMap[subPointI];
1527 const labelList& pNormals = featurePointNormals()[pointI];
1529 isSubNormal.
set(pNormals);
1531 forAll(edgeMap, subEdgeI)
1533 label edgeI = edgeMap[subEdgeI];
1534 const labelList& eNormals = edgeNormals()[edgeI];
1536 isSubNormal.
set(eNormals);
1539 forAll(isSubNormal, normalI)
1541 if (isSubNormal.
test(normalI))
1543 label subNormalI = normalMap.
size();
1544 reverseNormalMap[normalI] = subNormalI;
1545 normalMap.
append(subNormalI);
1554 if (normalDirections().size())
1558 forAll(edgeMap, subEdgeI)
1560 label edgeI = edgeMap[subEdgeI];
1561 const labelList& eNormals = normalDirections()[edgeI];
1563 labelList& subNormals = subNormalDirections[subEdgeI];
1567 if (eNormals[i] >= 0)
1569 subNormals[i] = reverseNormalMap[eNormals[i]];
1580 forAll(edgeMap, subEdgeI)
1582 label edgeI = edgeMap[subEdgeI];
1583 const labelList& eNormals = edgeNormals()[edgeI];
1584 labelList& subNormals = subEdgeNormals[subEdgeI];
1590 for (label subPointI = 0; subPointI < subNonFeatStart; subPointI++)
1592 label pointI = pointMap[subPointI];
1593 const labelList& pNormals = featurePointNormals()[pointI];
1594 labelList& subNormals = subPointNormals[subPointI];
1603 if (normalVolumeTypes().size())
1605 subNormalVolumeTypes =
1608 normalVolumeTypes(),
1631 subNormalVolumeTypes,
1637 subNormalDirections,
1643 subFeaturePointEdges,
1683 select(surf, volType, subPointMap, subEdgeMap);
1694 edgeStat[edgeI] = getEdgeStatus(edgeI);
1696 forAll(pointStat, pointI)
1698 pointStat[pointI] = getPointStatus(pointI);
1702 labelList oldPointToIndex(nOldPoints, -1);
1703 forAll(pointsFromEdge, i)
1705 oldPointToIndex[pointsFromEdge[i]] = i;
1707 forAll(subPointMap, pointI)
1709 label oldPointI = subPointMap[pointI];
1710 label index = oldPointToIndex[oldPointI];
1713 pointStat[pointI] = classifyFeaturePoint(pointI);
1724 sortedToOriginalPoint,
1725 sortedToOriginalEdge
1729 pointMap =
labelUIndList(pointMap, sortedToOriginalPoint)();
1743 label pointConcaveStart;
1744 label pointMixedStart;
1745 label pointNonFeatStart;
1747 label edgeInternalStart;
1748 label edgeFlatStart;
1749 label edgeOpenStart;
1750 label edgeMultipleStart;
1755 sortedToOriginalPoint,
1756 sortedToOriginalEdge,
1771 forAll(sortedToOriginalPoint, sortedI)
1773 reversePointMap[sortedToOriginalPoint[sortedI]] = sortedI;
1777 forAll(sortedEdges, sortedI)
1787 sortedToOriginalPoint,
1788 sortedToOriginalEdge
1792 concaveStart_ = pointConcaveStart;
1793 mixedStart_ = pointMixedStart;
1794 nonFeatureStart_ = pointNonFeatStart;
1795 internalStart_ = edgeInternalStart;
1796 flatStart_ = edgeFlatStart;
1797 openStart_ = edgeOpenStart;
1798 multipleStart_ = edgeMultipleStart;
1804 const scalar mergeDist,
1823 forAll(oldToMerged, oldI)
1825 label newI = oldToMerged[oldI];
1826 if (pointMap[newI] == -1)
1828 pointMap[newI] = oldI;
1836 const edge& oldE = edges()[edgeI];
1837 newEdges[edgeI] =
edge(oldToMerged[oldE[0]], oldToMerged[oldE[1]]);
1853 edgeStat[edgeI] = getEdgeStatus(edgeI);
1857 forAll(pointStat, pointI)
1859 pointStat[pointI] = getPointStatus(pointI);
1864 forAll(oldToMerged, oldPointI)
1866 nPoints[oldToMerged[oldPointI]]++;
1873 pointStat[pointI] = classifyFeaturePoint(pointI);
1882 sortedToOriginalPoint,
1885 pointMap =
labelUIndList(pointMap, sortedToOriginalPoint)();
1887 return nNewPoints != nOldPoints;
1893 Info<<
nl <<
"Writing extendedEdgeMesh components to " << prefix
1899 OBJstream convexFtPtStr(prefix +
"_convexFeaturePts.obj");
1900 Info<<
"Writing " << concaveStart_
1901 <<
" convex feature points to " << convexFtPtStr.
name() <<
endl;
1903 for(label i = 0; i < concaveStart_; i++)
1910 OBJstream concaveFtPtStr(prefix +
"_concaveFeaturePts.obj");
1911 Info<<
"Writing " << mixedStart_-concaveStart_
1912 <<
" concave feature points to "
1915 for(label i = concaveStart_; i < mixedStart_; i++)
1922 OBJstream mixedFtPtStr(prefix +
"_mixedFeaturePts.obj");
1923 Info<<
"Writing " << nonFeatureStart_-mixedStart_
1924 <<
" mixed feature points to " << mixedFtPtStr.
name() <<
endl;
1926 for(label i = mixedStart_; i < nonFeatureStart_; i++)
1933 OBJstream mixedFtPtStructureStr(prefix+
"_mixedFeaturePtsStructure.obj");
1935 << nonFeatureStart_-mixedStart_
1936 <<
" mixed feature point structure to "
1937 << mixedFtPtStructureStr.
name() <<
endl;
1939 for(label i = mixedStart_; i < nonFeatureStart_; i++)
1941 const labelList& ptEds = pointEdges()[i];
1945 const edge&
e = edges()[ptEds[j]];
1946 mixedFtPtStructureStr.
write
1956 OBJstream externalStr(prefix +
"_externalEdges.obj");
1957 Info<<
"Writing " << internalStart_-externalStart_
1958 <<
" external edges to " << externalStr.
name() <<
endl;
1960 for (label i = externalStart_; i < internalStart_; i++)
1962 const edge&
e = edges()[i];
1968 OBJstream internalStr(prefix +
"_internalEdges.obj");
1969 Info<<
"Writing " << flatStart_-internalStart_
1970 <<
" internal edges to " << internalStr.
name() <<
endl;
1972 for (label i = internalStart_; i < flatStart_; i++)
1974 const edge&
e = edges()[i];
1980 OBJstream flatStr(prefix +
"_flatEdges.obj");
1981 Info<<
"Writing " << openStart_-flatStart_
1982 <<
" flat edges to " << flatStr.
name() <<
endl;
1984 for (label i = flatStart_; i < openStart_; i++)
1986 const edge&
e = edges()[i];
1992 OBJstream openStr(prefix +
"_openEdges.obj");
1993 Info<<
"Writing " << multipleStart_-openStart_
1994 <<
" open edges to " << openStr.
name() <<
endl;
1996 for (label i = openStart_; i < multipleStart_; i++)
1998 const edge&
e = edges()[i];
2004 OBJstream multipleStr(prefix +
"_multipleEdges.obj");
2005 Info<<
"Writing " << edges().size()-multipleStart_
2006 <<
" multiple edges to " << multipleStr.
name() <<
endl;
2008 for (label i = multipleStart_; i < edges().size(); i++)
2010 const edge&
e = edges()[i];
2016 OBJstream regionStr(prefix +
"_regionEdges.obj");
2017 Info<<
"Writing " << regionEdges_.size()
2018 <<
" region edges to " << regionStr.
name() <<
endl;
2022 const edge&
e = edges()[regionEdges_[i]];
2028 OBJstream edgeDirsStr(prefix +
"_edgeDirections.obj");
2029 Info<<
"Writing " << edgeDirections_.size()
2030 <<
" edge directions to " << edgeDirsStr.
name() <<
endl;
2032 forAll(edgeDirections_, i)
2034 const vector& eVec = edgeDirections_[i];
2035 const edge&
e = edges()[i];
2050 os <<
indent <<
"point classification :" <<
nl;
2052 os <<
indent <<
"convex feature points : "
2053 <<
setw(8) << concaveStart_-convexStart_
2056 os <<
indent <<
"concave feature points : "
2057 <<
setw(8) << mixedStart_-concaveStart_
2060 os <<
indent <<
"mixed feature points : "
2061 <<
setw(8) << nonFeatureStart_-mixedStart_
2064 os <<
indent <<
"other (non-feature) points : "
2070 os <<
indent <<
"edge classification :" <<
nl;
2072 os <<
indent <<
"external (convex angle) edges : "
2073 <<
setw(8) << internalStart_-externalStart_
2076 os <<
indent <<
"internal (concave angle) edges : "
2077 <<
setw(8) << flatStart_-internalStart_
2080 os <<
indent <<
"flat region edges : "
2081 <<
setw(8) << openStart_-flatStart_
2085 <<
setw(8) << multipleStart_-openStart_
2088 os <<
indent <<
"multiply connected edges : "
2089 <<
setw(8) << edges().size()-multipleStart_
2104 label nEdNorms = edNorms.
size();
2110 else if (nEdNorms == 2)
2112 const vector& n0(norms[edNorms[0]]);
2113 const vector& n1(norms[edNorms[1]]);
2115 if ((n0 & n1) > cosNormalAngleTol_)
2119 else if ((fC0tofC1 & n0) > 0.0)
2128 else if (nEdNorms > 2)
2145 label& pointConcaveStart,
2146 label& pointMixedStart,
2147 label& pointNonFeatStart,
2149 label& edgeInternalStart,
2150 label& edgeFlatStart,
2151 label& edgeOpenStart,
2152 label& edgeMultipleStart
2156 sortedToOriginalPoint = -1;
2159 sortedToOriginalEdge = -1;
2170 forAll(pointStat, pointI)
2172 switch (pointStat[pointI])
2197 label convexStart = 0;
2198 label concaveStart = nConvex;
2199 label mixedStart = concaveStart+nConcave;
2200 label nonFeatStart = mixedStart+nMixed;
2204 pointConcaveStart = concaveStart;
2205 pointMixedStart = mixedStart;
2206 pointNonFeatStart = nonFeatStart;
2208 forAll(pointStat, pointI)
2210 switch (pointStat[pointI])
2213 sortedToOriginalPoint[convexStart++] = pointI;
2217 sortedToOriginalPoint[concaveStart++] = pointI;
2221 sortedToOriginalPoint[mixedStart++] = pointI;
2225 sortedToOriginalPoint[nonFeatStart++] = pointI;
2234 label nExternal = 0;
2235 label nInternal = 0;
2238 label nMultiple = 0;
2242 switch (edgeStat[edgeI])
2272 label externalStart = 0;
2273 label internalStart = nExternal;
2274 label flatStart = internalStart + nInternal;
2275 label openStart = flatStart + nFlat;
2276 label multipleStart = openStart + nOpen;
2280 edgeInternalStart = internalStart;
2281 edgeFlatStart = flatStart;
2282 edgeOpenStart = openStart;
2283 edgeMultipleStart = multipleStart;
2287 switch (edgeStat[edgeI])
2290 sortedToOriginalEdge[externalStart++] = edgeI;
2294 sortedToOriginalEdge[internalStart++] = edgeI;
2298 sortedToOriginalEdge[flatStart++] = edgeI;
2302 sortedToOriginalEdge[openStart++] = edgeI;
2306 sortedToOriginalEdge[multipleStart++] = edgeI;
2343 os << static_cast<label>(vt);
2352 os <<
"// points" <<
nl
2356 <<
"// concaveStart mixedStart nonFeatureStart" <<
nl
2360 <<
"// internalStart flatStart openStart multipleStart" <<
nl
2365 <<
"// normals" <<
nl
2367 <<
"// normal volume types" <<
nl
2369 <<
"// normalDirections" <<
nl
2371 <<
"// edgeNormals" <<
nl
2373 <<
"// featurePointNormals" <<
nl
2375 <<
"// featurePointEdges" <<
nl
2377 <<
"// regionEdges" <<
nl
Istream and Ostream manipulators taking arguments.
void append(const T &val)
Append an element at the end of the list.
label capacity() const noexcept
Size of the underlying storage.
void setCapacity(const label len)
Alter the size of the underlying storage.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
label capacity() const noexcept
Size of the underlying storage.
void setCapacity(const label len)
Alter the size of the underlying storage.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
void rmap(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 reverse-map from the given field
Minimal example by using system/controlDict.functions:
void transfer(HashTable< T, Key, Hash > &rhs)
Transfer contents into this table.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void transfer(List< T > &list)
void setSize(const label n)
Alias for resize()
OFstream that keeps track of vertices.
virtual Ostream & write(const char c)
Write character.
virtual const fileName & name() const
Read/write access to the name of the stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Describes the interaction of a face and a point. It carries the info of a successful hit and (if succ...
const point_type & rawPoint() const noexcept
The point, no checks.
bool hit() const noexcept
Is there a hit.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
A list of faces which address into the list of points.
const labelListList & edgeFaces() const
Return edge-face addressing.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
virtual bool read()
Re-read model coefficients if they have changed.
A List obtained as a section of another List.
A List with indirect addressing. Like IndirectList but does not store addressing.
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of elements in the list.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void set(const bitSet &bitset)
Set specified bits from another bitset.
bool test(const label pos) const
Test value at specified position, never auto-vivify entries.
const point & min() const
Minimum describing the bounding box.
const point & max() const
Maximum describing the bounding box.
Mesh data needed to do the Finite Area discretisation.
pointField & storedPoints() noexcept
Non-const access to global points.
const pointField & points() const noexcept
Return points.
const edgeList & edges() const noexcept
Return edges.
virtual void writeStats(Ostream &) const
edgeList & storedEdges() noexcept
Non-const access to the edges.
virtual void clear()
Clear all storage.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void trim()
Inplace trim leading and trailing whitespace.
Description of feature edges and points.
labelList regionEdges_
Feature edges which are on the boundary between regions.
extendedEdgeMesh()
Default construct.
labelListList edgeNormals_
Indices of the normals that are adjacent to the feature edges.
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format type?
void setFromStatus(const List< extendedEdgeMesh::pointStatus > &pointStat, const List< extendedEdgeMesh::edgeStatus > &edgeStat, labelList &sortedToOriginalPoint, labelList &sortedToOriginalEdge)
Order according to point and edge status.
const indexedOctree< treeDataEdge > & edgeTree() const
Demand driven construction of octree for boundary edges.
label openStart() const
Return the index of the start of the open feature edges.
void allNearestFeaturePoints(const point &sample, scalar searchRadiusSqr, List< pointIndexHit > &info) const
Find all the feature points within searchDistSqr of sample.
label nonFeatureStart() const
Return the index of the start of the non-feature points.
const vectorField & edgeDirections() const
Return the edgeDirection vectors.
static wordHashSet writeTypes()
Summary of supported write file types.
void sortPointsAndEdges(const Patch &, const labelUList &featureEdges, const labelUList ®ionFeatureEdges, const labelUList &feaurePoints)
pointStatus classifyFeaturePoint(label ptI) const
Classify the type of feature point. Requires valid stored member.
void nearestFeaturePoint(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
label flatStart() const
Return the index of the start of the flat feature edges.
void select(const searchableSurface &surf, const volumeType volType, labelList &pMap, labelList &eMap)
Remove outside/inside edges. volType denotes which side to keep.
static void sortedOrder(const List< extendedEdgeMesh::pointStatus > &pointStat, const List< extendedEdgeMesh::edgeStatus > &edgeStat, labelList &sortedToOriginalPoint, labelList &sortedToOriginalEdge, label &pointConcaveStart, label &pointMixedStart, label &pointNonFeatStart, label &edgeInternalStart, label &edgeFlatStart, label &edgeOpenStart, label &edgeMultipleStart)
Determine the ordering.
label nonFeatureStart_
Index of the start of the non-feature points.
const labelList & regionEdges() const
Return the feature edges which are on the boundary between.
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
const labelListList & edgeNormals() const
Return the indices of the normals that are adjacent to the.
void autoMap(const pointField &subPoints, const edgeList &subEdges, const labelList &pointMap, const labelList &edgeMap)
Update with derived geometry.
label openStart_
Index of the start of the open feature edges.
labelListList featurePointEdges_
Indices of feature edges attached to feature points. The edges are.
void writeObj(const fileName &prefix) const
Write all components of the extendedEdgeMesh as obj files.
label flatStart_
Index of the start of the flat feature edges.
List< sideVolumeType > normalVolumeTypes_
Type per normal: which side of normal to mesh.
@ NONFEATURE
Not a feature point.
@ MIXED
A point surrounded by both convex and concave edges.
@ CONCAVE
Fully concave point.
@ CONVEX
Fully convex point (w.r.t normals)
static label externalStart_
Index of the start of the external feature edges - static as 0.
static edgeStatus classifyEdge(const List< vector > &norms, const labelList &edNorms, const vector &fC0tofC1)
Classify the type of feature edge. Requires face centre 0 to face.
@ FLAT
Neither concave or convex, on a flat surface.
@ OPEN
Only connected to a single face.
@ MULTIPLE
Multiply connected (connected to more than two faces)
@ NONE
Unclassified (consistency with surfaceFeatures)
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
static const Enum< sideVolumeType > sideVolumeTypeNames_
label internalStart_
Index of the start of the internal feature edges.
const vectorField & normals() const
Return the normals of the surfaces adjacent to the feature edges.
label multipleStart() const
Return the index of the start of the multiply-connected feature.
sideVolumeType
Normals point to the outside.
vectorField normals_
Normals of the features, to be referred to by index by both feature.
static label convexStart_
Index of the start of the convex feature points - static as 0.
label internalStart() const
Return the index of the start of the internal feature edges.
void nearestFeatureEdge(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
virtual void writeStats(Ostream &os) const
Dump some information.
static const Enum< pointStatus > pointStatusNames_
virtual void clear()
Clear all storage.
label mixedStart_
Index of the start of the mixed type feature points.
void flipNormals()
Flip normals. All concave become convex, all internal external.
bool mergePointsAndSort(const scalar mergeDist, labelList &pointMap, labelList &edgeMap)
Geometric merge points. Returns true if any points merged.
void allNearestFeatureEdges(const point &sample, const scalar searchRadiusSqr, List< pointIndexHit > &info) const
Find all the feature edges within searchDistSqr of sample.
labelListList normalDirections_
Starting directions for the edges.
bool read(const fileName &name, const word &ext)
Read from file. Chooses reader based on explicit extension.
const indexedOctree< treeDataPoint > & pointTree() const
Demand driven construction of octree for feature points.
const labelListList & featurePointNormals() const
Return the indices of the normals that are adjacent to the.
void nearestFeatureEdgeByType(const point &sample, const scalarField &searchDistSqr, List< pointIndexHit > &info) const
Find the nearest point on each type of feature edge.
label mixedStart() const
Return the index of the start of the mixed type feature points.
label multipleStart_
Index of the start of the multiply-connected feature edges.
label concaveStart() const
Return the index of the start of the concave feature points.
labelListList featurePointNormals_
Indices of the normals that are adjacent to the feature points.
static scalar cosNormalAngleTol_
Angular closeness tolerance for treating normals as the same.
const PtrList< indexedOctree< treeDataEdge > > & edgeTreesByType() const
Demand driven construction of octree for boundary edges by type.
static wordHashSet readTypes()
Summary of supported read file types.
static const Enum< edgeStatus > edgeStatusNames_
label concaveStart_
Index of the start of the concave feature points.
A class for handling file names.
word ext() const
Return file name extension (part after last .)
virtual bool write()
Write the output fields.
Sums a given list of (at least two or more) fields and outputs the result into a new field,...
Non-pointer based hierarchical recursive searching.
void clear()
Clear all entries from the registry.
A class representing the concept of -1.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
transferModelList & transfer()
Transfer.
Patchify triangles based on orientation w.r.t other (triangulated or triangulatable) surfaces.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit > > &) const =0
Get all intersections in order from start to end.
virtual void getVolumeType(const pointField &, List< volumeType > &) const =0
Determine type (inside/outside) for point.
Holds feature edges/points of surface.
const triSurface & surface() const
label nRegionEdges() const
Return number of region edges.
const labelList & featureEdges() const
Return feature edge list.
const labelList & featurePoints() const
Return feature point list.
Standard boundBox with extra functionality for use in octree.
Holds data for octree to work on an edges subset.
Holds (reference to) pointField. Encapsulation of data needed for octree searches....
Triangulated surface description with patch information.
An enumeration wrapper for classification of a location as being inside/outside of a volume.
@ OUTSIDE
A location outside the volume.
@ INSIDE
A location inside the volume.
A class for handling words, derived from Foam::string.
word ext() const
Return file name extension (part after last .)
word lessExt() const
Return word without extension (part before last .)
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
bool read(const char *buf, int32_t &val)
Same as readInt32.
line< point, const point & > linePointRef
A line using referred points.
messageStream Info
Information stream (stdout output on master, null elsewhere)
vectorField pointField
pointField is a vectorField.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Omanip< int > setw(const int i)
label mergePoints(const PointList &points, labelList &pointToUnique, labelList &uniquePoints, const scalar mergeTol=SMALL, const bool verbose=false)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & indent(Ostream &os)
Indent stream.
Istream & operator>>(Istream &, directionInfo &)
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
static constexpr const zero Zero
Global zero (0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
UIndirectList< label > labelUIndList
UIndirectList of labels.
dimensionedScalar cos(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
scalarField samples(nIntervals, Zero)