mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: use std::move() explicitly to avoid copying
This commit is contained in:
@ -988,7 +988,7 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::findOffsetPatchFaces
|
||||
offsetBoundaryCells.write();
|
||||
}
|
||||
|
||||
return offsetBoundaryCells;
|
||||
return std::move(offsetBoundaryCells);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1355,11 +1355,10 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::findRemainingProtrusionSet
|
||||
protrudingCells.insert(pCells);
|
||||
}
|
||||
|
||||
label protrudingCellsSize = protrudingCells.size();
|
||||
const label protrudingCellsSize =
|
||||
returnReduce(protrudingCells.size(), sumOp<label>());
|
||||
|
||||
reduce(protrudingCellsSize, sumOp<label>());
|
||||
|
||||
if (foamyHexMeshControls().objOutput() && protrudingCellsSize > 0)
|
||||
if (foamyHexMeshControls().objOutput() && protrudingCellsSize)
|
||||
{
|
||||
Info<< nl << "Found " << protrudingCellsSize
|
||||
<< " cells protruding from the surface, writing cellSet "
|
||||
@ -1369,7 +1368,7 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::findRemainingProtrusionSet
|
||||
protrudingCells.write();
|
||||
}
|
||||
|
||||
return protrudingCells;
|
||||
return std::move(protrudingCells);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -363,7 +363,7 @@ CGAL::indexedCell<Gt, Cb>::globallyOrderedCellVertices
|
||||
tVGI[i] = vertexMap[i];
|
||||
}
|
||||
|
||||
return tVGI;
|
||||
return std::move(tVGI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -98,7 +98,6 @@ Foam::labelList Foam::manualDecomp::decompose
|
||||
);
|
||||
|
||||
// Check if the final decomposition is OK
|
||||
|
||||
if (finalDecomp.size() != points.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
@ -111,18 +110,21 @@ Foam::labelList Foam::manualDecomp::decompose
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if (min(finalDecomp) < 0 || max(finalDecomp) > nDomains_ - 1)
|
||||
const label minVal = min(finalDecomp);
|
||||
const label maxVal = max(finalDecomp);
|
||||
|
||||
if (minVal < 0 || maxVal >= nDomains_)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "According to the decomposition, cells assigned to "
|
||||
<< "impossible processor numbers. Min processor = "
|
||||
<< min(finalDecomp) << " Max processor = " << max(finalDecomp)
|
||||
<< minVal << " Max processor = " << maxVal
|
||||
<< ".\n" << "Manual decomposition data read from file "
|
||||
<< dataFile_ << "." << endl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return finalDecomp;
|
||||
return std::move(finalDecomp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -76,8 +76,7 @@ Foam::labelList Foam::manualRenumber::renumber
|
||||
)
|
||||
);
|
||||
|
||||
// check if the final renumbering is OK
|
||||
|
||||
// Check if the final renumbering is OK
|
||||
if (newToOld.size() != points.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
@ -94,7 +93,7 @@ Foam::labelList Foam::manualRenumber::renumber
|
||||
labelList oldToNew(points.size(), -1);
|
||||
forAll(newToOld, i)
|
||||
{
|
||||
label origCelli = newToOld[i];
|
||||
const label origCelli = newToOld[i];
|
||||
|
||||
if (origCelli < 0 || origCelli >= points.size())
|
||||
{
|
||||
@ -122,7 +121,7 @@ Foam::labelList Foam::manualRenumber::renumber
|
||||
}
|
||||
}
|
||||
|
||||
return newToOld;
|
||||
return std::move(newToOld);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user