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:
@ -214,9 +214,9 @@ int main(int argc, char *argv[])
|
||||
runTime.timeName(),
|
||||
runTime
|
||||
),
|
||||
xferCopy(mesh.points()), // could we safely re-use the data?
|
||||
xferCopy(mesh.faces()),
|
||||
xferCopy(mesh.cells())
|
||||
pointField(mesh.points()), // Could we safely re-use the data?
|
||||
faceList(mesh.faces()),
|
||||
cellList(mesh.cells())
|
||||
);
|
||||
|
||||
// Add the boundary patches
|
||||
|
||||
@ -446,27 +446,23 @@ int main(int argc, char *argv[])
|
||||
const word defaultFacesName = "defaultFaces";
|
||||
word defaultFacesType = emptyPolyPatch::typeName;
|
||||
|
||||
// Create dummy mesh just to find out what are internal/external
|
||||
// faces
|
||||
autoPtr<polyMesh> dummyMesh
|
||||
// Create dummy mesh just to find out what are internal/external faces
|
||||
auto dummyMesh = autoPtr<polyMesh>::New
|
||||
(
|
||||
new polyMesh
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dummyMesh",
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferCopy(points),
|
||||
cellShapes,
|
||||
faceListList(0),
|
||||
wordList(0),
|
||||
wordList(0),
|
||||
defaultFacesName,
|
||||
defaultFacesType,
|
||||
wordList(0)
|
||||
)
|
||||
"dummyMesh",
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
pointField(points), // copy
|
||||
cellShapes,
|
||||
faceListList(),
|
||||
wordList(),
|
||||
wordList(),
|
||||
defaultFacesName,
|
||||
defaultFacesType,
|
||||
wordList()
|
||||
);
|
||||
|
||||
|
||||
@ -605,7 +601,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferMove(points),
|
||||
std::move(points),
|
||||
cellShapes,
|
||||
patchFaces,
|
||||
patchNames,
|
||||
@ -615,7 +611,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
|
||||
if (cellTypes.size() > 0 || patchNames.size() > 0)
|
||||
if (cellTypes.size() || patchNames.size())
|
||||
{
|
||||
DynamicList<pointZone*> pz;
|
||||
DynamicList<faceZone*> fz;
|
||||
|
||||
@ -739,7 +739,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferMove(points),
|
||||
std::move(points),
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
|
||||
@ -945,10 +945,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferCopy(pointField()),
|
||||
xferCopy(faceList()),
|
||||
xferCopy(labelList()),
|
||||
xferCopy(labelList())
|
||||
Zero
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -1175,7 +1175,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferMove(points),
|
||||
std::move(points),
|
||||
cellShapes,
|
||||
patches,
|
||||
patchNames,
|
||||
|
||||
@ -853,7 +853,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferMove(points),
|
||||
std::move(points),
|
||||
cells,
|
||||
boundary,
|
||||
patchNames,
|
||||
|
||||
@ -931,7 +931,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferMove(points),
|
||||
std::move(points),
|
||||
cells,
|
||||
boundaryFaces,
|
||||
boundaryPatchNames,
|
||||
|
||||
@ -1128,17 +1128,13 @@ int main(int argc, char *argv[])
|
||||
<< nl << endl;
|
||||
|
||||
// Create globally numbered surface
|
||||
meshedSurface rawSurface
|
||||
(
|
||||
xferCopy(polyPoints),
|
||||
xferCopyTo<faceList>(boundaryFaces)
|
||||
);
|
||||
meshedSurface rawSurface(polyPoints, boundaryFaces);
|
||||
|
||||
// Write locally numbered surface
|
||||
meshedSurface
|
||||
(
|
||||
xferCopy(rawSurface.localPoints()),
|
||||
xferCopy(rawSurface.localFaces())
|
||||
rawSurface.localPoints(),
|
||||
rawSurface.localFaces()
|
||||
).write(runTime.path()/"boundaryFaces.obj");
|
||||
}
|
||||
|
||||
@ -1171,14 +1167,14 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferMove(polyPoints),
|
||||
std::move(polyPoints),
|
||||
cellVerts,
|
||||
usedPatchFaceVerts, // boundaryFaces,
|
||||
usedPatchNames, // boundaryPatchNames,
|
||||
usedPatchFaceVerts, // boundaryFaces,
|
||||
usedPatchNames, // boundaryPatchNames,
|
||||
wordList(patchNames.size(), polyPatch::typeName), // boundaryPatchTypes,
|
||||
"defaultFaces", // defaultFacesName
|
||||
polyPatch::typeName, // defaultFacesType,
|
||||
wordList(0) // boundaryPatchPhysicalTypes
|
||||
"defaultFaces", // defaultFacesName
|
||||
polyPatch::typeName, // defaultFacesType,
|
||||
wordList() // boundaryPatchPhysicalTypes
|
||||
);
|
||||
|
||||
// Remove files now, to ensure all mesh files written are consistent.
|
||||
|
||||
@ -565,7 +565,7 @@ polyMesh pShapeMesh
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferMove(points),
|
||||
std::move(points),
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
|
||||
@ -144,14 +144,14 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferMove(points),
|
||||
std::move(points),
|
||||
cells,
|
||||
faceListList(0),
|
||||
wordList(0),
|
||||
wordList(0),
|
||||
faceListList(),
|
||||
wordList(),
|
||||
wordList(),
|
||||
"defaultFaces",
|
||||
polyPatch::typeName,
|
||||
wordList(0)
|
||||
wordList()
|
||||
);
|
||||
|
||||
// Set the precision of the points data to 10
|
||||
|
||||
@ -303,7 +303,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferMove(points),
|
||||
std::move(points),
|
||||
cells,
|
||||
patchFaces,
|
||||
patchNames,
|
||||
|
||||
@ -247,7 +247,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferMove(newPoints),
|
||||
std::move(newPoints),
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
|
||||
@ -318,25 +318,22 @@ int main(int argc, char *argv[])
|
||||
// Construct mesh with default boundary only
|
||||
//
|
||||
|
||||
autoPtr<polyMesh> meshPtr
|
||||
auto meshPtr = autoPtr<polyMesh>::New
|
||||
(
|
||||
new polyMesh
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
polyMesh::defaultRegion,
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferCopy(points),
|
||||
cells,
|
||||
faceListList(0),
|
||||
wordList(0), // boundaryPatchNames
|
||||
wordList(0), // boundaryPatchTypes
|
||||
"defaultFaces",
|
||||
polyPatch::typeName,
|
||||
wordList(0)
|
||||
)
|
||||
polyMesh::defaultRegion,
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
pointField(points), // Copy of points
|
||||
cells,
|
||||
faceListList(),
|
||||
wordList(), // boundaryPatchNames
|
||||
wordList(), // boundaryPatchTypes
|
||||
"defaultFaces",
|
||||
polyPatch::typeName,
|
||||
wordList()
|
||||
);
|
||||
const polyMesh& mesh = *meshPtr;
|
||||
|
||||
@ -531,7 +528,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferMove(points),
|
||||
std::move(points),
|
||||
cells,
|
||||
patchFaces,
|
||||
patchNames,
|
||||
|
||||
@ -68,14 +68,14 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferMove(reader.points()),
|
||||
std::move(reader.points()),
|
||||
reader.cells(),
|
||||
faceListList(0),
|
||||
wordList(0),
|
||||
wordList(0),
|
||||
faceListList(),
|
||||
wordList(),
|
||||
wordList(),
|
||||
"defaultFaces",
|
||||
polyPatch::typeName,
|
||||
wordList(0)
|
||||
wordList()
|
||||
);
|
||||
|
||||
// Set the precision of the points data to 10
|
||||
|
||||
@ -277,7 +277,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
xferCopy(blocks.points()), // could we re-use space?
|
||||
pointField(blocks.points()), // Copy, could we re-use space?
|
||||
blocks.cells(),
|
||||
blocks.patches(),
|
||||
blocks.patchNames(),
|
||||
|
||||
@ -63,7 +63,7 @@ class extrudedMesh
|
||||
|
||||
//- Construct and return the extruded mesh points
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
Xfer<pointField> extrudedPoints
|
||||
pointField extrudedPoints
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel&
|
||||
@ -71,7 +71,7 @@ class extrudedMesh
|
||||
|
||||
//- Construct and return the extruded mesh faces
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
Xfer<faceList> extrudedFaces
|
||||
faceList extrudedFaces
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel&
|
||||
@ -79,7 +79,7 @@ class extrudedMesh
|
||||
|
||||
//- Construct and return the extruded mesh cells
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
Xfer<cellList> extrudedCells
|
||||
cellList extrudedCells
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel&
|
||||
@ -87,10 +87,10 @@ class extrudedMesh
|
||||
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
extrudedMesh(const extrudedMesh&);
|
||||
extrudedMesh(const extrudedMesh&) = delete;
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const extrudedMesh&);
|
||||
void operator=(const extrudedMesh&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -34,7 +34,7 @@ template
|
||||
template<class> class FaceList,
|
||||
class PointField
|
||||
>
|
||||
Foam::Xfer<Foam::pointField> Foam::extrudedMesh::extrudedPoints
|
||||
Foam::pointField Foam::extrudedMesh::extrudedPoints
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
@ -47,9 +47,9 @@ Foam::Xfer<Foam::pointField> Foam::extrudedMesh::extrudedPoints
|
||||
|
||||
pointField ePoints((nLayers + 1)*surfacePoints.size());
|
||||
|
||||
for (label layer=0; layer<=nLayers; layer++)
|
||||
for (label layer=0; layer <= nLayers; ++layer)
|
||||
{
|
||||
label offset = layer*surfacePoints.size();
|
||||
const label offset = layer*surfacePoints.size();
|
||||
|
||||
forAll(surfacePoints, i)
|
||||
{
|
||||
@ -62,13 +62,12 @@ Foam::Xfer<Foam::pointField> Foam::extrudedMesh::extrudedPoints
|
||||
}
|
||||
}
|
||||
|
||||
// return points for transferring
|
||||
return xferMove(ePoints);
|
||||
return ePoints;
|
||||
}
|
||||
|
||||
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
|
||||
Foam::faceList Foam::extrudedMesh::extrudedFaces
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
@ -188,13 +187,13 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
|
||||
);
|
||||
}
|
||||
|
||||
// return points for transferring
|
||||
return xferMove(eFaces);
|
||||
|
||||
return eFaces;
|
||||
}
|
||||
|
||||
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
Foam::Xfer<Foam::cellList> Foam::extrudedMesh::extrudedCells
|
||||
Foam::cellList Foam::extrudedMesh::extrudedCells
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
@ -295,8 +294,7 @@ Foam::Xfer<Foam::cellList> Foam::extrudedMesh::extrudedCells
|
||||
facei++;
|
||||
}
|
||||
|
||||
// return points for transferring
|
||||
return xferMove(eCells);
|
||||
return eCells;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1880,7 +1880,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
}
|
||||
const primitiveFacePatch extrudePatch(zoneFaces.xfer(), mesh.points());
|
||||
const primitiveFacePatch extrudePatch(std::move(zoneFaces), mesh.points());
|
||||
|
||||
|
||||
Pstream::listCombineGather(isInternal, orEqOp<bool>());
|
||||
@ -2405,10 +2405,7 @@ int main(int argc, char *argv[])
|
||||
IOobject::AUTO_WRITE,
|
||||
false
|
||||
),
|
||||
xferCopy(pointField()),
|
||||
xferCopy(faceList()),
|
||||
xferCopy(labelList()),
|
||||
xferCopy(labelList()),
|
||||
Zero,
|
||||
false
|
||||
);
|
||||
|
||||
|
||||
@ -247,7 +247,7 @@ void Foam::patchToPoly2DMesh::addPatchFacesToOwner()
|
||||
<< nExternalEdges << endl;
|
||||
}
|
||||
|
||||
owner_ = newOwner.xfer();
|
||||
owner_.transfer(newOwner);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -184,24 +184,21 @@ int main(int argc, char *argv[])
|
||||
|
||||
poly2DMesh.createMesh();
|
||||
|
||||
mesh.reset
|
||||
mesh = autoPtr<polyMesh>::New
|
||||
(
|
||||
new polyMesh
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
polyMesh::defaultRegion,
|
||||
runTimeExtruded.constant(),
|
||||
runTimeExtruded,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
xferMove(poly2DMesh.points()),
|
||||
xferMove(poly2DMesh.faces()),
|
||||
xferMove(poly2DMesh.owner()),
|
||||
xferMove(poly2DMesh.neighbour())
|
||||
)
|
||||
polyMesh::defaultRegion,
|
||||
runTimeExtruded.constant(),
|
||||
runTimeExtruded,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
std::move(poly2DMesh.points()),
|
||||
std::move(poly2DMesh.faces()),
|
||||
std::move(poly2DMesh.owner()),
|
||||
std::move(poly2DMesh.neighbour())
|
||||
);
|
||||
|
||||
Info<< "Constructing patches." << endl;
|
||||
@ -224,17 +221,14 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (surfaceFormat == POLYMESH2D)
|
||||
{
|
||||
mesh.reset
|
||||
mesh = autoPtr<polyMesh>::New
|
||||
(
|
||||
new polyMesh
|
||||
Foam::IOobject
|
||||
(
|
||||
Foam::IOobject
|
||||
(
|
||||
Foam::polyMesh::defaultRegion,
|
||||
runTimeExtruded.timeName(),
|
||||
runTimeExtruded,
|
||||
Foam::IOobject::MUST_READ
|
||||
)
|
||||
Foam::polyMesh::defaultRegion,
|
||||
runTimeExtruded.timeName(),
|
||||
runTimeExtruded,
|
||||
Foam::IOobject::MUST_READ
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -141,14 +141,11 @@ autoPtr<mapDistribute> buildMap
|
||||
|
||||
List<Map<label>> compactMap;
|
||||
|
||||
return autoPtr<mapDistribute>
|
||||
return autoPtr<mapDistribute>::New
|
||||
(
|
||||
new mapDistribute
|
||||
(
|
||||
globalIndexing,
|
||||
pointPoints,
|
||||
compactMap
|
||||
)
|
||||
globalIndexing,
|
||||
pointPoints,
|
||||
compactMap
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -593,23 +593,20 @@ Foam::DelaunayMesh<Triangulation>::createMesh
|
||||
|
||||
Info<< "Creating mesh" << endl;
|
||||
|
||||
autoPtr<polyMesh> meshPtr
|
||||
auto meshPtr = autoPtr<polyMesh>::New
|
||||
(
|
||||
new polyMesh
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
name,
|
||||
time().timeName(),
|
||||
time(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
xferMove(points),
|
||||
xferMove(faces),
|
||||
xferMove(owner),
|
||||
xferMove(neighbour)
|
||||
)
|
||||
name,
|
||||
time().timeName(),
|
||||
time(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
std::move(points),
|
||||
std::move(faces),
|
||||
std::move(owner),
|
||||
std::move(neighbour)
|
||||
);
|
||||
|
||||
Info<< "Adding patches" << endl;
|
||||
|
||||
@ -105,14 +105,11 @@ Foam::DistributedDelaunayMesh<Triangulation>::buildMap
|
||||
}
|
||||
}
|
||||
|
||||
return autoPtr<mapDistribute>
|
||||
return autoPtr<mapDistribute>::New
|
||||
(
|
||||
new mapDistribute
|
||||
(
|
||||
constructSize,
|
||||
sendMap.xfer(),
|
||||
constructMap.xfer()
|
||||
)
|
||||
constructSize,
|
||||
std::move(sendMap),
|
||||
std::move(constructMap)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -36,9 +36,7 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
defineTypeNameAndDebug(backgroundMeshDecomposition, 0);
|
||||
|
||||
defineTypeNameAndDebug(backgroundMeshDecomposition, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -114,14 +112,11 @@ Foam::autoPtr<Foam::mapDistribute> Foam::backgroundMeshDecomposition::buildMap
|
||||
}
|
||||
}
|
||||
|
||||
return autoPtr<mapDistribute>
|
||||
return autoPtr<mapDistribute>::New
|
||||
(
|
||||
new mapDistribute
|
||||
(
|
||||
constructSize,
|
||||
sendMap.xfer(),
|
||||
constructMap.xfer()
|
||||
)
|
||||
constructSize,
|
||||
std::move(sendMap),
|
||||
std::move(constructMap)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -727,23 +727,20 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
|
||||
labelList cellToDelaunayVertex(removeUnusedCells(owner, neighbour));
|
||||
cellCentres = pointField(cellCentres, cellToDelaunayVertex);
|
||||
|
||||
autoPtr<polyMesh> meshPtr
|
||||
auto meshPtr = autoPtr<polyMesh>::New
|
||||
(
|
||||
new polyMesh
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"foamyHexMesh_temporary",
|
||||
runTime_.timeName(),
|
||||
runTime_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
xferCopy(pts),
|
||||
xferMove(faces),
|
||||
xferMove(owner),
|
||||
xferMove(neighbour)
|
||||
)
|
||||
"foamyHexMesh_temporary",
|
||||
runTime_.timeName(),
|
||||
runTime_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
pointField(pts), // Copy of points
|
||||
std::move(faces),
|
||||
std::move(owner),
|
||||
std::move(neighbour)
|
||||
);
|
||||
|
||||
polyMesh& pMesh = meshPtr();
|
||||
|
||||
@ -404,16 +404,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
|
||||
const PtrList<dictionary>& patchDicts
|
||||
) const
|
||||
{
|
||||
autoPtr<fvMesh> meshPtr
|
||||
(
|
||||
new fvMesh
|
||||
(
|
||||
io,
|
||||
xferCopy(pointField()),
|
||||
xferCopy(faceList()),
|
||||
xferCopy(cellList())
|
||||
)
|
||||
);
|
||||
auto meshPtr = autoPtr<fvMesh>::New(io, Zero);
|
||||
fvMesh& mesh = meshPtr();
|
||||
|
||||
List<polyPatch*> patches(patchDicts.size());
|
||||
@ -827,10 +818,10 @@ void Foam::conformalVoronoiMesh::writeMesh
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
xferMove(points),
|
||||
xferMove(faces),
|
||||
xferMove(owner),
|
||||
xferMove(neighbour)
|
||||
std::move(points),
|
||||
std::move(faces),
|
||||
std::move(owner),
|
||||
std::move(neighbour)
|
||||
);
|
||||
|
||||
Info<< indent << "Adding patches to mesh" << endl;
|
||||
|
||||
@ -282,20 +282,17 @@ autoPtr<polyMesh> generateHexMesh
|
||||
word defaultFacesType = polyPatch::typeName;
|
||||
wordList patchPhysicalTypes(0);
|
||||
|
||||
return autoPtr<polyMesh>
|
||||
return autoPtr<polyMesh>::New
|
||||
(
|
||||
new polyMesh
|
||||
(
|
||||
io,
|
||||
xferMoveTo<pointField>(points),
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
patchTypes,
|
||||
defaultFacesName,
|
||||
defaultFacesType,
|
||||
patchPhysicalTypes
|
||||
)
|
||||
io,
|
||||
std::move(points),
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
patchTypes,
|
||||
defaultFacesName,
|
||||
defaultFacesType,
|
||||
patchPhysicalTypes
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -152,10 +152,10 @@ int main(int argc, char *argv[])
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
xferMove(poly2DMesh.points()),
|
||||
xferMove(poly2DMesh.faces()),
|
||||
xferMove(poly2DMesh.owner()),
|
||||
xferMove(poly2DMesh.neighbour())
|
||||
std::move(poly2DMesh.points()),
|
||||
std::move(poly2DMesh.faces()),
|
||||
std::move(poly2DMesh.owner()),
|
||||
std::move(poly2DMesh.neighbour())
|
||||
);
|
||||
|
||||
Info<< "Constructing patches." << endl;
|
||||
|
||||
@ -204,7 +204,7 @@ Foam::shortEdgeFilter2D::shortEdgeFilter2D
|
||||
|
||||
points2D.clear();
|
||||
|
||||
ms_ = MeshedSurface<face>(xferMove(points), xferMove(faces));
|
||||
ms_ = MeshedSurface<face>(std::move(points), std::move(faces));
|
||||
|
||||
Info<< "Meshed surface stats before edge filtering :" << endl;
|
||||
ms_.writeStats(Info);
|
||||
@ -533,12 +533,7 @@ Foam::shortEdgeFilter2D::filter()
|
||||
|
||||
newFaces.setSize(newFacei);
|
||||
|
||||
MeshedSurface<face> fMesh
|
||||
(
|
||||
xferMove(newPoints),
|
||||
xferMove(newFaces),
|
||||
xferCopy(List<surfZone>())
|
||||
);
|
||||
MeshedSurface<face> fMesh(std::move(newPoints), std::move(newFaces));
|
||||
|
||||
updateEdgeRegionMap
|
||||
(
|
||||
|
||||
@ -476,7 +476,7 @@ void extractSurface
|
||||
|
||||
// Gather all ZoneIDs
|
||||
List<labelList> gatheredZones(Pstream::nProcs());
|
||||
gatheredZones[Pstream::myProcNo()] = compactZones.xfer();
|
||||
gatheredZones[Pstream::myProcNo()].transfer(compactZones);
|
||||
Pstream::gatherList(gatheredZones);
|
||||
|
||||
// On master combine all points, faces, zones
|
||||
@ -515,10 +515,10 @@ void extractSurface
|
||||
|
||||
UnsortedMeshedSurface<face> unsortedFace
|
||||
(
|
||||
xferMove(allPoints),
|
||||
xferMove(allFaces),
|
||||
xferMove(allZones),
|
||||
xferMove(surfZones)
|
||||
std::move(allPoints),
|
||||
std::move(allFaces),
|
||||
std::move(allZones),
|
||||
surfZones
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -340,38 +340,32 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
curPointLabels
|
||||
);
|
||||
|
||||
procMeshPtr.reset
|
||||
procMeshPtr = autoPtr<polyMesh>::New
|
||||
(
|
||||
new polyMesh
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
this->polyMesh::name(), // region of undecomposed mesh
|
||||
facesInstance(),
|
||||
processorDb
|
||||
),
|
||||
xferMove(facesInstancePoints),
|
||||
xferMove(procFaces),
|
||||
xferMove(procCells)
|
||||
)
|
||||
this->polyMesh::name(), // region of undecomposed mesh
|
||||
facesInstance(),
|
||||
processorDb
|
||||
),
|
||||
std::move(facesInstancePoints),
|
||||
std::move(procFaces),
|
||||
std::move(procCells)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
procMeshPtr.reset
|
||||
procMeshPtr = autoPtr<polyMesh>::New
|
||||
(
|
||||
new polyMesh
|
||||
IOobject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
this->polyMesh::name(), // region of undecomposed mesh
|
||||
facesInstance(),
|
||||
processorDb
|
||||
),
|
||||
xferMove(procPoints),
|
||||
xferMove(procFaces),
|
||||
xferMove(procCells)
|
||||
)
|
||||
this->polyMesh::name(), // region of undecomposed mesh
|
||||
facesInstance(),
|
||||
processorDb
|
||||
),
|
||||
std::move(procPoints),
|
||||
std::move(procFaces),
|
||||
std::move(procCells)
|
||||
);
|
||||
}
|
||||
polyMesh& procMesh = procMeshPtr();
|
||||
@ -751,7 +745,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
xferMove(procPoints)
|
||||
std::move(procPoints)
|
||||
);
|
||||
pointsInstancePoints.write();
|
||||
}
|
||||
|
||||
@ -652,9 +652,7 @@ int main(int argc, char *argv[])
|
||||
runTime,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
xferCopy(pointField()),
|
||||
xferCopy(faceList()),
|
||||
xferCopy(cellList())
|
||||
Zero
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -166,15 +166,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
||||
// Create dummy mesh. Only used on procs that don't have mesh.
|
||||
IOobject noReadIO(io);
|
||||
noReadIO.readOpt() = IOobject::NO_READ;
|
||||
fvMesh dummyMesh
|
||||
(
|
||||
noReadIO,
|
||||
xferCopy(pointField()),
|
||||
xferCopy(faceList()),
|
||||
xferCopy(labelList()),
|
||||
xferCopy(labelList()),
|
||||
false
|
||||
);
|
||||
fvMesh dummyMesh(noReadIO, Zero, false);
|
||||
|
||||
// Add patches
|
||||
List<polyPatch*> patches(patchEntries.size());
|
||||
@ -261,8 +253,8 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
||||
// parallel
|
||||
|
||||
//Pout<< "Reading mesh from " << io.objectPath() << endl;
|
||||
autoPtr<fvMesh> meshPtr(new fvMesh(io));
|
||||
fvMesh& mesh = meshPtr();
|
||||
auto meshPtr = autoPtr<fvMesh>::New(io);
|
||||
fvMesh& mesh = *meshPtr;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -279,15 +279,11 @@ Foam::parLagrangianRedistributor::redistributeLagrangianPositions
|
||||
}
|
||||
|
||||
|
||||
// Construct map
|
||||
return autoPtr<mapDistributeBase>
|
||||
return autoPtr<mapDistributeBase>::New
|
||||
(
|
||||
new mapDistributeBase
|
||||
(
|
||||
constructSize,
|
||||
subMap.xfer(),
|
||||
constructMap.xfer()
|
||||
)
|
||||
constructSize,
|
||||
std::move(subMap),
|
||||
std::move(constructMap)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -125,7 +125,7 @@ void Foam::parLagrangianRedistributor::redistributeLagrangianFields
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
xferMove<Field<Type>>(field)
|
||||
std::move(field)
|
||||
).write();
|
||||
}
|
||||
}
|
||||
@ -212,7 +212,7 @@ void Foam::parLagrangianRedistributor::redistributeLagrangianFieldFields
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
xferMove<Field<Field<Type>>>(field)
|
||||
std::move(field)
|
||||
).write();
|
||||
}
|
||||
}
|
||||
@ -309,7 +309,7 @@ void Foam::parLagrangianRedistributor::redistributeStoredLagrangianFields
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
xferMove<Field<typename Container::value_type>>(field)
|
||||
std::move(field)
|
||||
).write();
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -1353,10 +1353,7 @@ autoPtr<mapDistributePolyMesh> redistributeAndWrite
|
||||
//}
|
||||
|
||||
|
||||
return autoPtr<mapDistributePolyMesh>
|
||||
(
|
||||
new mapDistributePolyMesh(map.xfer())
|
||||
);
|
||||
return autoPtr<mapDistributePolyMesh>::New(std::move(map));
|
||||
}
|
||||
|
||||
|
||||
@ -1407,7 +1404,7 @@ autoPtr<mapDistributePolyMesh> createReconstructMap
|
||||
|
||||
autoPtr<mapDistributePolyMesh> mapPtr;
|
||||
|
||||
if (baseMeshPtr.valid() && baseMeshPtr().nCells()) //baseMeshPtr.valid())
|
||||
if (baseMeshPtr.valid() && baseMeshPtr().nCells())
|
||||
{
|
||||
const fvMesh& baseMesh = baseMeshPtr();
|
||||
|
||||
@ -1417,8 +1414,8 @@ autoPtr<mapDistributePolyMesh> createReconstructMap
|
||||
mapDistribute cellMap
|
||||
(
|
||||
baseMesh.nCells(),
|
||||
cellSubMap.xfer(),
|
||||
cellAddressing.xfer()
|
||||
std::move(cellSubMap),
|
||||
std::move(cellAddressing)
|
||||
);
|
||||
|
||||
labelListList faceSubMap(Pstream::nProcs());
|
||||
@ -1427,8 +1424,8 @@ autoPtr<mapDistributePolyMesh> createReconstructMap
|
||||
mapDistribute faceMap
|
||||
(
|
||||
baseMesh.nFaces(),
|
||||
faceSubMap.xfer(),
|
||||
faceAddressing.xfer(),
|
||||
std::move(faceSubMap),
|
||||
std::move(faceAddressing),
|
||||
false, //subHasFlip
|
||||
true //constructHasFlip
|
||||
);
|
||||
@ -1439,8 +1436,8 @@ autoPtr<mapDistributePolyMesh> createReconstructMap
|
||||
mapDistribute pointMap
|
||||
(
|
||||
baseMesh.nPoints(),
|
||||
pointSubMap.xfer(),
|
||||
pointAddressing.xfer()
|
||||
std::move(pointSubMap),
|
||||
std::move(pointAddressing)
|
||||
);
|
||||
|
||||
labelListList patchSubMap(Pstream::nProcs());
|
||||
@ -1451,8 +1448,8 @@ autoPtr<mapDistributePolyMesh> createReconstructMap
|
||||
mapDistribute patchMap
|
||||
(
|
||||
baseMesh.boundaryMesh().size(),
|
||||
patchSubMap.xfer(),
|
||||
boundaryAddressing.xfer()
|
||||
std::move(patchSubMap),
|
||||
std::move(boundaryAddressing)
|
||||
);
|
||||
|
||||
const label nOldPoints = mesh.nPoints();
|
||||
@ -1475,12 +1472,12 @@ autoPtr<mapDistributePolyMesh> createReconstructMap
|
||||
nOldPoints,
|
||||
nOldFaces,
|
||||
nOldCells,
|
||||
oldPatchStarts.xfer(),
|
||||
oldPatchNMeshPoints.xfer(),
|
||||
pointMap.xfer(),
|
||||
faceMap.xfer(),
|
||||
cellMap.xfer(),
|
||||
patchMap.xfer()
|
||||
std::move(oldPatchStarts),
|
||||
std::move(oldPatchNMeshPoints),
|
||||
std::move(pointMap),
|
||||
std::move(faceMap),
|
||||
std::move(cellMap),
|
||||
std::move(patchMap)
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1493,8 +1490,8 @@ autoPtr<mapDistributePolyMesh> createReconstructMap
|
||||
mapDistribute cellMap
|
||||
(
|
||||
0,
|
||||
cellSubMap.xfer(),
|
||||
cellConstructMap.xfer()
|
||||
std::move(cellSubMap),
|
||||
std::move(cellConstructMap)
|
||||
);
|
||||
|
||||
labelListList faceSubMap(Pstream::nProcs());
|
||||
@ -1504,8 +1501,8 @@ autoPtr<mapDistributePolyMesh> createReconstructMap
|
||||
mapDistribute faceMap
|
||||
(
|
||||
0,
|
||||
faceSubMap.xfer(),
|
||||
faceConstructMap.xfer(),
|
||||
std::move(faceSubMap),
|
||||
std::move(faceConstructMap),
|
||||
false, //subHasFlip
|
||||
true //constructHasFlip
|
||||
);
|
||||
@ -1517,8 +1514,8 @@ autoPtr<mapDistributePolyMesh> createReconstructMap
|
||||
mapDistribute pointMap
|
||||
(
|
||||
0,
|
||||
pointSubMap.xfer(),
|
||||
pointConstructMap.xfer()
|
||||
std::move(pointSubMap),
|
||||
std::move(pointConstructMap)
|
||||
);
|
||||
|
||||
labelListList patchSubMap(Pstream::nProcs());
|
||||
@ -1530,8 +1527,8 @@ autoPtr<mapDistributePolyMesh> createReconstructMap
|
||||
mapDistribute patchMap
|
||||
(
|
||||
0,
|
||||
patchSubMap.xfer(),
|
||||
patchConstructMap.xfer()
|
||||
std::move(patchSubMap),
|
||||
std::move(patchConstructMap)
|
||||
);
|
||||
|
||||
const label nOldPoints = mesh.nPoints();
|
||||
@ -1554,12 +1551,12 @@ autoPtr<mapDistributePolyMesh> createReconstructMap
|
||||
nOldPoints,
|
||||
nOldFaces,
|
||||
nOldCells,
|
||||
oldPatchStarts.xfer(),
|
||||
oldPatchNMeshPoints.xfer(),
|
||||
pointMap.xfer(),
|
||||
faceMap.xfer(),
|
||||
cellMap.xfer(),
|
||||
patchMap.xfer()
|
||||
std::move(oldPatchStarts),
|
||||
std::move(oldPatchNMeshPoints),
|
||||
std::move(pointMap),
|
||||
std::move(faceMap),
|
||||
std::move(cellMap),
|
||||
std::move(patchMap)
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1587,7 +1584,6 @@ void readProcAddressing
|
||||
//{
|
||||
// Pout<< "Reading addressing from " << io.name() << " at "
|
||||
// << mesh.facesInstance() << nl << endl;
|
||||
// distMap.clear();
|
||||
// distMap.reset(new IOmapDistributePolyMesh(io));
|
||||
//}
|
||||
//else
|
||||
@ -1604,7 +1600,7 @@ void readProcAddressing
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT
|
||||
),
|
||||
labelList(0)
|
||||
labelList()
|
||||
);
|
||||
labelIOList faceProcAddressing
|
||||
(
|
||||
@ -1616,7 +1612,7 @@ void readProcAddressing
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT
|
||||
),
|
||||
labelList(0)
|
||||
labelList()
|
||||
);
|
||||
labelIOList pointProcAddressing
|
||||
(
|
||||
@ -1628,7 +1624,7 @@ void readProcAddressing
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT
|
||||
),
|
||||
labelList(0)
|
||||
labelList()
|
||||
);
|
||||
labelIOList boundaryProcAddressing
|
||||
(
|
||||
@ -1640,7 +1636,7 @@ void readProcAddressing
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT
|
||||
),
|
||||
labelList(0)
|
||||
labelList()
|
||||
);
|
||||
|
||||
|
||||
@ -2580,7 +2576,7 @@ int main(int argc, char *argv[])
|
||||
runTime,
|
||||
IOobject::READ_IF_PRESENT
|
||||
),
|
||||
labelList(0)
|
||||
labelList()
|
||||
);
|
||||
if
|
||||
(
|
||||
|
||||
@ -49,7 +49,7 @@ Foam::tmp<Foam::Field<Type>> Foam::readParticleField
|
||||
if (obj != nullptr)
|
||||
{
|
||||
IOField<Type> newField(*obj);
|
||||
return tmp<Field<Type>>::New(newField.xfer());
|
||||
return tmp<Field<Type>>::New(std::move(newField));
|
||||
}
|
||||
|
||||
FatalErrorInFunction
|
||||
@ -77,7 +77,7 @@ void Foam::readFields
|
||||
{
|
||||
Info<< " reading field " << fieldNames[j] << endl;
|
||||
IOField<Type> newField(*obj);
|
||||
values.set(j, new List<Type>(newField.xfer()));
|
||||
values.set(j, new List<Type>(std::move(newField)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -865,7 +865,7 @@ int main(int argc, char *argv[])
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
globalFaceFaces
|
||||
std::move(globalFaceFaces)
|
||||
);
|
||||
IOglobalFaceFaces.write();
|
||||
|
||||
@ -881,7 +881,7 @@ int main(int argc, char *argv[])
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
visibleFaceFaces
|
||||
std::move(visibleFaceFaces)
|
||||
);
|
||||
IOvisibleFaceFaces.write();
|
||||
|
||||
@ -895,7 +895,7 @@ int main(int argc, char *argv[])
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
map.xfer()
|
||||
std::move(map)
|
||||
);
|
||||
|
||||
IOmapDist.write();
|
||||
|
||||
@ -287,7 +287,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
surf.xfer()
|
||||
std::move(surf)
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -364,7 +364,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Gather all ZoneIDs
|
||||
List<labelList> gatheredZones(Pstream::nProcs());
|
||||
gatheredZones[Pstream::myProcNo()] = compactZones.xfer();
|
||||
gatheredZones[Pstream::myProcNo()].transfer(compactZones);
|
||||
Pstream::gatherList(gatheredZones);
|
||||
|
||||
// On master combine all points, faces, zones
|
||||
@ -404,10 +404,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
UnsortedMeshedSurface<face> unsortedFace
|
||||
(
|
||||
xferMove(allPoints),
|
||||
xferMove(allFaces),
|
||||
xferMove(allZones),
|
||||
xferMove(surfZones)
|
||||
std::move(allPoints),
|
||||
std::move(allFaces),
|
||||
std::move(allZones),
|
||||
surfZones
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ void Foam::searchableSurfaceModifiers::cut::triangulate
|
||||
patchI
|
||||
);
|
||||
}
|
||||
cutSurf = triSurface(tris.xfer(), patches, pts.xfer());
|
||||
cutSurf = triSurface(tris, patches, pts, true);
|
||||
}
|
||||
|
||||
|
||||
@ -331,12 +331,12 @@ bool Foam::searchableSurfaceModifiers::cut::modify
|
||||
{
|
||||
if (volTypes[i] == volumeType::INSIDE)
|
||||
{
|
||||
nInside++;
|
||||
++nInside;
|
||||
}
|
||||
}
|
||||
|
||||
// Add a patch for inside the box
|
||||
if (nInside > 0 && surf3.patches().size() > 0)
|
||||
if (nInside && surf3.patches().size() > 0)
|
||||
{
|
||||
geometricSurfacePatchList newPatches(surf3.patches());
|
||||
label sz = newPatches.size();
|
||||
@ -362,7 +362,7 @@ bool Foam::searchableSurfaceModifiers::cut::modify
|
||||
}
|
||||
}
|
||||
pointField newPoints(surf3.points());
|
||||
surf = triSurface(newTris.xfer(), newPatches, newPoints.xfer());
|
||||
surf = triSurface(newTris, newPatches, newPoints, true);
|
||||
|
||||
changed = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user