ENH: add single-parameter sortedOrder() function

This commit is contained in:
Mark Olesen
2019-07-17 11:08:40 +02:00
committed by Andrew Heather
parent 5788fe056c
commit 1d86fc4f6b
33 changed files with 134 additions and 117 deletions

View File

@ -58,10 +58,12 @@ int main(int argc, char *argv[])
SortableList<label> list1r(list1.size());
list1r = list1;
Info<< "unsorted: " << orig << endl;
Info<< "unsorted: " << orig << nl
<< "order: " << sortedOrder(list1) << endl;
sort(list1);
Info<< "sorted: " << list1 << nl
<< "indices: " << order << endl;
<< "indices: " << order << nl
<< "order: " << sortedOrder(list1) << endl;
list1r.reverseSort();
Info<< "reverse ..." << nl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2012-2017 OpenFOAM Foundation
@ -67,9 +67,7 @@ void Foam::DelaunayMesh<Triangulation>::sortFaces
<< "Sorting faces, owner and neighbour into upper triangular order"
<< endl;
labelList oldToNew;
sortedOrder(ownerNeighbourPair, oldToNew);
labelList oldToNew(sortedOrder(ownerNeighbourPair));
oldToNew = invert(oldToNew.size(), oldToNew);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2012-2016 OpenFOAM Foundation
@ -1322,8 +1322,7 @@ void Foam::conformalVoronoiMesh::indexDualVertices
// Sort the vertices so that they will be in the same order on
// each processor
labelList oldToNew;
sortedOrder(cellVerticesPair, oldToNew);
labelList oldToNew(sortedOrder(cellVerticesPair));
oldToNew = invert(oldToNew.size(), oldToNew);
inplaceReorder(oldToNew, cellVertices);
@ -2406,10 +2405,7 @@ void Foam::conformalVoronoiMesh::sortFaces
<< "Sorting faces, owner and neighbour into upper triangular order"
<< endl;
labelList oldToNew;
sortedOrder(ownerNeighbourPair, oldToNew);
labelList oldToNew(sortedOrder(ownerNeighbourPair));
oldToNew = invert(oldToNew.size(), oldToNew);
inplaceReorder(oldToNew, faces);
@ -2459,10 +2455,7 @@ void Foam::conformalVoronoiMesh::sortProcPatches
<< exit(FatalError) << endl;
}
labelList oldToNew;
sortedOrder(sortingIndices, oldToNew);
labelList oldToNew(sortedOrder(sortingIndices));
oldToNew = invert(oldToNew.size(), oldToNew);
inplaceReorder(oldToNew, sortingIndices);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -226,12 +226,10 @@ labelList getFaceOrder
}
}
order.setSize(nbr.size());
sortedOrder(nbr, order);
forAll(order, i)
for (const label index : order)
{
label index = order[i];
if (nbr[index] != -1)
{
oldToNewFace[cFaces[index]] = newFacei++;
@ -495,8 +493,7 @@ autoPtr<mapPolyMesh> reorderMesh
newFlipMap[i] = fZone.flipMap()[i];
}
}
labelList newToOld;
sortedOrder(newAddressing, newToOld);
labelList newToOld(sortedOrder(newAddressing));
fZone.resetAddressing
(
labelUIndList(newAddressing, newToOld)(),
@ -1010,8 +1007,7 @@ int main(int argc, char *argv[])
bndCellMap.setSize(nBndCells);
// Sort
labelList order;
sortedOrder(bndCellMap, order);
labelList order(sortedOrder(bndCellMap));
// Redo newReverseCellOrder
labelList newReverseCellOrder(mesh.nCells(), -1);

View File

@ -177,6 +177,10 @@ template<class Container>
label inplaceMapValue(const Map<label>& mapper, Container& input);
//- Return the (stable) sort order for the list
template<class T>
labelList sortedOrder(const UList<T>& input);
//- Generate the (stable) sort order for the list
template<class T>
void sortedOrder(const UList<T>& input, labelList& order);
@ -191,6 +195,10 @@ void sortedOrder
);
//- Return (sorted) indices corresponding to duplicate list values
template<class T>
labelList duplicateOrder(const UList<T>& input);
//- Generate (sorted) indices corresponding to duplicate list values
template<class T>
void duplicateOrder(const UList<T>& input, labelList& order);
@ -206,6 +214,10 @@ void duplicateOrder
);
//- Return (sorted) indices corresponding to unique list values
template<class T>
labelList uniqueOrder(const UList<T>& input);
//- Generate (sorted) indices corresponding to unique list values
template<class T>
void uniqueOrder(const UList<T>& input, labelList& order);

View File

@ -320,6 +320,18 @@ Foam::label Foam::inplaceMapValue
}
template<class T>
Foam::labelList Foam::sortedOrder
(
const UList<T>& input
)
{
labelList order(input.size());
sortedOrder(input, order, typename UList<T>::less(input));
return order;
}
template<class T>
void Foam::sortedOrder
(
@ -355,6 +367,18 @@ void Foam::sortedOrder
}
template<class T>
Foam::labelList Foam::duplicateOrder
(
const UList<T>& input
)
{
labelList order(input.size());
duplicateOrder(input, order, typename UList<T>::less(input));
return order;
}
template<class T>
void Foam::duplicateOrder
(
@ -396,6 +420,18 @@ void Foam::duplicateOrder
}
template<class T>
Foam::labelList Foam::uniqueOrder
(
const UList<T>& input
)
{
labelList order(input.size());
uniqueOrder(input, order, typename UList<T>::less(input));
return order;
}
template<class T>
void Foam::uniqueOrder
(

View File

@ -49,6 +49,10 @@ SourceFiles
namespace Foam
{
//- Return (stable) sort order for the list
template<class T>
labelList sortedOrder(const UPtrList<T>& input);
//- Generate (stable) sort order for the list
template<class T>
void sortedOrder(const UPtrList<T>& input, labelList& order);

View File

@ -27,6 +27,18 @@ License
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
template<class T>
Foam::labelList Foam::sortedOrder
(
const UPtrList<T>& input
)
{
labelList order(input.size());
sortedOrder(input, order, typename PtrListOps::less<T>(input));
return order;
}
template<class T>
void Foam::sortedOrder
(
@ -65,7 +77,7 @@ void Foam::sortedOrder
template<class T>
void Foam::sort(UPtrList<T>& list)
{
labelList order;
labelList order(input.size());
sortedOrder(list, order);
list.sortOrder(order, false); // false = allow nullptr
}
@ -74,7 +86,7 @@ void Foam::sort(UPtrList<T>& list)
template<class T, class Compare>
void Foam::sort(UPtrList<T>& list, const Compare& comp)
{
labelList order;
labelList order(input.size());
sortedOrder(list, order, comp);
list.sortOrder(order, false); // false = allow nullptr
}
@ -83,7 +95,7 @@ void Foam::sort(UPtrList<T>& list, const Compare& comp)
template<class T>
void Foam::shuffle(UPtrList<T>& list)
{
labelList order = identity(list.size());
labelList order(identity(list.size()));
Foam::shuffle(order);
list.sortOrder(order, false); // false = allow nullptr
}

View File

@ -190,8 +190,7 @@ Foam::procFacesGAMGProcAgglomeration::processorAgglomeration
}
// Sort according to master and redo restriction
labelList newToOld;
sortedOrder(coarseToMaster, newToOld);
labelList newToOld(sortedOrder(coarseToMaster));
labelList oldToNew(invert(newToOld.size(), newToOld));
fineToCoarse = labelUIndList(oldToNew, fineToCoarse)();

View File

@ -182,16 +182,14 @@ Foam::labelList Foam::lduPrimitiveMesh::upperTriOrder
label nNbr = offsets[celli+1] - startOfCell;
nbr.setSize(nNbr);
order.setSize(nNbr);
forAll(order, i)
forAll(nbr, i)
{
nbr[i] = upper[cellToFaces[offsets[celli]+i]];
}
sortedOrder(nbr, order);
forAll(order, i)
for (const label index : order)
{
label index = order[i];
oldToNew[cellToFaces[startOfCell + index]] = newFacei++;
}
}
@ -807,8 +805,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
);
}
labelList order;
sortedOrder(procPairs, order);
labelList order(sortedOrder(procPairs));
// Count
label n = 0;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -84,8 +84,7 @@ Foam::label Foam::mergePoints
{
magSqrDist[pointi] = magSqr(points[pointi] - compareOrigin);
}
labelList order;
Foam::sortedOrder(magSqrDist, order);
labelList order(Foam::sortedOrder(magSqrDist));
Field<scalar> sortedTol(nPoints);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -771,8 +771,10 @@ void Foam::fileFormats::STARCDMeshReader::readBoundary
// Sort according to ascending region numbers, but leave
// "Default_Boundary_Region" as the final patch
{
labelList sortedIndices;
sortedOrder(SubList<label>(origRegion, nPatches-1), sortedIndices);
labelList sortedIndices
(
sortedOrder(SubList<label>(origRegion, nPatches-1))
);
labelList oldToNew = identity(nPatches);
forAll(sortedIndices, i)

View File

@ -1183,8 +1183,8 @@ void Foam::polyMeshAdder::mergeFaceZones
fzFaces[i].shrink();
fzFlips[i].shrink();
labelList order;
sortedOrder(fzFaces[i], order);
labelList order(sortedOrder(fzFaces[i]));
fzFaces[i] = labelUIndList(fzFaces[i], order)();
fzFlips[i] = boolUIndList(fzFlips[i], order)();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
@ -583,9 +583,7 @@ Foam::edgeCollapser::collapseType Foam::edgeCollapser::collapseFace
// Sort the projected distances and the corresponding vertex
// indices along the collapse axis
labelList oldToNew;
sortedOrder(d, oldToNew);
labelList oldToNew(sortedOrder(d));
oldToNew = invert(oldToNew.size(), oldToNew);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
@ -725,7 +725,6 @@ void Foam::polyTopoChange::getFaceOrder
label nFaces = cellFaceOffsets[celli+1] - startOfCell;
// Neighbouring cells
//SortableList<label> nbr(nFaces);
nbr.setSize(nFaces);
for (label i = 0; i < nFaces; i++)
@ -765,21 +764,10 @@ void Foam::polyTopoChange::getFaceOrder
}
}
//nbr.sort();
order.setSize(nFaces);
sortedOrder(nbr, order);
//forAll(nbr, i)
//{
// if (nbr[i] != -1)
// {
// oldToNew[cellFaces[startOfCell + nbr.indices()[i]]] =
// newFacei++;
// }
//}
forAll(order, i)
for (const label index : order)
{
label index = order[i];
if (nbr[index] != -1)
{
oldToNew[cellFaces[startOfCell + index]] = newFacei++;
@ -1672,8 +1660,7 @@ void Foam::polyTopoChange::resetZones
// Sort the addressing
forAll(addressing, zonei)
{
labelList newToOld;
sortedOrder(addressing[zonei], newToOld);
labelList newToOld(sortedOrder(addressing[zonei]));
{
labelList newAddressing(addressing[zonei].size());
forAll(newAddressing, i)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
isoAdvector | Copyright (C) 2016-2017 DHI
@ -299,8 +299,7 @@ void Foam::isoCutCell::calcIsoFacePointsFromEdges()
DebugPout<< "Calculated isoFace point angles" << endl;
// Sorting isoface points by angle and inserting into isoFacePoints_
labelList order(unsortedIsoFacePointAngles.size());
Foam::sortedOrder(unsortedIsoFacePointAngles, order);
labelList order(sortedOrder(unsortedIsoFacePointAngles));
isoFacePoints_.append(unsortedIsoFacePoints[order[0]]);
for (label pi = 1; pi < order.size(); pi++)
{
@ -508,8 +507,7 @@ Foam::label Foam::isoCutCell::vofCutCell
{
fvert[pi] = f_[pLabels[pi]];
}
labelList order(fvert.size());
sortedOrder(fvert, order);
labelList order(sortedOrder(fvert));
scalar f1 = fvert[order.first()];
scalar f2 = fvert[order.last()];

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
isoAdvector | Copyright (C) 2016-2017 DHI
@ -496,8 +496,7 @@ Foam::scalar Foam::isoCutFace::timeIntegratedArea
scalar tIntArea = 0.0;
// Finding ordering of vertex points
labelList order(pTimes.size());
sortedOrder(pTimes, order);
labelList order(sortedOrder(pTimes));
const scalar firstTime = pTimes[order.first()];
const scalar lastTime = pTimes[order.last()];

View File

@ -388,8 +388,7 @@ void Foam::functionObjects::externalCoupled::checkOrder
const wordList& regionNames
)
{
labelList order;
sortedOrder(regionNames, order);
labelList order(sortedOrder(regionNames));
if (order != identity(regionNames.size()))
{
FatalErrorInFunction

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
@ -97,8 +97,7 @@ void Foam::PatchPostProcessing<CloudType>::write()
accessOp<List<scalar>>()
);
labelList indices;
sortedOrder(globalTimes, indices);
labelList indices(sortedOrder(globalTimes));
string header("# Time currentProc " + parcelType::propertyList_);
patchOutFile<< header.c_str() << nl;

View File

@ -375,14 +375,13 @@ void Foam::PairCollision<CloudType>::wallInteraction()
// ascending distance to their nearest point so that
// grouping occurs around the closest in any group
labelList sortedOtherSiteIndices;
labelList sortedOtherSiteIndices
(
sortedOrder(otherSiteDistances)
);
sortedOrder(otherSiteDistances, sortedOtherSiteIndices);
forAll(sortedOtherSiteIndices, siteI)
for (const label orderedIndex : sortedOtherSiteIndices)
{
label orderedIndex = sortedOtherSiteIndices[siteI];
const point& otherPt = otherSitePoints[orderedIndex];
if

View File

@ -110,8 +110,8 @@ void Foam::InjectedParticleInjection<CloudType>::initialise()
}
// Sort and renumber to ensure lists in ascending time
labelList sortedIndices;
Foam::sortedOrder(time, sortedIndices);
labelList sortedIndices(Foam::sortedOrder(time));
time_ = UIndirectList<scalar>(time, sortedIndices);
position_ = UIndirectList<point>(position, sortedIndices);
diameter_ = UIndirectList<scalar>(diameter, sortedIndices);

View File

@ -2639,8 +2639,7 @@ Foam::label Foam::meshRefinement::findRegions
);
// Sort according to curveDist
labelList indexSet;
Foam::sortedOrder(allDist, indexSet);
labelList indexSet(Foam::sortedOrder(allDist));
allLeakPaths.set
(

View File

@ -186,11 +186,9 @@ void Foam::meshRefinement::collectAndPrint
scalarField magAllPoints(mag(allPoints-point(-0.317, 0.117, 0.501)));
labelList visitOrder;
sortedOrder(magAllPoints, visitOrder);
forAll(visitOrder, i)
labelList visitOrder(sortedOrder(magAllPoints));
for (const label allPointi : visitOrder)
{
label allPointi = visitOrder[i];
Info<< allPoints[allPointi] << " : " << allData[allPointi]
<< endl;
}

View File

@ -2138,8 +2138,7 @@ Foam::label Foam::snappyRefineDriver::directionalSmooth
}
// Sort the normalized position
labelList order;
sortedOrder(normalizedPosition, order);
labelList order(sortedOrder(normalizedPosition));
DynamicList<scalar> seedPointDist;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2015 OpenFOAM Foundation
@ -724,8 +724,7 @@ void Foam::snappySnapDriver::correctAttraction
// Tangential component along edge
scalar tang = ((pt-edgePt)&edgeNormal);
labelList order;
Foam::sortedOrder(surfaceCounts, order);
labelList order(sortedOrder(surfaceCounts));
if (order[0] < order[1])
{

View File

@ -45,8 +45,7 @@ namespace Foam
void Foam::cellZoneSet::updateSet()
{
labelList order;
sortedOrder(addressing_, order);
labelList order(sortedOrder(addressing_));
inplaceReorder(order, addressing_);
cellSet::clearStorage();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
@ -49,8 +49,7 @@ namespace Foam
void Foam::faceZoneSet::updateSet()
{
labelList order;
sortedOrder(addressing_, order);
labelList order(sortedOrder(addressing_));
addressing_ = labelUIndList(addressing_, order)();
flipMap_ = boolUIndList(flipMap_, order)();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
@ -46,8 +46,7 @@ namespace Foam
void Foam::pointZoneSet::updateSet()
{
labelList order;
sortedOrder(addressing_, order);
labelList order(sortedOrder(addressing_));
inplaceReorder(order, addressing_);
pointSet::clearStorage();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
@ -161,8 +161,7 @@ Foam::labelList Foam::springRenumber::renumber
//writeOBJ("endPosition.obj", cellCells, position);
// Move cells to new position
labelList shuffle;
sortedOrder(position, shuffle);
labelList shuffle(sortedOrder(position));
// Reorder oldToNew
inplaceReorder(shuffle, oldToNew);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -85,8 +85,7 @@ void Foam::MeshedSurface<Face>::sortFacesAndStore
// Determine the sorted order:
// use sortedOrder directly since we discard the intermediate list anyhow
List<label> faceMap;
sortedOrder(zones, faceMap);
labelList faceMap(sortedOrder(zones));
zones.clear();
// Sorted faces

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -164,8 +164,7 @@ bool Foam::fileFormats::STLsurfaceFormat<Face>::read
{
// Determine the sorted order:
// use sortedOrder directly (the intermediate list is discarded anyhow)
labelList faceMap;
sortedOrder(zoneIds, faceMap);
labelList faceMap(sortedOrder(zoneIds));
// Generate sorted faces
forAll(faceMap, facei)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -124,8 +124,7 @@ bool Foam::fileFormats::TRIsurfaceFormat<Face>::read
{
// Determine the sorted order:
// use sortedOrder directly (the intermediate list is discared anyhow)
labelList faceMap;
sortedOrder(zoneIds, faceMap);
labelList faceMap(sortedOrder(zoneIds));
// Generate sorted faces
forAll(faceMap, facei)

View File

@ -304,7 +304,7 @@ Foam::triSurface::calcPatches(labelList& faceMap) const
// Determine the sorted order:
// use sortedOrder directly (the intermediate list is discarded anyhow)
List<label> regions(size());
labelList regions(size());
forAll(regions, facei)
{
regions[facei] = operator[](facei).region();