From 3d608bf06a7cff7d19b73f566e44d444c37c7562 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 5 Mar 2018 13:28:53 +0100 Subject: [PATCH] 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. --- .../chemFoam/createSingleCellMesh.H | 11 +- .../test/Dictionary/Test-Dictionary.C | 2 +- .../test/DynamicList/Test-DynamicList.C | 8 +- .../test/IListStream/Test-IListStream.C | 9 +- .../test/IndirectList/Test-IndirectList.C | 2 +- applications/test/List/Test-List.C | 4 +- .../test/OListStream/Test-OListStream.C | 37 +- applications/test/PtrList/Test-PtrList.C | 4 +- .../test/dictionary/Test-dictionary.C | 2 +- .../Test-mapDistributePolyMesh.C | 22 +- applications/test/mesh/Test-mesh.C | 2 +- applications/test/parallel/Test-parallel.C | 2 +- .../test/primitivePatch/Test-PrimitivePatch.C | 7 +- .../Test-surfaceMeshConvert.C | 9 +- .../refinementLevel/refinementLevel.C | 6 +- .../mesh/conversion/ansysToFoam/ansysToFoam.L | 38 +- .../mesh/conversion/cfx4ToFoam/cfx4ToFoam.C | 2 +- .../fluent3DMeshToFoam/fluent3DMeshToFoam.L | 5 +- .../fluentMeshToFoam/fluentMeshToFoam.L | 2 +- .../conversion/gambitToFoam/gambitToFoam.L | 2 +- .../mesh/conversion/gmshToFoam/gmshToFoam.C | 2 +- .../ideasUnvToFoam/ideasUnvToFoam.C | 22 +- .../mesh/conversion/kivaToFoam/readKivaGrid.H | 2 +- .../mesh/conversion/mshToFoam/mshToFoam.C | 10 +- .../netgenNeutralToFoam/netgenNeutralToFoam.C | 2 +- .../conversion/plot3dToFoam/plot3dToFoam.C | 2 +- .../conversion/tetgenToFoam/tetgenToFoam.C | 33 +- .../vtkUnstructuredToFoam.C | 10 +- .../mesh/generation/blockMesh/blockMesh.C | 2 +- .../extrudeMesh/extrudedMesh/extrudedMesh.H | 10 +- .../extrudedMesh/extrudedMeshTemplates.C | 20 +- .../extrudeToRegionMesh/extrudeToRegionMesh.C | 7 +- .../patchToPoly2DMesh/patchToPoly2DMesh.C | 2 +- .../extrude2DMesh/extrude2DMeshApp.C | 44 +- .../cellSizeAndAlignmentGrid.C | 11 +- .../DelaunayMesh/DelaunayMeshIO.C | 27 +- .../DelaunayMesh/DistributedDelaunayMesh.C | 11 +- .../backgroundMeshDecomposition.C | 15 +- .../conformalVoronoiMeshCalcDualMesh.C | 27 +- .../conformalVoronoiMeshIO.C | 19 +- .../foamyHexMeshBackgroundMesh.C | 23 +- .../foamyMesh/foamyQuadMesh/foamyQuadMesh.C | 8 +- .../foamyQuadMesh/shortEdgeFilter2D.C | 9 +- .../generation/snappyHexMesh/snappyHexMesh.C | 10 +- .../manipulation/mirrorMesh/mirrorFvMesh.C | 14 +- .../manipulation/mirrorMesh/mirrorFvMesh.H | 13 +- .../manipulation/renumberMesh/renumberMesh.C | 8 +- .../mesh/manipulation/stitchMesh/stitchMesh.C | 6 +- .../decomposePar/domainDecomposition.C | 44 +- .../reconstructParMesh/reconstructParMesh.C | 4 +- .../redistributePar/loadOrCreateMesh.C | 14 +- .../parLagrangianRedistributor.C | 12 +- ...agrangianRedistributorRedistributeFields.C | 6 +- .../redistributePar/redistributePar.C | 76 ++-- .../steadyParticleTracksTemplates.C | 4 +- .../viewFactorsGen/viewFactorsGen.C | 6 +- .../surfaceMeshImport/surfaceMeshImport.C | 2 +- .../surfaceMeshTriangulate.C | 10 +- .../searchableSurfaceModifier/cut.C | 8 +- .../algorithms/indexedOctree/treeDataCell.C | 4 +- .../algorithms/indexedOctree/treeDataCell.H | 14 +- .../Lists/BiIndirectList/BiIndirectList.H | 8 +- .../Lists/BiIndirectList/BiIndirectListI.H | 8 +- .../Lists/CompactListList/CompactListList.C | 10 - .../Lists/CompactListList/CompactListList.H | 6 - .../Lists/CompactListList/CompactListListI.H | 8 - .../Lists/DynamicList/DynamicList.H | 8 +- .../Lists/DynamicList/DynamicListI.H | 19 - .../Lists/IndirectList/IndirectList.H | 10 +- .../Lists/IndirectList/IndirectListI.H | 12 +- src/OpenFOAM/containers/Lists/List/List.C | 21 +- src/OpenFOAM/containers/Lists/List/List.H | 8 +- src/OpenFOAM/containers/Lists/List/ListI.H | 7 - .../containers/Lists/PtrList/PtrList.C | 7 - .../containers/Lists/PtrList/PtrList.H | 7 +- .../containers/Lists/PtrList/PtrListI.H | 7 - .../Lists/SortableList/SortableList.C | 18 +- .../Lists/SortableList/SortableList.H | 7 +- .../containers/Lists/UPtrList/UPtrList.H | 9 +- .../containers/Lists/UPtrList/UPtrListI.H | 28 +- .../IOobjects/CompactIOField/CompactIOField.C | 35 +- .../IOobjects/CompactIOField/CompactIOField.H | 34 +- .../IOobjects/CompactIOList/CompactIOList.C | 33 +- .../IOobjects/CompactIOList/CompactIOList.H | 35 +- .../IOobjects/GlobalIOField/GlobalIOField.C | 46 +- .../IOobjects/GlobalIOField/GlobalIOField.H | 43 +- .../db/IOobjects/GlobalIOList/GlobalIOList.C | 28 +- .../db/IOobjects/GlobalIOList/GlobalIOList.H | 38 +- src/OpenFOAM/db/IOobjects/IOField/IOField.C | 52 ++- src/OpenFOAM/db/IOobjects/IOField/IOField.H | 37 +- src/OpenFOAM/db/IOobjects/IOList/IOList.C | 28 +- src/OpenFOAM/db/IOobjects/IOList/IOList.H | 33 +- src/OpenFOAM/db/IOobjects/IOMap/IOMap.C | 24 +- src/OpenFOAM/db/IOobjects/IOMap/IOMap.H | 36 +- .../db/IOobjects/IOPtrList/IOPtrList.C | 22 +- .../db/IOobjects/IOPtrList/IOPtrList.H | 38 +- .../decomposedBlockData/decomposedBlockData.C | 4 +- .../decomposedBlockData/decomposedBlockData.H | 12 +- src/OpenFOAM/db/IOstreams/Tstreams/ITstream.H | 4 +- .../db/IOstreams/memory/IListStream.H | 34 +- .../db/IOstreams/memory/OListStream.H | 43 +- src/OpenFOAM/db/dictionary/dictionary.C | 14 +- src/OpenFOAM/db/dictionary/dictionary.H | 15 +- .../primitiveEntry/primitiveEntry.C | 6 +- .../primitiveEntry/primitiveEntry.H | 2 +- .../DimensionedField/DimensionedField.C | 44 +- .../DimensionedField/DimensionedField.H | 17 +- .../fields/Fields/DynamicField/DynamicField.H | 41 +- .../Fields/DynamicField/DynamicFieldI.H | 70 ++- src/OpenFOAM/fields/Fields/Field/Field.C | 155 ++++--- src/OpenFOAM/fields/Fields/Field/Field.H | 82 ++-- .../polyMesh/globalMeshData/globalMeshData.C | 11 +- .../mapDistribute/IOmapDistribute.C | 12 +- .../mapDistribute/IOmapDistribute.H | 14 +- .../mapPolyMesh/mapDistribute/mapDistribute.C | 134 +++--- .../mapPolyMesh/mapDistribute/mapDistribute.H | 79 ++-- .../mapDistribute/mapDistributeBase.C | 89 ++-- .../mapDistribute/mapDistributeBase.H | 37 +- .../mapDistribute/mapDistributeLagrangian.H | 26 +- .../mapDistribute/mapDistributePolyMesh.C | 122 ++--- .../mapDistribute/mapDistributePolyMesh.H | 68 +-- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 56 +-- src/OpenFOAM/meshes/polyMesh/polyMesh.H | 50 ++- .../meshes/polyMesh/polyMeshFromShapeMesh.C | 10 +- .../meshes/polyMesh/zones/cellZone/cellZone.C | 38 +- .../meshes/polyMesh/zones/cellZone/cellZone.H | 27 +- .../meshes/polyMesh/zones/faceZone/faceZone.C | 22 +- .../meshes/polyMesh/zones/faceZone/faceZone.H | 12 +- .../polyMesh/zones/pointZone/pointZone.C | 38 +- .../polyMesh/zones/pointZone/pointZone.H | 25 +- .../meshes/polyMesh/zones/zone/zone.C | 28 -- .../meshes/polyMesh/zones/zone/zone.H | 17 - .../PrimitivePatch/PrimitivePatch.C | 6 +- .../PrimitivePatch/PrimitivePatch.H | 6 +- .../meshes/primitiveMesh/primitiveMesh.C | 21 - .../meshes/primitiveMesh/primitiveMesh.H | 11 - .../strings/lists/hashedWordListI.H | 4 +- .../epsilonWallFunctionFvPatchScalarField.C | 22 +- .../nutLowReWallFunctionFvPatchScalarField.C | 2 +- .../omegaWallFunctionFvPatchScalarField.C | 21 +- src/conversion/ccm/reader/ccmReaderMesh.C | 38 +- src/conversion/common/reader/meshReader.C | 23 +- src/conversion/fire/FIREMeshReader.C | 32 +- src/conversion/polyDualMesh/polyDualMesh.C | 24 +- .../dynamicFvMesh/dynamicFvMesh.C | 52 ++- .../dynamicFvMesh/dynamicFvMesh.H | 30 +- src/dynamicFvMesh/staticFvMesh/staticFvMesh.C | 8 - src/dynamicFvMesh/staticFvMesh/staticFvMesh.H | 2 +- .../extrudePatchMesh/extrudePatchMesh.C | 11 +- .../IOmapDistributePolyMesh.C | 28 +- .../IOmapDistributePolyMesh.H | 27 +- .../fvMeshDistribute/fvMeshDistribute.C | 101 ++--- src/dynamicMesh/fvMeshSubset/fvMeshSubset.C | 55 ++- src/dynamicMesh/fvMeshTools/fvMeshTools.C | 14 +- .../points0/points0MotionSolver.C | 2 +- src/dynamicMesh/polyMeshAdder/polyMeshAdder.C | 27 +- .../polyTopoChange/hexRef8/hexRef8.C | 2 +- .../polyTopoChange/polyTopoChange.C | 26 +- src/fileFormats/coordSet/coordSet.C | 35 +- src/fileFormats/coordSet/coordSet.H | 20 +- src/fileFormats/starcd/STARCDCore.C | 4 +- .../basicSymmetryFaPatchScalarField.C | 2 +- .../transform/transformFaPatchScalarField.C | 2 +- .../wedge/wedgeFaPatchScalarField.C | 2 +- .../basicSymmetryFvPatchScalarField.C | 2 +- .../transform/transformFvPatchScalarField.C | 2 +- .../processor/processorFvPatchField.C | 15 +- .../processor/processorFvPatchField.H | 2 +- .../symmetryPlaneFvPatchScalarField.C | 2 +- .../wedge/wedgeFvPatchScalarField.C | 2 +- .../turbulentDFSEMInletFvPatchVectorField.C | 2 +- src/finiteVolume/fvMesh/fvMesh.C | 51 ++- src/finiteVolume/fvMesh/fvMesh.H | 27 +- .../regionCoupled/regionCoupledFvPatch.C | 2 +- .../regionCoupled/regionCoupledWallFvPatch.C | 2 +- .../singleCellFvMesh/singleCellFvMesh.C | 39 +- .../field/streamLine/streamLineBase.C | 4 +- .../basic/InteractionLists/InteractionLists.C | 10 +- .../blockMesh/blockMesh/blockMeshTopology.C | 4 +- .../snappyHexMeshDriver/snappySnapDriver.C | 4 +- .../AMIInterpolation/AMIInterpolation.C | 4 +- .../AMIInterpolationParallelOps.C | 13 +- .../coordinateSystems/coordinateSystems.C | 8 +- .../coordinateSystems/coordinateSystems.H | 12 +- src/meshTools/edgeMesh/edgeMesh.C | 93 +--- src/meshTools/edgeMesh/edgeMesh.H | 60 ++- src/meshTools/edgeMesh/edgeMeshI.H | 55 ++- .../extendedEdgeMesh/extendedEdgeMesh.C | 211 +++------ .../extendedEdgeMesh/extendedEdgeMesh.H | 51 +-- .../extendedEdgeMesh/extendedEdgeMeshI.H | 20 +- .../extendedEdgeMeshTemplates.C | 13 +- .../extendedFeatureEdgeMesh.C | 12 +- .../extendedFeatureEdgeMesh.H | 6 +- .../extendedFeatureEdgeMeshI.H | 16 +- .../extendedFeatureEdgeMeshTemplates.C | 7 +- src/meshTools/indexedOctree/treeDataEdge.C | 4 +- src/meshTools/indexedOctree/treeDataEdge.H | 2 +- src/meshTools/indexedOctree/treeDataFace.C | 4 +- src/meshTools/indexedOctree/treeDataFace.H | 16 +- .../mappedPatchBaseTemplates.C | 16 +- .../polyMeshZipUpCells/polyMeshZipUpCells.C | 8 +- .../searchableSurfaces/searchableSurfaces.C | 5 +- .../triSurfaceLoader/triSurfaceLoader.C | 7 +- .../dynamicOversetFvMesh.C | 4 +- .../fvMeshPrimitiveLduAddressing.C | 8 +- .../fvMeshPrimitiveLduAddressing.H | 7 +- .../distributedTriSurfaceMesh.C | 38 +- .../cellVolumeWeight/cellVolumeWeightMethod.C | 12 +- src/sampling/meshToMesh/meshToMesh.C | 8 +- .../meshToMesh/meshToMeshParallelOps.C | 13 +- .../readers/ensight/ensightSurfaceReader.C | 4 +- .../surfMeshSampler/surfMeshSampler.C | 3 +- src/sampling/surface/isoSurface/isoSurface.C | 20 +- .../surface/isoSurface/isoSurfaceCell.C | 22 +- src/surfMesh/MeshedSurface/MeshedSurface.C | 384 ++++++++-------- src/surfMesh/MeshedSurface/MeshedSurface.H | 418 +++++++++--------- src/surfMesh/MeshedSurface/MeshedSurfaceIO.C | 14 +- src/surfMesh/MeshedSurface/MeshedSurfaceNew.C | 4 +- .../MeshedSurface/MeshedSurfaceZones.C | 8 +- .../MeshedSurfaceIOAllocator.C | 88 +--- .../MeshedSurfaceIOAllocator.H | 148 +++---- .../ModifiableMeshedSurface.H | 26 +- .../UnsortedMeshedSurface.C | 289 +++++------- .../UnsortedMeshedSurface.H | 274 ++++++------ .../UnsortedMeshedSurfaceNew.C | 7 +- src/surfMesh/surfMesh/surfMesh.C | 231 +++++----- src/surfMesh/surfMesh/surfMesh.H | 232 +++++----- src/surfMesh/surfMesh/surfMeshIO.C | 13 +- .../surfZone/surfZone/surfZoneIOList.C | 56 +-- .../surfZone/surfZone/surfZoneIOList.H | 44 +- .../surfaceFormats/nas/NASsurfaceFormat.C | 2 +- .../surfaceFormats/obj/OBJsurfaceFormat.C | 2 +- .../surfaceFormats/off/OFFsurfaceFormat.C | 6 +- .../starcd/STARCDsurfaceFormat.C | 2 +- .../surfaceFormats/stl/STLsurfaceFormat.C | 6 +- .../surfaceFormats/tri/TRIsurfaceFormat.C | 4 +- .../surfaceFormats/vtk/VTKsurfaceFormat.C | 8 +- .../patches/geometricSurfacePatch.H | 14 +- src/surfMesh/triSurface/triSurface.C | 147 +++--- src/surfMesh/triSurface/triSurface.H | 57 +-- src/surfMesh/triSurface/triSurfaceIO.C | 4 +- 241 files changed, 3106 insertions(+), 3971 deletions(-) diff --git a/applications/solvers/combustion/chemFoam/createSingleCellMesh.H b/applications/solvers/combustion/chemFoam/createSingleCellMesh.H index a43af46326..d65e45f44e 100644 --- a/applications/solvers/combustion/chemFoam/createSingleCellMesh.H +++ b/applications/solvers/combustion/chemFoam/createSingleCellMesh.H @@ -1,8 +1,5 @@ Info<< "Constructing single cell mesh" << nl << endl; -labelList owner(6, label(0)); -labelList neighbour(0); - pointField points(8); points[0] = vector(0, 0, 0); points[1] = vector(1, 0, 0); @@ -24,10 +21,10 @@ fvMesh mesh runTime, IOobject::READ_IF_PRESENT ), - xferMove(points), - faces.xfer(), - owner.xfer(), - neighbour.xfer() + std::move(points), + std::move(faces), + labelList(6, Zero), // owner + labelList() // neighbour ); List patches(1); diff --git a/applications/test/Dictionary/Test-Dictionary.C b/applications/test/Dictionary/Test-Dictionary.C index 251cb2f841..d360c30a3b 100644 --- a/applications/test/Dictionary/Test-Dictionary.C +++ b/applications/test/Dictionary/Test-Dictionary.C @@ -180,7 +180,7 @@ int main(int argc, char *argv[]) { std::cout<< "iter: " << typeid(*iter).name() << '\n'; - Info<< "elem = " << *(*iter) << endl; + // Info<< "elem = " << *(*iter) << endl; } std::cout<< "iter type: " diff --git a/applications/test/DynamicList/Test-DynamicList.C b/applications/test/DynamicList/Test-DynamicList.C index 11111aad00..8ca36068ce 100644 --- a/applications/test/DynamicList/Test-DynamicList.C +++ b/applications/test/DynamicList/Test-DynamicList.C @@ -194,13 +194,13 @@ int main(int argc, char *argv[]) printInfo("dlC", dlC, true); - List