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:
@ -353,12 +353,12 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
Info<< "Mirroring cell shapes." << endl;
|
||||
|
||||
Info<< nl << "Creating new mesh" << endl;
|
||||
mirrorMeshPtr_ = new fvMesh
|
||||
mirrorMeshPtr_ = autoPtr<fvMesh>::New
|
||||
(
|
||||
io,
|
||||
xferMove(newPoints),
|
||||
xferMove(newFaces),
|
||||
xferMove(newCells)
|
||||
std::move(newPoints),
|
||||
std::move(newFaces),
|
||||
std::move(newCells)
|
||||
);
|
||||
|
||||
fvMesh& pMesh = *mirrorMeshPtr_;
|
||||
@ -381,10 +381,4 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::mirrorFvMesh::~mirrorFvMesh()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -55,21 +55,20 @@ class mirrorFvMesh
|
||||
IOdictionary mirrorMeshDict_;
|
||||
|
||||
//- Mirrored mesh
|
||||
fvMesh* mirrorMeshPtr_;
|
||||
autoPtr<fvMesh> mirrorMeshPtr_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
mirrorFvMesh(const mirrorFvMesh&);
|
||||
//- Disallow copy construct
|
||||
mirrorFvMesh(const mirrorFvMesh&) = delete;
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const mirrorFvMesh&);
|
||||
//- Disallow copy assignment
|
||||
void operator=(const mirrorFvMesh&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from IOobject
|
||||
@ -77,7 +76,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
~mirrorFvMesh();
|
||||
~mirrorFvMesh() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -461,10 +461,10 @@ autoPtr<mapPolyMesh> reorderMesh
|
||||
|
||||
mesh.resetPrimitives
|
||||
(
|
||||
Xfer<pointField>::null(),
|
||||
xferMove(newFaces),
|
||||
xferMove(newOwner),
|
||||
xferMove(newNeighbour),
|
||||
autoPtr<pointField>(), // <- null: leaves points untouched
|
||||
autoPtr<faceList>::New(std::move(newFaces)),
|
||||
autoPtr<labelList>::New(std::move(newOwner)),
|
||||
autoPtr<labelList>::New(std::move(newNeighbour)),
|
||||
patchSizes,
|
||||
patchStarts,
|
||||
true
|
||||
|
||||
@ -521,7 +521,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
cutZoneName,
|
||||
true // verbose
|
||||
).resetAddressing(faceIds.xfer(), false);
|
||||
).resetAddressing(std::move(faceIds), false);
|
||||
|
||||
|
||||
// Add the perfect interface mesh modifier
|
||||
@ -551,7 +551,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mergePatchName + "MasterZone",
|
||||
true // verbose
|
||||
).resetAddressing(faceIds.xfer(), false);
|
||||
).resetAddressing(std::move(faceIds), false);
|
||||
|
||||
// Markup slave face ids
|
||||
faceIds.setSize(slavePatch.size());
|
||||
@ -561,7 +561,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mergePatchName + "SlaveZone",
|
||||
true // verbose
|
||||
).resetAddressing(faceIds.xfer(), false);
|
||||
).resetAddressing(std::move(faceIds), false);
|
||||
|
||||
// Add empty zone for cut faces
|
||||
mesh.faceZones()
|
||||
|
||||
Reference in New Issue
Block a user