mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: remove reliance on the Xfer class (issue #639)
This class is largely a pre-C++11 holdover. It is now possible to simply use move construct/assignment directly. In a few rare cases (eg, polyMesh::resetPrimitives) it has been replaced by an autoPtr.
This commit is contained in:
@ -56,19 +56,17 @@ bool Foam::cellVolumeWeightMethod::findInitialSeeds
|
||||
const faceList& srcFaces = src_.faces();
|
||||
const pointField& srcPts = src_.points();
|
||||
|
||||
for (label i = startSeedI; i < srcCellIDs.size(); i++)
|
||||
for (label i = startSeedI; i < srcCellIDs.size(); ++i)
|
||||
{
|
||||
label srcI = srcCellIDs[i];
|
||||
const label srcI = srcCellIDs[i];
|
||||
|
||||
if (mapFlag[srcI])
|
||||
{
|
||||
const pointField
|
||||
pts(srcCells[srcI].points(srcFaces, srcPts).xfer());
|
||||
const pointField pts(srcCells[srcI].points(srcFaces, srcPts));
|
||||
|
||||
forAll(pts, ptI)
|
||||
for (const point& pt : pts)
|
||||
{
|
||||
const point& pt = pts[ptI];
|
||||
label tgtI = tgt_.cellTree().findInside(pt);
|
||||
const label tgtI = tgt_.cellTree().findInside(pt);
|
||||
|
||||
if (tgtI != -1 && intersect(srcI, tgtI))
|
||||
{
|
||||
|
||||
@ -469,10 +469,10 @@ void Foam::meshToMesh::calculate(const word& methodName, const bool normalise)
|
||||
tgtRegion_.time(),
|
||||
IOobject::NO_READ
|
||||
),
|
||||
xferMove(newTgtPoints),
|
||||
xferMove(newTgtFaces),
|
||||
xferMove(newTgtFaceOwners),
|
||||
xferMove(newTgtFaceNeighbours),
|
||||
std::move(newTgtPoints),
|
||||
std::move(newTgtFaces),
|
||||
std::move(newTgtFaceOwners),
|
||||
std::move(newTgtFaceNeighbours),
|
||||
false // no parallel comms
|
||||
);
|
||||
|
||||
|
||||
@ -246,17 +246,12 @@ Foam::autoPtr<Foam::mapDistribute> Foam::meshToMesh::calcProcMap
|
||||
}
|
||||
}
|
||||
|
||||
autoPtr<mapDistribute> mapPtr
|
||||
return autoPtr<mapDistribute>::New
|
||||
(
|
||||
new mapDistribute
|
||||
(
|
||||
segmentI, // size after construction
|
||||
sendMap.xfer(),
|
||||
constructMap.xfer()
|
||||
)
|
||||
segmentI, // size after construction
|
||||
std::move(sendMap),
|
||||
std::move(constructMap)
|
||||
);
|
||||
|
||||
return mapPtr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user