ENH: PrimitivePatch: construct from Xfer

This commit is contained in:
mattijs
2012-03-05 14:14:01 +00:00
parent f0d680d4c0
commit 903bcfc42c

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,6 +26,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "PrimitivePatch.H"
#include "argList.H" #include "argList.H"
#include "Time.H" #include "Time.H"
#include "polyMesh.H" #include "polyMesh.H"
@ -223,7 +224,9 @@ int main(int argc, char *argv[])
Info<< "Patch:" << patch.name() << endl; Info<< "Patch:" << patch.name() << endl;
PrimitivePatch<face, List, const pointField&> pp(patch, patch.points()); // Test addressing
{
myPrimitivePatch pp(patch, patch.points());
const pointField& localPoints = pp.localPoints(); const pointField& localPoints = pp.localPoints();
const faceList& localFaces = pp.localFaces(); const faceList& localFaces = pp.localFaces();
@ -242,6 +245,19 @@ int main(int argc, char *argv[])
writeEdgeFaces(localPoints, localFaces, edges, edgeFaces); writeEdgeFaces(localPoints, localFaces, edges, edgeFaces);
writeFaceFaces(localPoints, localFaces, faceFaces); writeFaceFaces(localPoints, localFaces, faceFaces);
}
// Test construction from Xfer
{
faceList patchFaces = patch;
pointField allPoints = patch.points();
PrimitivePatch<face, List, pointField, point> storedPatch
(
patchFaces.xfer(),
allPoints.xfer()
);
}
Info<< "End\n" << endl; Info<< "End\n" << endl;