56 scalar faceAreaLimit = SMALL;
60 if (
mag(fAreas[fI]) > faceAreaLimit)
62 checkFaces.append(fI);
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];
142 if (e[0] == pointLabels[pI])
147 if (e[1] == pointLabels[pI])
156 edgeLabels[count++] = edgeI;
160 if (count != edgeLabels.size())
162 edgeLabels.setSize(count);
169 void Foam::edgeCollapser::collapseToEdge
174 const vector& collapseAxis,
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)
230 collapseEdge[faceEdgesNeg[edgeI]] =
true;
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)
277 collapseEdge[faceEdgesPos[edgeI]] =
true;
282 collapsePointToLocation.
set(facePtsPos[pI], collapseToPtB);
287 void Foam::edgeCollapser::collapseToPoint
298 const face& f = mesh_.faces()[faceI];
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];
379 collapseEdge[edgeI] =
true;
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);
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);
503 const polyPatch& patch = patches[patchI];
505 label bFaceI = patch.
start() - mesh_.nInternalFaces();
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);
536 const polyPatch& patch = patches[patchI];
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,
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));
616 scalar dShift = -0.5*(d.first() + d.last());
663 if (dNeg.
size() == 0 || dPos.
size() == 0)
667 "Foam::conformalVoronoiMesh::collapseFace" 669 <<
"All points on one side of face centre, not collapsing." 679 if (
magSqr(collapseAxis) < VSMALL)
683 else if (fA < aspectRatio*
sqr(targetFaceSize*collapseSizeLimitCoeff))
687 allowEarlyCollapseToPoint_
688 && (d.last() - d.first())
690 *allowEarlyCollapseCoeff_*maxCollapseFaceToPointSideLengthCoeff_
697 (dNeg.
last() < guardFraction_*dNeg.
first())
698 && (dPos.
first() > guardFraction_*dPos.
last())
701 typeOfCollapse = toEdge;
705 (d.last() - d.first())
707 *maxCollapseFaceToPointSideLengthCoeff_
726 collapsePointToLocation
729 else if (typeOfCollapse == toEdge)
744 collapsePointToLocation
748 return typeOfCollapse;
758 label masterPoint = -1;
763 const label e0Priority = pointPriority[e0];
764 const label e1Priority = pointPriority[e1];
766 if (e0Priority > e1Priority)
770 else if (e0Priority < e1Priority)
774 else if (e0Priority == e1Priority)
810 void Foam::edgeCollapser::checkBoundaryPointMergeEdges
813 const label otherPointI,
820 const label e0Priority = pointPriority[pointI];
821 const label e1Priority = pointPriority[otherPointI];
823 if (e0Priority > e1Priority)
825 collapsePointToLocation.
set 831 else if (e0Priority < e1Priority)
833 collapsePointToLocation.
set 841 collapsePointToLocation.
set 858 Foam::label Foam::edgeCollapser::breakStringsAtEdges
865 const edgeList& edges = mesh_.edges();
868 label nUncollapsed = 0;
874 const edge& e = edges[eI];
876 const label startCollapseIndex
877 = allPointInfo[e.
start()].collapseIndex();
879 if (startCollapseIndex != -1 && startCollapseIndex != -2)
881 const label endCollapseIndex
882 = allPointInfo[e.
end()].collapseIndex();
887 && startCollapseIndex == endCollapseIndex
892 forAll(ptEdgesStart, ptEdgeI)
894 const label edgeI = ptEdgesStart[ptEdgeI];
896 const label nbrPointI
897 = edges[edgeI].otherVertex(e.
start());
899 = allPointInfo[nbrPointI].collapseIndex();
904 && nbrIndex == startCollapseIndex
907 collapseEdge[edgeI] =
false;
920 void Foam::edgeCollapser::determineDuplicatePointsOnFace
929 uniqueCollapses.
clear();
930 duplicateCollapses.
clear();
934 label index = allPointInfo[f[fpI]].collapseIndex();
937 if (index != allPointInfo[f.
prevLabel(fpI)].collapseIndex())
939 if (!uniqueCollapses.
insert(index))
942 duplicateCollapses.
insert(index);
951 label index = allPointInfo[f[fpI]].collapseIndex();
952 if (duplicateCollapses.
found(index))
954 markedPoints[f[fpI]] =
true;
970 const label pointI = f[fpI];
971 const label newPointI = allPointInfo[pointI].collapseIndex();
980 const label prevNewPointI
981 = allPointInfo[prevPointI].collapseIndex();
983 if (newPointI != prevNewPointI)
994 bool Foam::edgeCollapser::isFaceCollapsed
1000 label nEdges = countEdgesOnFace(f, allPointInfo);
1027 const edgeList& edges = mesh_.edges();
1029 label nCollapsed = 0;
1034 allPointInfo.
clear();
1035 allPointInfo.
setSize(mesh_.nPoints());
1047 if (collapseEdge[edgeI])
1049 const edge& e = edges[edgeI];
1054 if (pointPriority[e.
end()] > pointPriority[e.
start()])
1056 masterPointI = e.
end();
1059 label masterPointPriority = pointPriority[masterPointI];
1063 if (!collapsePointToLocation.
found(masterPointI))
1067 if (!collapsePointToLocation.
found(otherVertex))
1073 " const polyMesh&,\n" 1074 " const globalIndex&,\n" 1075 " const labelList&,\n" 1076 " const PackedBoolList&,\n" 1078 " List<pointEdgeCollapse>&\n" 1080 ) << masterPointI <<
" on edge " << edgeI <<
" " << e
1081 <<
" is not marked for collapse." 1086 masterPointI = otherVertex;
1087 masterPointPriority = pointPriority[masterPointI];
1088 index = globalPoints.
toGlobal(masterPointI);
1092 const point& collapsePoint = collapsePointToLocation[masterPointI];
1110 initPointInfo.append(pec);
1111 initPoints.append(e.
start());
1113 initPointInfo.append(pec);
1114 initPoints.append(e.
end());
1127 mesh_.globalData().nTotalPoints()
1134 void Foam::edgeCollapser::filterFace
1147 label pointI = f[fp];
1149 label collapseIndex = allPointInfo[pointI].collapseIndex();
1152 if (collapseStrings.found(collapseIndex))
1154 label localPointI = collapseStrings[collapseIndex][0];
1158 f[newFp++] = localPointI;
1161 else if (collapseIndex == -1)
1166 "(const label, const Map<DynamicList<label> >&, face&)" 1167 ) <<
"Point " << pointI <<
" was not visited by PointEdgeWave" 1172 f[newFp++] = pointI;
1183 const label size = newFp;
1187 for (
label fp = 2; fp < size; fp++)
1192 label pointI = f[fp];
1201 "Foam::edgeCollapser::filterFace(const label faceI, " 1203 ) <<
"Removing consecutive duplicate vertex in face " 1207 else if (index == fp2)
1211 "Foam::edgeCollapser::filterFace(const label faceI, " 1213 ) <<
"Removing non-consecutive duplicate vertex in face " 1218 else if (index != -1)
1222 "Foam::edgeCollapser::filterFace(const label faceI, " 1224 ) <<
"Pinched face " << f <<
endl;
1225 f[newFp++] = pointI;
1229 f[newFp++] = pointI;
1239 Foam::edgeCollapser::edgeCollapser(
const polyMesh& mesh)
1243 maxCollapseFaceToPointSideLengthCoeff_(0),
1244 allowEarlyCollapseToPoint_(false),
1245 allowEarlyCollapseCoeff_(0)
1249 Foam::edgeCollapser::edgeCollapser
1260 maxCollapseFaceToPointSideLengthCoeff_
1262 dict.
lookupOrDefault<scalar>(
"maxCollapseFaceToPointSideLengthCoeff", 0)
1264 allowEarlyCollapseToPoint_
1268 allowEarlyCollapseCoeff_
1275 Info<<
"Edge Collapser Settings:" <<
nl 1276 <<
" Guard Fraction = " << guardFraction_ <<
nl 1277 <<
" Max collapse face to point side length = " 1278 << maxCollapseFaceToPointSideLengthCoeff_ <<
nl 1279 <<
" " << (allowEarlyCollapseToPoint_ ?
"Allow" :
"Do not allow")
1280 <<
" early collapse to point" <<
nl 1281 <<
" Early collapse coeff = " << allowEarlyCollapseCoeff_
1339 bool meshChanged =
false;
1349 forAll(allPointInfo, pointI)
1351 label collapseIndex = allPointInfo[pointI].collapseIndex();
1353 if (collapseIndex != -1 && collapseIndex != -2)
1356 if (fnd != nPerIndex.
end())
1362 nPerIndex.
insert(collapseIndex, 1);
1368 collapseStrings.resize(2*nPerIndex.size());
1375 forAll(allPointInfo, pointI)
1377 const label collapseIndex = allPointInfo[pointI].collapseIndex();
1379 if (collapseIndex != -1 && collapseIndex != -2)
1381 collapseStrings[collapseIndex].
append(pointI);
1415 label nUnvisited = 0;
1416 label nUncollapsed = 0;
1417 label nCollapsed = 0;
1445 Info<<
indent <<
"Number of points : " << nPoints <<
nl 1446 <<
indent <<
"Not visited : " << nUnvisited <<
nl 1447 <<
indent <<
"Not collapsed : " << nUncollapsed <<
nl 1448 <<
indent <<
"Collapsed : " << nCollapsed <<
nl 1456 filterFace(collapseStrings, allPointInfo, newFaces[faceI]);
1460 label nCellCollapsed = 0;
1464 if (!cellRemoved[cellI])
1466 const cell& cFaces = cells[cellI];
1472 label faceI = cFaces[i];
1474 if (newFaces[faceI].size() < 3)
1480 Pout<<
"Cell:" << cellI
1481 <<
" uses faces:" << cFaces
1482 <<
" of which too many are marked for removal:" 1489 if (newFaces[cFaces[j]].size() < 3)
1491 Pout<<
' '<< cFaces[j];
1496 cellRemoved[cellI] =
true;
1511 Info<<
indent <<
"Collapsing " << nCellCollapsed <<
" cells" <<
endl;
1513 if (nCellCollapsed == 0)
1528 forAll(cellRemoved, cellI)
1530 if (cellRemoved[cellI])
1539 const face& f = newFaces[faceI];
1547 doneFace[faceI] =
true;
1554 usedPoint[f[fp]] =
true;
1560 forAll(usedPoint, pointI)
1562 if (!usedPoint[pointI])
1564 removedPoints[pointI] =
true;
1572 forAll(allPointInfo, pointI)
1574 const label collapseIndex = allPointInfo[pointI].collapseIndex();
1575 const point& collapsePoint = allPointInfo[pointI].collapsePoint();
1579 removedPoints[pointI] ==
false 1580 && collapseIndex != -1
1581 && collapseIndex != -2
1599 forAll(allPointInfo, pointI)
1601 if (removedPoints[pointI] ==
true)
1603 const labelList& changedFaces = pointFaces[pointI];
1605 forAll(changedFaces, changedFaceI)
1607 label faceI = changedFaces[changedFaceI];
1609 if (!doneFace[faceI])
1611 doneFace[faceI] =
true;
1616 bool zoneFlip =
false;
1620 const faceZone& fZone = faceZones[zoneID];
1626 label own = faceOwner[faceI];
1632 nei = faceNeighbour[faceI];
1668 const bool allowCellCollapse
1684 label nUncollapsed = 0;
1702 collapsePointToLocation,
1713 const face& f = faces[faceI];
1715 isCollapsedFace[faceI] = isFaceCollapsed(f, allPointInfo);
1717 if (isCollapsedFace[faceI] < 1)
1719 determineDuplicatePointsOnFace
1740 forAll(markedPoints, pointI)
1742 if (markedPoints[pointI])
1744 const label index = allPointInfo[pointI].collapseIndex();
1746 const labelList& ptEdges = pointEdges[pointI];
1750 const label edgeI = ptEdges[ptEdgeI];
1751 const label nbrPointI = edges[edgeI].otherVertex(pointI);
1752 const label nbrIndex
1753 = allPointInfo[nbrPointI].collapseIndex();
1755 if (collapseEdge[edgeI] && nbrIndex == index)
1757 collapseEdge[edgeI] =
false;
1766 if (!allowCellCollapse)
1771 const cell& cFaces = cells[cellI];
1777 label faceI = cFaces[fI];
1779 if (isCollapsedFace[faceI])
1789 label faceI = cFaces[fI];
1791 const labelList& fEdges = faceEdges[faceI];
1796 label edgeI = fEdges[fEdgeI];
1798 if (collapseEdge[edgeI])
1800 collapseEdge[edgeI] =
false;
1804 markedEdges[edgeI] =
true;
1808 isCollapsedFace[faceI] =
false;
1817 "consistentCollapse\n" 1823 ) <<
"Cell " << cellI <<
" " << cFaces <<
nl 1824 <<
"is " << nFaces <<
", " 1825 <<
"but cell collapse has been disabled." 1839 nUncollapsed += breakStringsAtEdges
1848 Info<<
" Uncollapsed edges = " << nUncollapsed <<
" / " 1851 if (nUncollapsed == 0)
1873 label nCollapsed = 0;
1877 const edge& e = edges[edgeI];
1879 if (!collapseEdge[edgeI])
1881 if (e.
mag(points) < minEdgeLen[edgeI])
1883 collapseEdge[edgeI] =
true;
1885 label masterPointI = edgeMaster(pointPriority, e);
1887 if (masterPointI == -1)
1890 = 0.5*(points[e.
start()] + points[e.
end()]);
1896 const point& collapsePt = points[masterPointI];
1898 collapsePointToLocation.
set(masterPointI, collapsePt);
1913 const scalar maxCos,
1932 label nCollapsed = 0;
1936 forAll(pointEdges, pointI)
1938 if (pointCanBeDeleted[pointI])
1940 const labelList& pEdges = pointEdges[pointI];
1942 if (pEdges.
size() == 2)
1946 label e0 = pEdges[0];
1947 label e1 = pEdges[1];
1949 if (!collapseEdge[e0] && !collapseEdge[e1])
1952 scalar e0length =
mag 1954 points[edges[e0][0]] - points[edges[e0][1]]
1957 scalar e1length =
mag 1959 points[edges[e1][0]] - points[edges[e1][1]]
1962 if (e0length <= e1length)
1964 collapseEdge[e0] =
true;
1966 checkBoundaryPointMergeEdges
1969 edges[e0].otherVertex(pointI),
1971 collapsePointToLocation
1976 collapseEdge[e1] =
true;
1978 checkBoundaryPointMergeEdges
1981 edges[e1].otherVertex(pointI),
1983 collapsePointToLocation
2008 const scalarField targetFaceSizes = calcTargetFaceSizes();
2011 label nCollapseToPoint = 0;
2012 label nCollapseToEdge = 0;
2016 const face& f = faces[fI];
2018 if (faceFilterFactor[fI] <= 0)
2028 targetFaceSizes[fI],
2030 collapsePointToLocation,
2038 else if (flagCollapseFace ==
toPoint)
2042 else if (flagCollapseFace ==
toEdge)
2048 FatalErrorIn(
"collapseFaces(const polyMesh&, List<labelPair>&)")
2049 <<
"Face is marked to be collapsed to " << flagCollapseFace
2050 <<
". Currently can only collapse to point/edge." 2055 return labelPair(nCollapseToPoint, nCollapseToEdge);
2070 const scalarField targetFaceSizes = calcTargetFaceSizes();
2073 label nCollapseToPoint = 0;
2074 label nCollapseToEdge = 0;
2083 const face& f = faces[fI];
2085 if (faceFilterFactor[fI] <= 0)
2095 targetFaceSizes[fI],
2097 collapsePointToLocation,
2105 else if (flagCollapseFace ==
toPoint)
2109 else if (flagCollapseFace ==
toEdge)
2115 FatalErrorIn(
"collapseFaces(const polyMesh&, List<labelPair>&)")
2116 <<
"Face is marked to be collapsed to " << flagCollapseFace
2117 <<
". Currently can only collapse to point/edge." 2122 return labelPair(nCollapseToPoint, nCollapseToEdge);
const vectorField & faceAreas() const
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
label markMergeEdges(const scalar maxCos, const labelList &pointPriority, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation) const
Mark (in collapseEdge) any edges to merge.
label size() const
Return the number of elements in the VectorSpace = nCmpt.
const pointField & points
const boolList & flipMap() const
Return face flip map.
const faceZoneMesh & faceZones() const
Return face zone mesh.
bool setRefinement(const List< pointEdgeCollapse > &allPointInfo, polyTopoChange &meshMod) const
Play commands into polyTopoChange to create mesh.
dimensionedVector eigenValues(const dimensionedTensor &dt)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
An ordered pair of two objects of type <T> with first() and second() elements.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
dimensioned< scalar > mag(const dimensioned< Type > &)
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
A cell is defined as a list of faces with extra functionality.
const labelListList & pointEdges() const
static label checkMeshQuality(const polyMesh &mesh, const dictionary &meshQualityDict, PackedBoolList &isErrorPoint)
Check mesh and mark points on faces in error.
PointFrompoint toPoint(const Foam::point &p)
bool empty() const
Return true if the UList is empty (ie, size() is zero).
static bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces)
Check mesh with mesh settings in dict. Collects incorrect faces.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
bool insert(const label &, const T &newElmt)
Insert a new hashedEntry.
Ostream & indent(Ostream &os)
Indent stream.
T & last()
Return the last element of the list.
void inplaceReorder(const labelUList &oldToNew, ListType &)
Inplace reorder the elements of a list.
static HashSet< label > checkBadFaces(const polyMesh &mesh, const dictionary &meshQualityDict)
Calls motionSmoother::checkMesh and returns a set of bad faces.
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
A HashTable to objects of type <T> with a label key.
A subset of mesh faces organised as a primitive patch.
const labelUList & faceCells() const
Return face-cell addressing.
scalar mag(const pointField &) const
Magnitude of face area.
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.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
void clear()
Clear the addressed list, i.e. set the size to zero.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
void size(const label)
Override size to be inconsistent with allocated storage.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
const cellList & cells() const
const pointZoneMesh & pointZones() const
Return point zone mesh.
edgeList edges() const
Return edges in face point ordering,.
static void syncEdgeList(const polyMesh &, List< T > &, const CombineOp &cop, const T &nullValue, const TransformOp &top)
Synchronize values on all mesh edges.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none.
A list of keyword definitions, which are a keyword followed by any number of values (e...
void modifyPoint(const label, const point &, const label newZoneID, const bool inCell)
Modify coordinate.
Removes selected points from mesh and updates faces using these points.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
T & first()
Return the first element of the list.
point centre(const pointField &) const
Centre point of face.
const labelListList & faceEdges() const
A patch is a list of labels that address the faces in the global face list.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
scalar mag(const pointField &) const
Return scalar magnitude.
A face is a list of labels corresponding to mesh vertices.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
void clear()
Clear the list, i.e. set size to zero.
void setSize(const label)
Reset size of List.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
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.
#define WarningIn(functionName)
Report a warning using Foam::Warning.
void clear()
Clear all entries from table.
virtual const pointField & points() const
Return raw points.
tensor inertia(const pointField &, const point &refPt=vector::zero, scalar density=1.0) const
Return the inertia tensor, with optional reference.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void removeCell(const label, const label)
Remove/merge cell.
Determines length of string of edges walked to point.
label otherVertex(const label a) const
Given one vertex, return the other.
label markSmallEdges(const scalarField &minEdgeLen, const labelList &pointPriority, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation) const
Mark (in collapseEdge) any edges to collapse.
static void swapBoundaryFaceList(const polyMesh &mesh, UList< T > &l)
Swap coupled boundary face values.
label size() const
Return the number of elements in the UList.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
static const label labelMin
label size() const
Return number of elements in table.
bool set(const label &, const T &newElmt)
Assign a new hashedEntry, overwriting existing entries.
const labelListList & pointFaces() const
label collapseIndex() const
errorManip< error > abort(error &err)
virtual const labelList & faceOwner() const
Return face owner.
static void syncPointList(const polyMesh &, List< T > &, const CombineOp &cop, const T &nullValue, const TransformOp &top)
Synchronize values on all mesh points.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
label longestEdge(const face &f, const pointField &pts)
Find the longest edge on a face. Face point labels index into pts.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
const cellShapeList & cells
label start() const
Return start label of this patch in the polyMesh face list.
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.
labelList invert(const label len, const labelUList &)
Invert one-to-one map. Unmapped elements will be -1.
void removeFace(const label, const label)
Remove/merge face.
Mesh consisting of general polyhedral cells.
label toGlobal(const label i) const
From local to global.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
label end() const
Return end vertex label.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A HashTable with keys but without contents.
Wave propagation of information through grid. Every iteration information goes through one layer of e...
Pair< label > labelPair
Label pair.
Direct mesh changes based on v1.3 polyTopoChange syntax.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
void removePoint(const label, const label)
Remove/merge point.
A List obtained as a section of another List.
void append(const T &)
Append an element at the end of the list.
label start() const
Return start vertex label.
vector eigenVector(const tensor &, const scalar lambda)
virtual const faceList & faces() const
Return raw faces.
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.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
virtual const labelList & faceNeighbour() const
Return face neighbour.
label prevLabel(const label i) const
Previous vertex on face.
bool found(const Key &) const
Return true if hashedEntry is found in table.
defineTypeNameAndDebug(combustionModel, 0)
prefixOSstream Pout(cout,"Pout")
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
static const label labelMax
label countPointUsage(const scalar minCos, boolList &pointCanBeDeleted) const
Mark in pointCanBeDeleted the points that can be deleted.
bool insert(const Key &key)
Insert a new entry.