Commit 9a4de953 authored by Mark Olesen's avatar Mark Olesen
Browse files

made xfer constructors explicit, with trickle down to polyMesh/fvMesh calls

parent aa2eba40
......@@ -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_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment