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);
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);
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)
666 <<
"All points on one side of face centre, not collapsing." 676 if (
magSqr(collapseAxis) < VSMALL)
680 else if (fA < aspectRatio*
sqr(targetFaceSize*collapseSizeLimitCoeff))
684 allowEarlyCollapseToPoint_
685 && (d.last() - d.first())
687 *allowEarlyCollapseCoeff_*maxCollapseFaceToPointSideLengthCoeff_
694 (dNeg.
last() < guardFraction_*dNeg.
first())
695 && (dPos.
first() > guardFraction_*dPos.
last())
698 typeOfCollapse = toEdge;
702 (d.last() - d.first())
704 *maxCollapseFaceToPointSideLengthCoeff_
723 collapsePointToLocation
726 else if (typeOfCollapse == toEdge)
741 collapsePointToLocation
745 return typeOfCollapse;
755 label masterPoint = -1;
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,
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
862 const edgeList& edges = mesh_.edges();
865 label nUncollapsed = 0;
871 const edge& e = edges[eI];
873 const label startCollapseIndex
874 = allPointInfo[e.
start()].collapseIndex();
876 if (startCollapseIndex != -1 && startCollapseIndex != -2)
878 const label endCollapseIndex
879 = allPointInfo[e.
end()].collapseIndex();
884 && startCollapseIndex == endCollapseIndex
889 forAll(ptEdgesStart, ptEdgeI)
891 const label edgeI = ptEdgesStart[ptEdgeI];
893 const label nbrPointi
894 = edges[edgeI].otherVertex(e.
start());
896 = allPointInfo[nbrPointi].collapseIndex();
901 && nbrIndex == startCollapseIndex
904 collapseEdge[edgeI] =
false;
917 void Foam::edgeCollapser::determineDuplicatePointsOnFace
926 uniqueCollapses.
clear();
927 duplicateCollapses.
clear();
931 label index = allPointInfo[f[fpI]].collapseIndex();
934 if (index != allPointInfo[f.
prevLabel(fpI)].collapseIndex())
936 if (!uniqueCollapses.
insert(index))
939 duplicateCollapses.
insert(index);
948 label index = allPointInfo[f[fpI]].collapseIndex();
949 if (duplicateCollapses.
found(index))
951 markedPoints[f[fpI]] =
true;
967 const label pointi = f[fpI];
977 const label prevNewPointi
978 = allPointInfo[prevPointi].collapseIndex();
980 if (newPointi != prevNewPointi)
991 bool Foam::edgeCollapser::isFaceCollapsed
997 label nEdges = countEdgesOnFace(f, allPointInfo);
1024 const edgeList& edges = mesh_.edges();
1026 label nCollapsed = 0;
1031 allPointInfo.
clear();
1032 allPointInfo.
setSize(mesh_.nPoints());
1044 if (collapseEdge[edgeI])
1046 const edge& e = edges[edgeI];
1051 if (pointPriority[e.
end()] > pointPriority[e.
start()])
1053 masterPointi = e.
end();
1056 label masterPointPriority = pointPriority[masterPointi];
1060 if (!collapsePointToLocation.
found(masterPointi))
1064 if (!collapsePointToLocation.
found(otherVertex))
1067 << masterPointi <<
" on edge " << edgeI <<
" " << e
1068 <<
" is not marked for collapse." 1073 masterPointi = otherVertex;
1074 masterPointPriority = pointPriority[masterPointi];
1075 index = globalPoints.
toGlobal(masterPointi);
1079 const point& collapsePoint = collapsePointToLocation[masterPointi];
1097 initPointInfo.append(pec);
1098 initPoints.append(e.
start());
1100 initPointInfo.append(pec);
1101 initPoints.append(e.
end());
1114 mesh_.globalData().nTotalPoints()
1121 void Foam::edgeCollapser::filterFace
1134 label pointi = f[fp];
1136 label collapseIndex = allPointInfo[pointi].collapseIndex();
1139 if (collapseStrings.found(collapseIndex))
1141 label localPointi = collapseStrings[collapseIndex][0];
1145 f[newFp++] = localPointi;
1148 else if (collapseIndex == -1)
1151 <<
"Point " << pointi <<
" was not visited by PointEdgeWave" 1156 f[newFp++] = pointi;
1167 const label size = newFp;
1171 for (
label fp = 2; fp < size; fp++)
1176 label pointi = f[fp];
1184 <<
"Removing consecutive duplicate vertex in face " 1188 else if (index == fp2)
1191 <<
"Removing non-consecutive duplicate vertex in face " 1196 else if (index != -1)
1199 <<
"Pinched face " << f <<
endl;
1200 f[newFp++] = pointi;
1204 f[newFp++] = pointi;
1214 Foam::edgeCollapser::edgeCollapser(
const polyMesh& mesh)
1218 maxCollapseFaceToPointSideLengthCoeff_(0),
1219 allowEarlyCollapseToPoint_(false),
1220 allowEarlyCollapseCoeff_(0)
1224 Foam::edgeCollapser::edgeCollapser
1235 maxCollapseFaceToPointSideLengthCoeff_
1237 dict.
lookupOrDefault<scalar>(
"maxCollapseFaceToPointSideLengthCoeff", 0)
1239 allowEarlyCollapseToPoint_
1243 allowEarlyCollapseCoeff_
1250 Info<<
"Edge Collapser Settings:" <<
nl 1251 <<
" Guard Fraction = " << guardFraction_ <<
nl 1252 <<
" Max collapse face to point side length = " 1253 << maxCollapseFaceToPointSideLengthCoeff_ <<
nl 1254 <<
" " << (allowEarlyCollapseToPoint_ ?
"Allow" :
"Do not allow")
1255 <<
" early collapse to point" <<
nl 1256 <<
" Early collapse coeff = " << allowEarlyCollapseCoeff_
1314 bool meshChanged =
false;
1324 forAll(allPointInfo, pointi)
1326 label collapseIndex = allPointInfo[pointi].collapseIndex();
1328 if (collapseIndex != -1 && collapseIndex != -2)
1331 if (fnd != nPerIndex.
end())
1337 nPerIndex.
insert(collapseIndex, 1);
1343 collapseStrings.resize(2*nPerIndex.size());
1350 forAll(allPointInfo, pointi)
1352 const label collapseIndex = allPointInfo[pointi].collapseIndex();
1354 if (collapseIndex != -1 && collapseIndex != -2)
1356 collapseStrings[collapseIndex].
append(pointi);
1390 label nUnvisited = 0;
1391 label nUncollapsed = 0;
1392 label nCollapsed = 0;
1420 Info<<
indent <<
"Number of points : " << nPoints <<
nl 1421 <<
indent <<
"Not visited : " << nUnvisited <<
nl 1422 <<
indent <<
"Not collapsed : " << nUncollapsed <<
nl 1423 <<
indent <<
"Collapsed : " << nCollapsed <<
nl 1431 filterFace(collapseStrings, allPointInfo, newFaces[facei]);
1435 label nCellCollapsed = 0;
1439 if (!cellRemoved[celli])
1441 const cell& cFaces = cells[celli];
1447 label facei = cFaces[i];
1449 if (newFaces[facei].size() < 3)
1455 Pout<<
"Cell:" << celli
1456 <<
" uses faces:" << cFaces
1457 <<
" of which too many are marked for removal:" 1464 if (newFaces[cFaces[j]].size() < 3)
1466 Pout<<
' '<< cFaces[j];
1471 cellRemoved[celli] =
true;
1486 Info<<
indent <<
"Collapsing " << nCellCollapsed <<
" cells" <<
endl;
1488 if (nCellCollapsed == 0)
1503 forAll(cellRemoved, celli)
1505 if (cellRemoved[celli])
1514 const face& f = newFaces[facei];
1522 doneFace[facei] =
true;
1529 usedPoint[f[fp]] =
true;
1535 forAll(usedPoint, pointi)
1537 if (!usedPoint[pointi])
1539 removedPoints[pointi] =
true;
1547 forAll(allPointInfo, pointi)
1549 const label collapseIndex = allPointInfo[pointi].collapseIndex();
1550 const point& collapsePoint = allPointInfo[pointi].collapsePoint();
1554 removedPoints[pointi] ==
false 1555 && collapseIndex != -1
1556 && collapseIndex != -2
1574 forAll(allPointInfo, pointi)
1576 if (removedPoints[pointi] ==
true)
1578 const labelList& changedFaces = pointFaces[pointi];
1580 forAll(changedFaces, changedFacei)
1582 label facei = changedFaces[changedFacei];
1584 if (!doneFace[facei])
1586 doneFace[facei] =
true;
1591 bool zoneFlip =
false;
1595 const faceZone& fZone = faceZones[zoneID];
1601 label own = faceOwner[facei];
1607 nei = faceNeighbour[facei];
1643 const bool allowCellCollapse
1659 label nUncollapsed = 0;
1677 collapsePointToLocation,
1688 const face& f = faces[facei];
1690 isCollapsedFace[facei] = isFaceCollapsed(f, allPointInfo);
1692 if (isCollapsedFace[facei] < 1)
1694 determineDuplicatePointsOnFace
1715 forAll(markedPoints, pointi)
1717 if (markedPoints[pointi])
1719 const label index = allPointInfo[pointi].collapseIndex();
1721 const labelList& ptEdges = pointEdges[pointi];
1725 const label edgeI = ptEdges[ptEdgeI];
1726 const label nbrPointi = edges[edgeI].otherVertex(pointi);
1727 const label nbrIndex
1728 = allPointInfo[nbrPointi].collapseIndex();
1730 if (collapseEdge[edgeI] && nbrIndex == index)
1732 collapseEdge[edgeI] =
false;
1741 if (!allowCellCollapse)
1746 const cell& cFaces = cells[celli];
1752 label facei = cFaces[fI];
1754 if (isCollapsedFace[facei])
1764 label facei = cFaces[fI];
1766 const labelList& fEdges = faceEdges[facei];
1771 label edgeI = fEdges[fEdgeI];
1773 if (collapseEdge[edgeI])
1775 collapseEdge[edgeI] =
false;
1779 markedEdges[edgeI] =
true;
1783 isCollapsedFace[facei] =
false;
1791 <<
"Cell " << celli <<
" " << cFaces <<
nl 1792 <<
"is " << nFaces <<
", " 1793 <<
"but cell collapse has been disabled." 1807 nUncollapsed += breakStringsAtEdges
1816 Info<<
" Uncollapsed edges = " << nUncollapsed <<
" / " 1819 if (nUncollapsed == 0)
1841 label nCollapsed = 0;
1845 const edge& e = edges[edgeI];
1847 if (!collapseEdge[edgeI])
1849 if (e.
mag(points) < minEdgeLen[edgeI])
1851 collapseEdge[edgeI] =
true;
1853 label masterPointi = edgeMaster(pointPriority, e);
1855 if (masterPointi == -1)
1858 = 0.5*(points[e.
start()] + points[e.
end()]);
1864 const point& collapsePt = points[masterPointi];
1866 collapsePointToLocation.
set(masterPointi, collapsePt);
1881 const scalar maxCos,
1900 label nCollapsed = 0;
1904 forAll(pointEdges, pointi)
1906 if (pointCanBeDeleted[pointi])
1908 const labelList& pEdges = pointEdges[pointi];
1910 if (pEdges.
size() == 2)
1914 label e0 = pEdges[0];
1915 label e1 = pEdges[1];
1917 if (!collapseEdge[e0] && !collapseEdge[e1])
1920 scalar e0length =
mag 1922 points[edges[e0][0]] - points[edges[e0][1]]
1925 scalar e1length =
mag 1927 points[edges[e1][0]] - points[edges[e1][1]]
1930 if (e0length <= e1length)
1932 collapseEdge[e0] =
true;
1934 checkBoundaryPointMergeEdges
1937 edges[e0].otherVertex(pointi),
1939 collapsePointToLocation
1944 collapseEdge[e1] =
true;
1946 checkBoundaryPointMergeEdges
1949 edges[e1].otherVertex(pointi),
1951 collapsePointToLocation
1976 const scalarField targetFaceSizes = calcTargetFaceSizes();
1979 label nCollapseToPoint = 0;
1980 label nCollapseToEdge = 0;
1984 const face& f = faces[fI];
1986 if (faceFilterFactor[fI] <= 0)
1996 targetFaceSizes[fI],
1998 collapsePointToLocation,
2006 else if (flagCollapseFace ==
toPoint)
2010 else if (flagCollapseFace ==
toEdge)
2017 <<
"Face is marked to be collapsed to " << flagCollapseFace
2018 <<
". Currently can only collapse to point/edge." 2023 return labelPair(nCollapseToPoint, nCollapseToEdge);
2038 const scalarField targetFaceSizes = calcTargetFaceSizes();
2041 label nCollapseToPoint = 0;
2042 label nCollapseToEdge = 0;
2051 const face& f = faces[fI];
2053 if (faceFilterFactor[fI] <= 0)
2063 targetFaceSizes[fI],
2065 collapsePointToLocation,
2073 else if (flagCollapseFace ==
toPoint)
2077 else if (flagCollapseFace ==
toEdge)
2084 <<
"Face is marked to be collapsed to " << flagCollapseFace
2085 <<
". Currently can only collapse to point/edge." 2090 return labelPair(nCollapseToPoint, nCollapseToEdge);
static bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces)
Check mesh with mesh settings in dict. Collects incorrect faces.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
A HashTable with keys but without contents.
void inplaceReorder(const labelUList &oldToNew, ListType &)
Inplace reorder the elements of a list.
#define forAll(list, i)
Loop across all elements in list.
bool empty() const
Return true if the UList is empty (ie, size() is 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.
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
Ostream & indent(Ostream &os)
Indent stream.
const faceZoneMesh & faceZones() const
Return face zone mesh.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
A face is a list of labels corresponding to mesh vertices.
edgeList edges() const
Return edges in face point ordering,.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const labelListList & faceEdges() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const labelList & faceNeighbour() const
Return face neighbour.
static HashSet< label > checkBadFaces(const polyMesh &mesh, const dictionary &meshQualityDict)
Calls motionSmoother::checkMesh and returns a set of bad faces.
const labelListList & pointEdges() const
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
const boolList & flipMap() const
Return face flip map.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
dimensionedVector eigenValues(const dimensionedTensor &dt)
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tensor inertia(const pointField &, const point &refPt=vector::zero, scalar density=1.0) const
Return the inertia tensor, with optional reference.
label markMergeEdges(const scalar maxCos, const labelList &pointPriority, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation) const
Mark (in collapseEdge) any edges to merge.
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.
point centre(const pointField &) const
Centre point of face.
const cellList & cells() const
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
void removePoint(const label, const label)
Remove/merge point.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
label otherVertex(const label a) const
Given one vertex, return the other.
bool insert(const Key &key)
Insert a new entry.
T & first()
Return the first element of the list.
void removeFace(const label, const label)
Remove/merge face.
label size() const
Return number of elements in table.
virtual const pointField & points() const
Return raw points.
label prevLabel(const label i) const
Previous vertex on face.
bool insert(const label &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
A List obtained as a section of another List.
labelList invert(const label len, const labelUList &)
Invert one-to-one map. Unmapped elements will be -1.
An ordered pair of two objects of type <T> with first() and second() elements.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
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.
const labelUList & faceCells() const
Return face-cell addressing.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
bool found(const Key &) const
Return true if hashedEntry is found in table.
void clear()
Clear the list, i.e. set size to zero.
const pointZoneMesh & pointZones() const
Return point zone mesh.
void clear()
Clear all entries from table.
void append(const T &)
Append an element at the end of the list.
virtual const labelList & faceOwner() const
Return face owner.
scalar mag(const pointField &) const
Magnitude of face area.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
Pair< label > labelPair
Label pair.
PointFrompoint toPoint(const Foam::point &p)
static const label labelMax
scalar mag(const pointField &) const
Return scalar magnitude.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
virtual const faceList & faces() const
Return raw faces.
label collapseIndex() const
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
static direction size()
Return the number of elements in the VectorSpace = Ncmpts.
static label checkMeshQuality(const polyMesh &mesh, const dictionary &meshQualityDict, PackedBoolList &isErrorPoint)
Check mesh and mark points on faces in error.
defineTypeNameAndDebug(combustionModel, 0)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
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.
dimensionedTensor eigenVectors(const dimensionedTensor &dt)
label longestEdge(const face &f, const pointField &pts)
Find the longest edge on a face. Face point labels index into pts.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
label countPointUsage(const scalar minCos, boolList &pointCanBeDeleted) const
Mark in pointCanBeDeleted the points that can be deleted.
void setSize(const label)
Reset size of List.
bool set(const label &, const T &newElmt)
Assign a new hashedEntry, overwriting existing entries.
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.
label toGlobal(const label i) const
From local to global.
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.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define WarningInFunction
Report a warning using Foam::Warning.
label markSmallEdges(const scalarField &minEdgeLen, const labelList &pointPriority, PackedBoolList &collapseEdge, Map< point > &collapsePointToLocation) const
Mark (in collapseEdge) any edges to collapse.
label end() const
Return end vertex label.
A cell is defined as a list of faces with extra functionality.
prefixOSstream Pout(cout, "Pout")
bool setRefinement(const List< pointEdgeCollapse > &allPointInfo, polyTopoChange &meshMod) const
Play commands into polyTopoChange to create mesh.
const vectorField & faceAreas() const
Direct mesh changes based on v1.3 polyTopoChange syntax.
label start() const
Return start label of this patch in the polyMesh face list.
void modifyPoint(const label, const point &, const label newZoneID, const bool inCell)
Modify coordinate.
const labelListList & pointFaces() const
dimensioned< scalar > mag(const dimensioned< Type > &)
Determines length of string of edges walked to point.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Removes selected points from mesh and updates faces using these points.
Mesh consisting of general polyhedral cells.
A subset of mesh faces organised as a primitive patch.
A patch is a list of labels that address the faces in the global face list.
T & last()
Return the last element of the list.
label size() const
Return the number of elements in the UList.
void clear()
Clear the addressed list, i.e. set the size to zero.
Wave propagation of information through grid. Every iteration information goes through one layer of e...
Ostream & incrIndent(Ostream &os)
Increment the indent level.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
static const label labelMin
void removeCell(const label, const label)
Remove/merge cell.
label start() const
Return start vertex label.
A HashTable to objects of type <T> with a label key.