mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
made xfer constructors explicit, with trickle down to polyMesh/fvMesh calls
This commit is contained in:
@ -206,9 +206,9 @@ int main(int argc, char *argv[])
|
||||
runTime.timeName(),
|
||||
runTime
|
||||
),
|
||||
mesh.points(),
|
||||
mesh.faces(),
|
||||
mesh.cells()
|
||||
xferCopy(mesh.points()), // could we safely re-use the data?
|
||||
xferCopy(mesh.faces()),
|
||||
xferCopy(mesh.cells())
|
||||
);
|
||||
|
||||
// Add the boundary patches
|
||||
|
||||
@ -281,7 +281,7 @@ int main(int argc, char *argv[])
|
||||
)
|
||||
{
|
||||
// Scale points for the given scale factor
|
||||
points[i++] = scaleFactor*pointIter();
|
||||
points[i++] = scaleFactor * pointIter();
|
||||
}
|
||||
|
||||
|
||||
@ -479,7 +479,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
|
||||
@ -727,7 +727,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
|
||||
@ -856,10 +856,10 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
pointField(0),
|
||||
faceList(0),
|
||||
labelList(0),
|
||||
labelList(0)
|
||||
xferCopy(pointField()),
|
||||
xferCopy(faceList()),
|
||||
xferCopy(labelList()),
|
||||
xferCopy(labelList())
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -1158,7 +1158,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cellShapes,
|
||||
patches,
|
||||
patchNames,
|
||||
|
||||
@ -851,7 +851,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cells,
|
||||
boundary,
|
||||
patchNames,
|
||||
|
||||
@ -38,7 +38,7 @@ Description
|
||||
fluentMeshWithInternalFaces).
|
||||
|
||||
A use of the cell zone information, is for field initialization with the
|
||||
"setFields" utility. see the classes: topoSetSource, zoneToCell.
|
||||
"setFields" utility. see the classes: topoSetSource, zoneToCell.
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
@ -166,7 +166,7 @@ label findInternalFace(const primitiveMesh& mesh, const labelList& meshF)
|
||||
if (nMatched == meshF.size())
|
||||
{
|
||||
return faceI;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@ -835,7 +835,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cells,
|
||||
boundaryFaces,
|
||||
boundaryPatchNames,
|
||||
@ -951,7 +951,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
zoneName = iter();
|
||||
}
|
||||
|
||||
|
||||
Info<< "Writing zone " << zoneI << " to cellZone "
|
||||
<< zoneName << " and cellSet"
|
||||
<< endl;
|
||||
|
||||
@ -907,14 +907,14 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
polyPoints,
|
||||
xferMove(polyPoints),
|
||||
cellVerts,
|
||||
patchFaceVerts, //boundaryFaces,
|
||||
patchNames, //boundaryPatchNames,
|
||||
wordList(patchNames.size(), polyPatch::typeName), //boundaryPatchTypes,
|
||||
"defaultFaces", //defaultFacesName
|
||||
polyPatch::typeName, //defaultFacesType,
|
||||
wordList(0) //boundaryPatchPhysicalTypes
|
||||
patchFaceVerts, // boundaryFaces,
|
||||
patchNames, // boundaryPatchNames,
|
||||
wordList(patchNames.size(), polyPatch::typeName), // boundaryPatchTypes,
|
||||
"defaultFaces", // defaultFacesName
|
||||
polyPatch::typeName, // defaultFacesType,
|
||||
wordList(0) // boundaryPatchPhysicalTypes
|
||||
);
|
||||
|
||||
mesh.write();
|
||||
|
||||
@ -576,7 +576,7 @@ polyMesh pShapeMesh
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
|
||||
@ -140,7 +140,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cells,
|
||||
faceListList(0),
|
||||
wordList(0),
|
||||
@ -153,7 +153,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "Writing mesh ..." << endl;
|
||||
|
||||
mesh.write();
|
||||
|
||||
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
|
||||
@ -306,7 +306,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cells,
|
||||
patchFaces,
|
||||
patchNames,
|
||||
|
||||
@ -232,7 +232,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
newPoints,
|
||||
xferMove(newPoints),
|
||||
cellShapes,
|
||||
boundary,
|
||||
patchNames,
|
||||
|
||||
@ -47,7 +47,7 @@ void sammMesh::writeMesh()
|
||||
runTime_.constant(),
|
||||
runTime_
|
||||
),
|
||||
points_,
|
||||
xferCopy(points_), // we could probably re-use the data
|
||||
cellShapes_,
|
||||
boundary_,
|
||||
patchNames_,
|
||||
@ -76,9 +76,9 @@ void sammMesh::writeMesh()
|
||||
runTime_.constant(),
|
||||
runTime_
|
||||
),
|
||||
points_,
|
||||
meshFaces_,
|
||||
cellPolys_
|
||||
xferCopy(points_), // we could probably re-use the data
|
||||
xferCopy(meshFaces_),
|
||||
xferCopy(cellPolys_)
|
||||
);
|
||||
|
||||
pMesh.addPatches(polyBoundaryPatches(pMesh));
|
||||
|
||||
@ -51,7 +51,7 @@ void starMesh::writeMesh()
|
||||
runTime_.constant(),
|
||||
runTime_
|
||||
),
|
||||
points_,
|
||||
xferCopy(points_), // we could probably re-use the data
|
||||
cellShapes_,
|
||||
boundary_,
|
||||
patchNames_,
|
||||
@ -82,9 +82,9 @@ void starMesh::writeMesh()
|
||||
runTime_.constant(),
|
||||
runTime_
|
||||
),
|
||||
points_,
|
||||
meshFaces_,
|
||||
cellPolys_
|
||||
xferCopy(points_), // we could probably re-use the data
|
||||
xferCopy(meshFaces_),
|
||||
xferCopy(cellPolys_)
|
||||
);
|
||||
|
||||
// adding patches also checks the mesh
|
||||
|
||||
@ -322,11 +322,11 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferCopy(points),
|
||||
cells,
|
||||
faceListList(0),
|
||||
wordList(0), //boundaryPatchNames
|
||||
wordList(0), //boundaryPatchTypes
|
||||
wordList(0), // boundaryPatchNames
|
||||
wordList(0), // boundaryPatchTypes
|
||||
"defaultFaces",
|
||||
polyPatch::typeName,
|
||||
wordList(0)
|
||||
@ -531,7 +531,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
points,
|
||||
xferMove(points),
|
||||
cells,
|
||||
patchFaces,
|
||||
patchNames,
|
||||
|
||||
@ -217,7 +217,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
runTime
|
||||
),
|
||||
blocks.points(),
|
||||
xferCopy(blocks.points()), // could we re-use space?
|
||||
blocks.cells(),
|
||||
blocks.patches(),
|
||||
patchNames,
|
||||
|
||||
@ -425,7 +425,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
tmpBlockPoints,
|
||||
xferMove(tmpBlockPoints),
|
||||
tmpBlockCells,
|
||||
tmpBlocksPatches,
|
||||
patchNames,
|
||||
|
||||
@ -48,7 +48,7 @@ template
|
||||
template<class> class FaceList,
|
||||
class PointField
|
||||
>
|
||||
Foam::pointField Foam::extrudedMesh::extrudedPoints
|
||||
Foam::xfer<Foam::pointField> Foam::extrudedMesh::extrudedPoints
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
@ -76,12 +76,13 @@ Foam::pointField Foam::extrudedMesh::extrudedPoints
|
||||
}
|
||||
}
|
||||
|
||||
return ePoints;
|
||||
// return points for transferring
|
||||
return xferMove(ePoints);
|
||||
}
|
||||
|
||||
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
Foam::faceList Foam::extrudedMesh::extrudedFaces
|
||||
Foam::xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
@ -177,12 +178,13 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces
|
||||
);
|
||||
}
|
||||
|
||||
return eFaces;
|
||||
// return points for transferring
|
||||
return xferMove(eFaces);
|
||||
}
|
||||
|
||||
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
Foam::cellList Foam::extrudedMesh::extrudedCells
|
||||
Foam::xfer<Foam::cellList> Foam::extrudedMesh::extrudedCells
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
@ -283,7 +285,8 @@ Foam::cellList Foam::extrudedMesh::extrudedCells
|
||||
facei++;
|
||||
}
|
||||
|
||||
return eCells;
|
||||
// return points for transferring
|
||||
return xferMove(eCells);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -63,26 +63,26 @@ class extrudedMesh
|
||||
|
||||
//- Construct and return the extruded mesh points
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
pointField extrudedPoints
|
||||
xfer<pointField> extrudedPoints
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
const extrudeModel&
|
||||
);
|
||||
|
||||
//- Construct and return the extruded mesh faces
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
faceList extrudedFaces
|
||||
xfer<faceList> extrudedFaces
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
const extrudeModel&
|
||||
);
|
||||
|
||||
//- Construct and return the extruded mesh cells
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
cellList extrudedCells
|
||||
xfer<cellList> extrudedCells
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
const extrudeModel&
|
||||
);
|
||||
|
||||
|
||||
@ -101,9 +101,9 @@ public:
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
extrudedMesh
|
||||
(
|
||||
const IOobject& io,
|
||||
const IOobject&,
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const extrudeModel& model
|
||||
const extrudeModel&
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@ -374,9 +374,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
mirrorMeshPtr_ = new fvMesh
|
||||
(
|
||||
io,
|
||||
newPoints,
|
||||
newFaces,
|
||||
newCells
|
||||
xferMove(newPoints),
|
||||
xferMove(newFaces),
|
||||
xferMove(newCells)
|
||||
);
|
||||
|
||||
fvMesh& pMesh = *mirrorMeshPtr_;
|
||||
|
||||
@ -272,9 +272,9 @@ bool domainDecomposition::writeDecomposition()
|
||||
"constant",
|
||||
processorDb
|
||||
),
|
||||
procPoints,
|
||||
procFaces,
|
||||
procCells
|
||||
xferMove(procPoints),
|
||||
xferMove(procFaces),
|
||||
xferMove(procCells)
|
||||
);
|
||||
|
||||
// Create processor boundary patches
|
||||
|
||||
@ -506,9 +506,9 @@ int main(int argc, char *argv[])
|
||||
runTime,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
pointField(0),
|
||||
faceList(0),
|
||||
cellList(0)
|
||||
xferCopy(pointField()),
|
||||
xferCopy(faceList()),
|
||||
xferCopy(cellList())
|
||||
);
|
||||
|
||||
for (label procI = 0; procI < nProcs; procI++)
|
||||
|
||||
@ -70,10 +70,10 @@ autoPtr<fvMesh> createMesh
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
pointField(0),
|
||||
faceList(0),
|
||||
labelList(0),
|
||||
labelList(0)
|
||||
xferCopy(pointField()),
|
||||
xferCopy(faceList()),
|
||||
xferCopy(labelList()),
|
||||
xferCopy(labelList())
|
||||
);
|
||||
|
||||
if (!haveMesh)
|
||||
|
||||
@ -90,10 +90,10 @@ public:
|
||||
inline explicit xfer(T* = 0);
|
||||
|
||||
//- Construct by copying or by transferring the parameter contents
|
||||
inline xfer(T&, bool allowTransfer=false);
|
||||
inline explicit xfer(T&, bool allowTransfer=false);
|
||||
|
||||
//- Construct by copying the parameter contents
|
||||
inline xfer(const T&);
|
||||
inline explicit xfer(const T&);
|
||||
|
||||
//- Construct by transferring the contents
|
||||
inline xfer(const xfer<T>&);
|
||||
|
||||
@ -1403,9 +1403,9 @@ Foam::polyDualMesh::polyDualMesh
|
||||
polyMesh
|
||||
(
|
||||
mesh,
|
||||
pointField(0),
|
||||
faceList(0),
|
||||
cellList(0)
|
||||
xferCopy(pointField()), // to prevent any warnings "points not allocated"
|
||||
xferCopy(faceList()), // to prevent any warnings "faces not allocated"
|
||||
xferCopy(cellList())
|
||||
),
|
||||
cellPoint_
|
||||
(
|
||||
@ -1448,9 +1448,9 @@ Foam::polyDualMesh::polyDualMesh
|
||||
polyMesh
|
||||
(
|
||||
mesh,
|
||||
pointField(0), // to prevent any warnings "points not allocated"
|
||||
faceList(0), // ,, faces ,,
|
||||
cellList(0)
|
||||
xferCopy(pointField()), // to prevent any warnings "points not allocated"
|
||||
xferCopy(faceList()), // to prevent any warnings "faces not allocated"
|
||||
xferCopy(cellList())
|
||||
),
|
||||
cellPoint_
|
||||
(
|
||||
@ -1482,7 +1482,6 @@ Foam::polyDualMesh::polyDualMesh
|
||||
labelList featureEdges, featurePoints;
|
||||
|
||||
calcFeatures(mesh, featureCos, featureEdges, featurePoints);
|
||||
|
||||
calcDual(mesh, featureEdges, featurePoints);
|
||||
}
|
||||
|
||||
|
||||
@ -1259,10 +1259,10 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshDistribute::receiveMesh
|
||||
runTime,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
domainPoints,
|
||||
domainFaces,
|
||||
domainAllOwner,
|
||||
domainAllNeighbour,
|
||||
xferMove(domainPoints),
|
||||
xferMove(domainFaces),
|
||||
xferMove(domainAllOwner),
|
||||
xferMove(domainAllNeighbour),
|
||||
false // no parallel comms
|
||||
)
|
||||
);
|
||||
|
||||
@ -675,9 +675,9 @@ void Foam::fvMeshSubset::setCellSubset
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
newPoints,
|
||||
newFaces,
|
||||
newCells
|
||||
xferMove(newPoints),
|
||||
xferMove(newFaces),
|
||||
xferMove(newCells)
|
||||
)
|
||||
);
|
||||
|
||||
@ -1173,9 +1173,9 @@ void Foam::fvMeshSubset::setLargeCellSubset
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
newPoints,
|
||||
newFaces,
|
||||
newCells,
|
||||
xferMove(newPoints),
|
||||
xferMove(newFaces),
|
||||
xferMove(newCells),
|
||||
syncPar // parallel synchronisation
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user