56 scalar faceAreaLimit = small;
60 if (
mag(fAreas[fI]) > faceAreaLimit)
102 isErrorPoint[
f[pI]] =
true;
128 const labelList& faceEdges = mesh_.faceEdges()[facei];
129 const edgeList& edges = mesh_.edges();
135 const label edgeI = faceEdges[eI];
136 const edge&
e = edges[edgeI];
156 edgeLabels[
count++] = edgeI;
160 if (
count != edgeLabels.size())
162 edgeLabels.setSize(
count);
169 void Foam::edgeCollapser::collapseToEdge
174 const vector& collapseAxis,
182 Map<point>& collapsePointToLocation
191 DynamicList<label> maxPriorityPts(
max(dNeg.size(), dPos.size()));
195 const label facePointi = facePtsNeg[fPtI];
196 const label facePtPriority = pointPriority[facePointi];
198 if (facePtPriority > maxPriority)
200 maxPriority = facePtPriority;
201 maxPriorityPts.clear();
202 maxPriorityPts.append(facePointi);
204 else if (facePtPriority == maxPriority)
206 maxPriorityPts.append(facePointi);
210 if (!maxPriorityPts.empty())
214 forAll(maxPriorityPts, ptI)
216 averagePt += pts[maxPriorityPts[ptI]];
219 collapseToPtA = averagePt/maxPriorityPts.size();
224 maxPriorityPts.clear();
226 labelList faceEdgesNeg = edgesFromPoints(facei, facePtsNeg);
228 forAll(faceEdgesNeg, edgeI)
235 collapsePointToLocation.set(facePtsNeg[pI], collapseToPtA);
245 const label facePointi = facePtsPos[fPtI];
246 const label facePtPriority = pointPriority[facePointi];
248 if (facePtPriority > maxPriority)
250 maxPriority = facePtPriority;
251 maxPriorityPts.clear();
252 maxPriorityPts.append(facePointi);
254 else if (facePtPriority == maxPriority)
256 maxPriorityPts.append(facePointi);
260 if (!maxPriorityPts.empty())
264 forAll(maxPriorityPts, ptI)
266 averagePt += pts[maxPriorityPts[ptI]];
269 collapseToPtB = averagePt/maxPriorityPts.size();
273 labelList faceEdgesPos = edgesFromPoints(facei, facePtsPos);
275 forAll(faceEdgesPos, edgeI)
282 collapsePointToLocation.set(facePtsPos[pI], collapseToPtB);
287 void Foam::edgeCollapser::collapseToPoint
295 Map<point>& collapsePointToLocation
298 const face&
f = mesh_.faces()[facei];
303 DynamicList<label> maxPriorityPts(
f.
size());
307 const label facePointi = facePts[fPtI];
308 const label facePtPriority = pointPriority[facePointi];
310 if (facePtPriority > maxPriority)
312 maxPriority = facePtPriority;
313 maxPriorityPts.clear();
314 maxPriorityPts.append(facePointi);
316 else if (facePtPriority == maxPriority)
318 maxPriorityPts.append(facePointi);
322 if (!maxPriorityPts.empty())
326 forAll(maxPriorityPts, ptI)
328 averagePt += pts[maxPriorityPts[ptI]];
331 collapseToPt = averagePt/maxPriorityPts.
size();
374 const labelList& faceEdges = mesh_.faceEdges()[facei];
378 const label edgeI = faceEdges[eI];
384 collapsePointToLocation.set(
f[pI], collapseToPt);
389 void Foam::edgeCollapser::faceCollapseAxisAndAspectRatio
406 scalar magJ =
mag(J);
421 detJ =
max(
det(J), small);
429 if (
magSqr(collapseAxis) > vSmall)
431 collapseAxis /=
mag(collapseAxis);
442 if (
mag(eVals.y() - eVals.x()) < 100*small)
451 collapseAxis /=
mag(collapseAxis);
479 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
481 const labelList& cellOwner = mesh_.faceOwner();
482 const labelList& cellNeighbour = mesh_.faceNeighbour();
484 const label nBoundaryFaces = mesh_.nFaces() - mesh_.nInternalFaces();
487 for (
label intFacei = 0; intFacei < mesh_.nInternalFaces(); ++intFacei)
489 const scalar cellOwnerVol =
max(0.0, V[cellOwner[intFacei]]);
490 const scalar cellNeighbourVol =
max(0.0, V[cellNeighbour[intFacei]]);
492 scalar targetFaceSizeA =
Foam::pow(cellOwnerVol, 1.0/3.0);
493 scalar targetFaceSizeB =
Foam::pow(cellNeighbourVol, 1.0/3.0);
495 targetFaceSizes[intFacei] = 0.5*(targetFaceSizeA + targetFaceSizeB);
505 label bFacei = patch.start() - mesh_.nInternalFaces();
511 const labelUList& faceCells = patch.faceCells();
515 neiCellVolumes[bFacei++] =
max(0.0, V[faceCells[facei]]);
524 const label extFacei = patchFacei + patch.start();
525 const scalar cellOwnerVol =
max(0.0, V[cellOwner[extFacei]]);
527 targetFaceSizes[extFacei] =
Foam::pow(cellOwnerVol, 1.0/3.0);
538 label bFacei = patch.start() - mesh_.nInternalFaces();
544 const label localFacei = patchFacei + patch.start();
545 const scalar cellOwnerVol =
max(0.0, V[cellOwner[localFacei]]);
546 const scalar cellNeighbourVol = neiCellVolumes[bFacei++];
548 scalar targetFaceSizeA =
Foam::pow(cellOwnerVol, 1.0/3.0);
549 scalar targetFaceSizeB =
Foam::pow(cellNeighbourVol, 1.0/3.0);
551 targetFaceSizes[localFacei]
552 = 0.5*(targetFaceSizeA + targetFaceSizeB);
558 return targetFaceSizes;
567 const scalar targetFaceSize,
569 Map<point>& collapsePointToLocation,
573 const scalar collapseSizeLimitCoeff = faceFilterFactor[facei];
581 const scalar fA =
f.mag(pts);
584 scalar aspectRatio = 1.0;
586 faceCollapseAxisAndAspectRatio(
f, fC, collapseAxis, aspectRatio);
597 d[fPtI] = (collapseAxis & (pt - fC));
607 oldToNew =
invert(oldToNew.size(), oldToNew);
616 scalar dShift = -0.5*(d.first() + d.last());
646 SubList<scalar> dNeg(d, middle, 0);
647 SubList<label> facePtsNeg(facePts, middle, 0);
650 SubList<scalar> dPos(d, d.size() - middle, middle);
651 SubList<label> facePtsPos(facePts, d.size() - middle, middle);
663 if (dNeg.size() == 0 || dPos.size() == 0)
666 <<
"All points on one side of face centre, not collapsing."
674 collapseType typeOfCollapse = noCollapse;
676 if (
magSqr(collapseAxis) < vSmall)
678 typeOfCollapse = toPoint;
680 else if (fA < aspectRatio*
sqr(targetFaceSize*collapseSizeLimitCoeff))
684 allowEarlyCollapseToPoint_
685 && (d.last() - d.first())
687 *allowEarlyCollapseCoeff_*maxCollapseFaceToPointSideLengthCoeff_
690 typeOfCollapse = toPoint;
694 (dNeg.last() < guardFraction_*dNeg.first())
695 && (dPos.first() > guardFraction_*dPos.last())
698 typeOfCollapse = toEdge;
702 (d.last() - d.first())
704 *maxCollapseFaceToPointSideLengthCoeff_
709 typeOfCollapse = toPoint;
713 if (typeOfCollapse == toPoint)
723 collapsePointToLocation
726 else if (typeOfCollapse == toEdge)
741 collapsePointToLocation
745 return typeOfCollapse;
755 label masterPoint = -1;
757 const label e0 =
e.start();
760 const label e0Priority = pointPriority[e0];
761 const label e1Priority = pointPriority[e1];
763 if (e0Priority > e1Priority)
767 else if (e0Priority < e1Priority)
771 else if (e0Priority == e1Priority)
807 void Foam::edgeCollapser::checkBoundaryPointMergeEdges
810 const label otherPointi,
812 Map<point>& collapsePointToLocation
817 const label e0Priority = pointPriority[pointi];
818 const label e1Priority = pointPriority[otherPointi];
820 if (e0Priority > e1Priority)
822 collapsePointToLocation.set
828 else if (e0Priority < e1Priority)
830 collapsePointToLocation.set
838 collapsePointToLocation.set
855 Foam::label Foam::edgeCollapser::breakStringsAtEdges
858 List<pointEdgeCollapse>& allPointInfo
861 const edgeList& edges = mesh_.edges();
864 label nUncollapsed = 0;
868 const edge&
e = edges[eI];
870 const label startCollapseIndex
871 = allPointInfo[
e.start()].collapseIndex();
873 if (startCollapseIndex != -1 && startCollapseIndex != -2)
875 const label endCollapseIndex
876 = allPointInfo[
e.end()].collapseIndex();
878 if (!
collapseEdge[eI] && startCollapseIndex == endCollapseIndex)
880 const labelList& ptEdgesStart = pointEdges[
e.start()];
882 forAll(ptEdgesStart, ptEdgeI)
884 const label edgeI = ptEdgesStart[ptEdgeI];
886 const label nbrPointi = edges[edgeI].otherVertex(
e.start());
887 const label nbrIndex =
888 allPointInfo[nbrPointi].collapseIndex();
890 if (
collapseEdge[edgeI] && nbrIndex == startCollapseIndex)
904 void Foam::edgeCollapser::determineDuplicatePointsOnFace
907 PackedBoolList& markedPoints,
910 List<pointEdgeCollapse>& allPointInfo
913 uniqueCollapses.clear();
914 duplicateCollapses.clear();
918 label index = allPointInfo[
f[fpI]].collapseIndex();
921 if (index != allPointInfo[
f.prevLabel(fpI)].collapseIndex())
923 if (!uniqueCollapses.insert(index))
926 duplicateCollapses.insert(index);
935 label index = allPointInfo[
f[fpI]].collapseIndex();
936 if (duplicateCollapses.found(index))
938 markedPoints[
f[fpI]] =
true;
947 List<pointEdgeCollapse>& allPointInfo
954 const label pointi =
f[fpI];
964 const label prevNewPointi
965 = allPointInfo[prevPointi].collapseIndex();
978 bool Foam::edgeCollapser::isFaceCollapsed
981 List<pointEdgeCollapse>& allPointInfo
984 label nEdges = countEdgesOnFace(
f, allPointInfo);
1004 const globalIndex& globalPoints,
1007 const Map<point>& collapsePointToLocation,
1008 List<pointEdgeCollapse>& allPointInfo
1011 const edgeList& edges = mesh_.edges();
1013 label nCollapsed = 0;
1015 DynamicList<label> initPoints(mesh_.nPoints());
1016 DynamicList<pointEdgeCollapse> initPointInfo(mesh_.nPoints());
1018 allPointInfo.clear();
1019 allPointInfo.setSize(mesh_.nPoints());
1022 List<pointEdgeCollapse> allEdgeInfo
1025 pointEdgeCollapse(
Zero, -1, -1)
1033 const edge&
e = edges[edgeI];
1035 label masterPointi =
e.start();
1038 if (pointPriority[
e.end()] > pointPriority[
e.start()])
1040 masterPointi =
e.end();
1043 label masterPointPriority = pointPriority[masterPointi];
1045 label index = globalPoints.toGlobal(masterPointi);
1047 if (!collapsePointToLocation.found(masterPointi))
1049 const label otherVertex =
e.otherVertex(masterPointi);
1051 if (!collapsePointToLocation.found(otherVertex))
1054 << masterPointi <<
" on edge " << edgeI <<
" " <<
e
1055 <<
" is not marked for collapse."
1060 masterPointi = otherVertex;
1061 masterPointPriority = pointPriority[masterPointi];
1062 index = globalPoints.toGlobal(masterPointi);
1066 const point& collapsePoint = collapsePointToLocation[masterPointi];
1068 const pointEdgeCollapse pec
1077 allEdgeInfo[edgeI] = pointEdgeCollapse
1084 initPointInfo.append(pec);
1085 initPoints.append(
e.start());
1087 initPointInfo.append(pec);
1088 initPoints.append(
e.end());
1094 PointEdgeWave<pointEdgeCollapse> collapsePropagator
1101 mesh_.globalData().nTotalPoints()
1108 void Foam::edgeCollapser::filterFace
1110 const Map<DynamicList<label>>& collapseStrings,
1111 const List<pointEdgeCollapse>& allPointInfo,
1123 label collapseIndex = allPointInfo[pointi].collapseIndex();
1126 if (collapseStrings.found(collapseIndex))
1128 label localPointi = collapseStrings[collapseIndex][0];
1130 if (
findIndex(SubList<label>(
f, newFp), localPointi) == -1)
1132 f[newFp++] = localPointi;
1135 else if (collapseIndex == -1)
1138 <<
"Point " << pointi <<
" was not visited by PointEdgeWave"
1143 f[newFp++] = pointi;
1154 const label size = newFp;
1158 for (
label fp = 2; fp < size; fp++)
1171 <<
"Removing consecutive duplicate vertex in face "
1175 else if (index == fp2)
1178 <<
"Removing non-consecutive duplicate vertex in face "
1183 else if (index != -1)
1186 <<
"Pinched face " <<
f <<
endl;
1187 f[newFp++] = pointi;
1191 f[newFp++] = pointi;
1205 maxCollapseFaceToPointSideLengthCoeff_(0),
1206 allowEarlyCollapseToPoint_(false),
1207 allowEarlyCollapseCoeff_(0)
1220 dict.lookupOrDefault<scalar>(
"guardFraction", 0)
1222 maxCollapseFaceToPointSideLengthCoeff_
1224 dict.lookupOrDefault<scalar>(
"maxCollapseFaceToPointSideLengthCoeff", 0)
1226 allowEarlyCollapseToPoint_
1228 dict.lookupOrDefault<
Switch>(
"allowEarlyCollapseToPoint", true)
1230 allowEarlyCollapseCoeff_
1232 dict.lookupOrDefault<scalar>(
"allowEarlyCollapseCoeff", 0)
1237 Info<<
"Edge Collapser Settings:" <<
nl
1238 <<
" Guard Fraction = " << guardFraction_ <<
nl
1239 <<
" Max collapse face to point side length = "
1240 << maxCollapseFaceToPointSideLengthCoeff_ <<
nl
1241 <<
" " << (allowEarlyCollapseToPoint_ ?
"Allow" :
"Do not allow")
1242 <<
" early collapse to point" <<
nl
1243 <<
" Early collapse coeff = " << allowEarlyCollapseCoeff_
1258 const labelList& faceOwner = mesh_.faceOwner();
1259 const labelList& faceNeighbour = mesh_.faceNeighbour();
1297 bool meshChanged =
false;
1307 forAll(allPointInfo, pointi)
1309 label collapseIndex = allPointInfo[pointi].collapseIndex();
1311 if (collapseIndex != -1 && collapseIndex != -2)
1314 if (fnd != nPerIndex.
end())
1320 nPerIndex.
insert(collapseIndex, 1);
1333 forAll(allPointInfo, pointi)
1335 const label collapseIndex = allPointInfo[pointi].collapseIndex();
1337 if (collapseIndex != -1 && collapseIndex != -2)
1339 collapseStrings[collapseIndex].append(pointi);
1371 boolList cellRemoved(mesh_.nCells(),
false);
1373 label nUnvisited = 0;
1374 label nUncollapsed = 0;
1375 label nCollapsed = 0;
1404 <<
indent <<
"Not visited : " << nUnvisited <<
nl
1405 <<
indent <<
"Not collapsed : " << nUncollapsed <<
nl
1406 <<
indent <<
"Collapsed : " << nCollapsed <<
nl
1414 filterFace(collapseStrings, allPointInfo, newFaces[facei]);
1418 label nCellCollapsed = 0;
1422 if (!cellRemoved[celli])
1430 label facei = cFaces[i];
1432 if (newFaces[facei].size() < 3)
1438 Pout<<
"Cell:" << celli
1439 <<
" uses faces:" << cFaces
1440 <<
" of which too many are marked for removal:"
1447 if (newFaces[cFaces[j]].size() < 3)
1449 Pout<<
' '<< cFaces[j];
1454 cellRemoved[celli] =
true;
1469 Info<<
indent <<
"Collapsing " << nCellCollapsed <<
" cells" <<
endl;
1471 if (nCellCollapsed == 0)
1480 boolList doneFace(mesh_.nFaces(),
false);
1484 boolList usedPoint(mesh_.nPoints(),
false);
1486 forAll(cellRemoved, celli)
1488 if (cellRemoved[celli])
1497 const face&
f = newFaces[facei];
1505 doneFace[facei] =
true;
1512 usedPoint[
f[fp]] =
true;
1518 forAll(usedPoint, pointi)
1520 if (!usedPoint[pointi])
1522 removedPoints[pointi] =
true;
1530 forAll(allPointInfo, pointi)
1532 const label collapseIndex = allPointInfo[pointi].collapseIndex();
1533 const point& collapsePoint = allPointInfo[pointi].collapsePoint();
1537 removedPoints[pointi] ==
false
1538 && collapseIndex != -1
1539 && collapseIndex != -2
1555 forAll(allPointInfo, pointi)
1557 if (removedPoints[pointi] ==
true)
1559 const labelList& changedFaces = pointFaces[pointi];
1561 forAll(changedFaces, changedFacei)
1563 label facei = changedFaces[changedFacei];
1565 if (!doneFace[facei])
1567 doneFace[facei] =
true;
1570 label own = faceOwner[facei];
1574 if (mesh_.isInternalFace(facei))
1576 nei = faceNeighbour[facei];
1610 const bool allowCellCollapse
1615 const faceList faces = mesh_.faces();
1616 const edgeList& edges = mesh_.edges();
1626 label nUncollapsed = 0;
1644 collapsePointToLocation,
1655 const face&
f = faces[facei];
1657 isCollapsedFace[facei] = isFaceCollapsed(
f, allPointInfo);
1659 if (isCollapsedFace[facei] < 1)
1661 determineDuplicatePointsOnFace
1682 forAll(markedPoints, pointi)
1684 if (markedPoints[pointi])
1686 const label index = allPointInfo[pointi].collapseIndex();
1688 const labelList& ptEdges = pointEdges[pointi];
1692 const label edgeI = ptEdges[ptEdgeI];
1693 const label nbrPointi = edges[edgeI].otherVertex(pointi);
1694 const label nbrIndex
1695 = allPointInfo[nbrPointi].collapseIndex();
1706 if (!allowCellCollapse)
1717 label facei = cFaces[fI];
1719 if (isCollapsedFace[facei])
1729 label facei = cFaces[fI];
1731 const labelList& fEdges = faceEdges[facei];
1736 label edgeI = fEdges[fEdgeI];
1745 nFaces += isCollapsedFace[facei] ? 1 : 0;
1748 isCollapsedFace[facei] =
false;
1755 <<
"Cell " << celli <<
" " << cFaces <<
nl
1756 <<
"is " << nFaces <<
", "
1757 <<
"but cell collapse has been disabled."
1763 nUncollapsed += breakStringsAtEdges(
collapseEdge, allPointInfo);
1767 Info<<
" Uncollapsed edges = " << nUncollapsed <<
" / "
1770 if (nUncollapsed == 0)
1790 const edgeList& edges = mesh_.edges();
1792 label nCollapsed = 0;
1796 const edge&
e = edges[edgeI];
1800 if (
e.mag(
points) < minEdgeLen[edgeI])
1804 label masterPointi = edgeMaster(pointPriority,
e);
1806 if (masterPointi == -1)
1817 collapsePointToLocation.
set(masterPointi, collapsePt);
1832 const scalar maxCos,
1838 const edgeList& edges = mesh_.edges();
1851 label nCollapsed = 0;
1855 forAll(pointEdges, pointi)
1857 if (pointCanBeDeleted[pointi])
1859 const labelList& pEdges = pointEdges[pointi];
1861 if (pEdges.
size() == 2)
1865 label e0 = pEdges[0];
1866 label e1 = pEdges[1];
1871 scalar e0length =
mag
1876 scalar e1length =
mag
1881 if (e0length <= e1length)
1885 checkBoundaryPointMergeEdges
1888 edges[e0].otherVertex(pointi),
1890 collapsePointToLocation
1897 checkBoundaryPointMergeEdges
1900 edges[e1].otherVertex(pointi),
1902 collapsePointToLocation
1925 const faceList& faces = mesh_.faces();
1927 const scalarField targetFaceSizes = calcTargetFaceSizes();
1930 label nCollapseToPoint = 0;
1931 label nCollapseToEdge = 0;
1935 const face&
f = faces[fI];
1937 if (faceFilterFactor[fI] <= 0)
1947 targetFaceSizes[fI],
1949 collapsePointToLocation,
1953 if (flagCollapseFace == noCollapse)
1957 else if (flagCollapseFace == toPoint)
1961 else if (flagCollapseFace == toEdge)
1968 <<
"Face is marked to be collapsed to " << flagCollapseFace
1969 <<
". Currently can only collapse to point/edge."
1974 return labelPair(nCollapseToPoint, nCollapseToEdge);
1987 const faceList& faces = mesh_.faces();
1989 const scalarField targetFaceSizes = calcTargetFaceSizes();
1992 label nCollapseToPoint = 0;
1993 label nCollapseToEdge = 0;
2002 const face&
f = faces[fI];
2004 if (faceFilterFactor[fI] <= 0)
2014 targetFaceSizes[fI],
2016 collapsePointToLocation,
2020 if (flagCollapseFace == noCollapse)
2024 else if (flagCollapseFace == toPoint)
2028 else if (flagCollapseFace == toEdge)
2035 <<
"Face is marked to be collapsed to " << flagCollapseFace
2036 <<
". Currently can only collapse to point/edge."
2041 return labelPair(nCollapseToPoint, nCollapseToEdge);
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
bool set(const Key &, const T &newElmt)
Set a new hashedEntry, overwriting existing entries.
label size() const
Return number of elements in table.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
void resize(const label newSize)
Resize the hash table for efficiency.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
A HashTable to objects of type <T> with a label key.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
static direction size()
Return the number of elements in the VectorSpace = Ncmpts.
label localIndex(const label globalIndex) const
Map storing the local index for every global index. Used to find.
A cell is defined as a list of faces with extra functionality.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Does polyTopoChanges to remove edges. Can remove faces due to edge collapse but can not remove cells ...
static label checkMeshQuality(const polyMesh &mesh, const dictionary &meshQualityDict, PackedBoolList &isErrorPoint)
Check mesh and mark points on faces in error.
labelPair markSmallSliverFaces(const scalarField &faceFilterFactor, const labelList &pointPriority, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation) const
Find small faces and sliver faces in the mesh and mark the.
edgeCollapser(const polyMesh &mesh)
Construct from mesh.
label markSmallEdges(const scalarField &minEdgeLen, const labelList &pointPriority, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation) const
Mark (in collapseEdge) any edges to collapse.
labelPair markFaceZoneEdges(const faceZone &fZone, const scalarField &faceFilterFactor, const labelList &pointPriority, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation) const
Marks edges in the faceZone indirectPatchFaces for collapse.
bool setRefinement(const List< pointEdgeCollapse > &allPointInfo, polyTopoChange &meshMod) const
Play commands into polyTopoChange to create mesh.
void consistentCollapse(const globalIndex &globalPoints, const labelList &pointPriority, const Map< point > &collapsePointToLocation, PackedBoolList &collapseEdge, List< pointEdgeCollapse > &allPointInfo, const bool allowCellCollapse=false) const
Ensure that the collapse is parallel consistent and update.
label markMergeEdges(const scalar maxCos, const labelList &pointPriority, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation) const
Mark (in collapseEdge) any edges to merge.
static labelHashSet checkBadFaces(const polyMesh &mesh, const dictionary &meshQualityDict)
Calls meshCheck::checkMesh and returns a set of bad faces.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A subset of mesh faces organised as a primitive patch.
A face is a list of labels corresponding to mesh vertices.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Calculates points shared by more than two processor patches or cyclic patches.
Determines length of string of edges walked to point.
label collapseIndex() const
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
Mesh consisting of general polyhedral cells.
virtual const faceList & faces() const
Return raw faces.
Direct mesh changes based on v1.3 polyTopoChange syntax.
void modifyPoint(const label, const point &, const bool inCell)
Modify coordinate.
void removePoint(const label, const label)
Remove point / merge points.
void removeFace(const label, const label)
Remove face / merge faces.
void removeCell(const label, const label)
Remove cell / merge cells.
void modifyFace(const face &f, const label facei, const label own, const label nei, const bool flipFaceFlux, const label patchID)
Modify vertices or cell of face.
const vectorField & faceAreas() const
Removes selected points from mesh and updates faces using these points.
label countPointUsage(const scalar minCos, boolList &pointCanBeDeleted) const
Mark in pointCanBeDeleted the points that can be deleted.
label collapseEdge(triSurface &surf, const scalar minLen)
Keep collapsing all edges < minLen.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const fvPatchList & patches
Functions for checking mesh topology and geometry.
#define WarningInFunction
Report a warning using Foam::Warning.
bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet &wrongFaces)
Check (subset of mesh including baffles) with mesh settings in dict.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
Pair< label > labelPair
Label pair.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
List< label > labelList
A List of labels.
dimensionedTensor eigenVectors(const dimensionedTensor &dt)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Tensor< scalar > tensor
Tensor of scalars.
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList invert(const label len, const labelUList &)
Invert one-to-one map. Unmapped elements will be -1.
errorManip< error > abort(error &err)
vectorField pointField
pointField is a vectorField.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
List< scalar > scalarList
A List of scalars.
vector point
Point is a vector.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Vector< scalar > vector
A scalar version of the templated Vector.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensionedScalar sqrt(const dimensionedScalar &ds)
List< labelList > labelListList
A List of labelList.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
dimensionedVector eigenValues(const dimensionedTensor &dt)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
label longestEdge(const face &f, const pointField &pts)
Find the longest edge on a face. Face point labels index into pts.
prefixOSstream Pout(cout, "Pout")
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.
static const label labelMax
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
UList< label > labelUList
Ostream & indent(Ostream &os)
Indent stream.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
static const label labelMin
void inplaceReorder(const labelUList &oldToNew, ListType &)
Inplace reorder the elements of a list.
labelList pointLabels(nPoints, -1)
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable