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
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)
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)
892 collapseEdge[edgeI] =
false;
904 void Foam::edgeCollapser::determineDuplicatePointsOnFace
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;
954 const label pointi = f[fpI];
964 const label prevNewPointi
965 = allPointInfo[prevPointi].collapseIndex();
967 if (newPointi != prevNewPointi)
978 bool Foam::edgeCollapser::isFaceCollapsed
984 label nEdges = countEdgesOnFace(f, allPointInfo);
1011 const edgeList& edges = mesh_.edges();
1013 label nCollapsed = 0;
1018 allPointInfo.
clear();
1019 allPointInfo.
setSize(mesh_.nPoints());
1031 if (collapseEdge[edgeI])
1033 const edge& e = edges[edgeI];
1038 if (pointPriority[e.
end()] > pointPriority[e.
start()])
1040 masterPointi = e.
end();
1043 label masterPointPriority = pointPriority[masterPointi];
1047 if (!collapsePointToLocation.
found(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];
1084 initPointInfo.append(pec);
1085 initPoints.append(e.
start());
1087 initPointInfo.append(pec);
1088 initPoints.append(e.
end());
1101 mesh_.globalData().nTotalPoints()
1108 void Foam::edgeCollapser::filterFace
1121 label pointi = f[fp];
1123 label collapseIndex = allPointInfo[pointi].collapseIndex();
1126 if (collapseStrings.found(collapseIndex))
1128 label localPointi = collapseStrings[collapseIndex][0];
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++)
1163 label pointi = f[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)
1222 maxCollapseFaceToPointSideLengthCoeff_
1224 dict.
lookupOrDefault<scalar>(
"maxCollapseFaceToPointSideLengthCoeff", 0)
1226 allowEarlyCollapseToPoint_
1230 allowEarlyCollapseCoeff_
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_
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);
1330 collapseStrings.resize(2*nPerIndex.size());
1337 forAll(allPointInfo, pointi)
1339 const label collapseIndex = allPointInfo[pointi].collapseIndex();
1341 if (collapseIndex != -1 && collapseIndex != -2)
1343 collapseStrings[collapseIndex].
append(pointi);
1377 label nUnvisited = 0;
1378 label nUncollapsed = 0;
1379 label nCollapsed = 0;
1407 Info<<
indent <<
"Number of points : " << nPoints <<
nl 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])
1428 const cell& cFaces = cells[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)
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];
1594 nei = faceNeighbour[facei];
1630 const bool allowCellCollapse
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();
1717 if (collapseEdge[edgeI] && nbrIndex == index)
1719 collapseEdge[edgeI] =
false;
1726 if (!allowCellCollapse)
1731 const cell& cFaces = cells[celli];
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];
1758 if (collapseEdge[edgeI])
1760 collapseEdge[edgeI] =
false;
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)
1812 label nCollapsed = 0;
1816 const edge& e = edges[edgeI];
1818 if (!collapseEdge[edgeI])
1820 if (e.
mag(points) < minEdgeLen[edgeI])
1822 collapseEdge[edgeI] =
true;
1824 label masterPointi = edgeMaster(pointPriority, e);
1826 if (masterPointi == -1)
1829 = 0.5*(points[e.
start()] + points[e.
end()]);
1835 const point& collapsePt = points[masterPointi];
1837 collapsePointToLocation.
set(masterPointi, collapsePt);
1852 const scalar maxCos,
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];
1888 if (!collapseEdge[e0] && !collapseEdge[e1])
1891 scalar e0length =
mag 1893 points[edges[e0][0]] - points[edges[e0][1]]
1896 scalar e1length =
mag 1898 points[edges[e1][0]] - points[edges[e1][1]]
1901 if (e0length <= e1length)
1903 collapseEdge[e0] =
true;
1905 checkBoundaryPointMergeEdges
1908 edges[e0].otherVertex(pointi),
1910 collapsePointToLocation
1915 collapseEdge[e1] =
true;
1917 checkBoundaryPointMergeEdges
1920 edges[e1].otherVertex(pointi),
1922 collapsePointToLocation
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,
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);
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,
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);
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 fvPatchList & patches
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)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
Ostream & indent(Ostream &os)
Indent stream.
edgeCollapser(const polyMesh &mesh)
Construct from 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...
const labelListList & faceEdges() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
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.
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/any.
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.
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.
const meshPointZones & pointZones() const
Return point zones.
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.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
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.
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
Return scalar magnitude.
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
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.
static vector centre(const PointField &ps)
Return centre point given face points.
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 occurrence 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.
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.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
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 meshFaceZones & faceZones() const
Return face zones.
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.