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();
1301 bool meshChanged =
false;
1311 forAll(allPointInfo, pointi)
1313 label collapseIndex = allPointInfo[pointi].collapseIndex();
1315 if (collapseIndex != -1 && collapseIndex != -2)
1318 if (fnd != nPerIndex.
end())
1324 nPerIndex.
insert(collapseIndex, 1);
1337 forAll(allPointInfo, pointi)
1339 const label collapseIndex = allPointInfo[pointi].collapseIndex();
1341 if (collapseIndex != -1 && collapseIndex != -2)
1343 collapseStrings[collapseIndex].append(pointi);
1375 boolList cellRemoved(mesh_.nCells(),
false);
1377 label nUnvisited = 0;
1378 label nUncollapsed = 0;
1379 label nCollapsed = 0;
1408 <<
indent <<
"Not visited : " << nUnvisited <<
nl
1409 <<
indent <<
"Not collapsed : " << nUncollapsed <<
nl
1410 <<
indent <<
"Collapsed : " << nCollapsed <<
nl
1418 filterFace(collapseStrings, allPointInfo, newFaces[facei]);
1422 label nCellCollapsed = 0;
1426 if (!cellRemoved[celli])
1434 label facei = cFaces[i];
1436 if (newFaces[facei].size() < 3)
1442 Pout<<
"Cell:" << celli
1443 <<
" uses faces:" << cFaces
1444 <<
" of which too many are marked for removal:"
1451 if (newFaces[cFaces[j]].size() < 3)
1453 Pout<<
' '<< cFaces[j];
1458 cellRemoved[celli] =
true;
1473 Info<<
indent <<
"Collapsing " << nCellCollapsed <<
" cells" <<
endl;
1475 if (nCellCollapsed == 0)
1484 boolList doneFace(mesh_.nFaces(),
false);
1488 boolList usedPoint(mesh_.nPoints(),
false);
1490 forAll(cellRemoved, celli)
1492 if (cellRemoved[celli])
1501 const face&
f = newFaces[facei];
1509 doneFace[facei] =
true;
1516 usedPoint[
f[fp]] =
true;
1522 forAll(usedPoint, pointi)
1524 if (!usedPoint[pointi])
1526 removedPoints[pointi] =
true;
1534 forAll(allPointInfo, pointi)
1536 const label collapseIndex = allPointInfo[pointi].collapseIndex();
1537 const point& collapsePoint = allPointInfo[pointi].collapsePoint();
1541 removedPoints[pointi] ==
false
1542 && collapseIndex != -1
1543 && collapseIndex != -2
1561 forAll(allPointInfo, pointi)
1563 if (removedPoints[pointi] ==
true)
1565 const labelList& changedFaces = pointFaces[pointi];
1567 forAll(changedFaces, changedFacei)
1569 label facei = changedFaces[changedFacei];
1571 if (!doneFace[facei])
1573 doneFace[facei] =
true;
1578 bool zoneFlip =
false;
1582 const faceZone& fZone = faceZones[zoneID];
1588 label own = faceOwner[facei];
1592 if (mesh_.isInternalFace(facei))
1594 nei = faceNeighbour[facei];
1630 const bool allowCellCollapse
1635 const faceList faces = mesh_.faces();
1636 const edgeList& edges = mesh_.edges();
1646 label nUncollapsed = 0;
1664 collapsePointToLocation,
1675 const face&
f = faces[facei];
1677 isCollapsedFace[facei] = isFaceCollapsed(
f, allPointInfo);
1679 if (isCollapsedFace[facei] < 1)
1681 determineDuplicatePointsOnFace
1702 forAll(markedPoints, pointi)
1704 if (markedPoints[pointi])
1706 const label index = allPointInfo[pointi].collapseIndex();
1708 const labelList& ptEdges = pointEdges[pointi];
1712 const label edgeI = ptEdges[ptEdgeI];
1713 const label nbrPointi = edges[edgeI].otherVertex(pointi);
1714 const label nbrIndex
1715 = allPointInfo[nbrPointi].collapseIndex();
1726 if (!allowCellCollapse)
1737 label facei = cFaces[fI];
1739 if (isCollapsedFace[facei])
1749 label facei = cFaces[fI];
1751 const labelList& fEdges = faceEdges[facei];
1756 label edgeI = fEdges[fEdgeI];
1765 nFaces += isCollapsedFace[facei] ? 1 : 0;
1768 isCollapsedFace[facei] =
false;
1775 <<
"Cell " << celli <<
" " << cFaces <<
nl
1776 <<
"is " << nFaces <<
", "
1777 <<
"but cell collapse has been disabled."
1783 nUncollapsed += breakStringsAtEdges(
collapseEdge, allPointInfo);
1787 Info<<
" Uncollapsed edges = " << nUncollapsed <<
" / "
1790 if (nUncollapsed == 0)
1810 const edgeList& edges = mesh_.edges();
1812 label nCollapsed = 0;
1816 const edge&
e = edges[edgeI];
1820 if (
e.mag(
points) < minEdgeLen[edgeI])
1824 label masterPointi = edgeMaster(pointPriority,
e);
1826 if (masterPointi == -1)
1837 collapsePointToLocation.
set(masterPointi, collapsePt);
1852 const scalar maxCos,
1858 const edgeList& edges = mesh_.edges();
1871 label nCollapsed = 0;
1875 forAll(pointEdges, pointi)
1877 if (pointCanBeDeleted[pointi])
1879 const labelList& pEdges = pointEdges[pointi];
1881 if (pEdges.
size() == 2)
1885 label e0 = pEdges[0];
1886 label e1 = pEdges[1];
1891 scalar e0length =
mag
1896 scalar e1length =
mag
1901 if (e0length <= e1length)
1905 checkBoundaryPointMergeEdges
1908 edges[e0].otherVertex(pointi),
1910 collapsePointToLocation
1917 checkBoundaryPointMergeEdges
1920 edges[e1].otherVertex(pointi),
1922 collapsePointToLocation
1945 const faceList& faces = mesh_.faces();
1947 const scalarField targetFaceSizes = calcTargetFaceSizes();
1950 label nCollapseToPoint = 0;
1951 label nCollapseToEdge = 0;
1955 const face&
f = faces[fI];
1957 if (faceFilterFactor[fI] <= 0)
1967 targetFaceSizes[fI],
1969 collapsePointToLocation,
1973 if (flagCollapseFace == noCollapse)
1977 else if (flagCollapseFace == toPoint)
1981 else if (flagCollapseFace == toEdge)
1988 <<
"Face is marked to be collapsed to " << flagCollapseFace
1989 <<
". Currently can only collapse to point/edge."
1994 return labelPair(nCollapseToPoint, nCollapseToEdge);
2007 const faceList& faces = mesh_.faces();
2009 const scalarField targetFaceSizes = calcTargetFaceSizes();
2012 label nCollapseToPoint = 0;
2013 label nCollapseToEdge = 0;
2022 const face&
f = faces[fI];
2024 if (faceFilterFactor[fI] <= 0)
2034 targetFaceSizes[fI],
2036 collapsePointToLocation,
2040 if (flagCollapseFace == noCollapse)
2044 else if (flagCollapseFace == toPoint)
2048 else if (flagCollapseFace == toEdge)
2055 <<
"Face is marked to be collapsed to " << flagCollapseFace
2056 <<
". Currently can only collapse to point/edge."
2061 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.
A HashTable with keys but without contents.
bool set(const Key &, const T &newElmt)
Assign 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.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
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.
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 HashSet< label > checkBadFaces(const polyMesh &mesh, const dictionary &meshQualityDict)
Calls motionSmoother::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.
const boolList & flipMap() const
Return face flip map.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
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.
static bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces)
Check mesh with mesh settings in dict. Collects incorrect faces.
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 removePoint(const label, const label)
Remove/merge point.
void removeFace(const label, const label)
Remove/merge face.
void modifyFace(const face &f, const label facei, const label own, const label nei, const bool flipFaceFlux, const label patchID, const label zoneID, const bool zoneFlip)
Modify vertices or cell of face.
void removeCell(const label, const label)
Remove/merge cell.
void modifyPoint(const label, const point &, const label newZoneID, const bool inCell)
Modify coordinate.
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
#define WarningInFunction
Report a warning using Foam::Warning.
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