From 2d7f45738a8b2d78cb3fdff488da2320435e0519 Mon Sep 17 00:00:00 2001 From: graham Date: Fri, 10 Dec 2010 20:34:31 +0000 Subject: [PATCH] ENH: Renaming "corners" in boundBox to "points". Overridden in treeBoundBox. Keeping both functions to ensure that the octant ordering specified in treeBoundBox is obeyed at the octree level, irrespective of the implementation of the basic boundBox. --- .../utilities/surface/surfaceCheck/surfaceCheck.C | 2 +- src/OpenFOAM/meshes/boundBox/boundBox.C | 2 +- src/OpenFOAM/meshes/boundBox/boundBox.H | 2 +- .../basic/InteractionLists/InteractionLists.C | 10 +++++----- .../conformalVoronoiMesh/conformalVoronoiMesh.C | 2 +- src/meshTools/octree/treeBoundBox.C | 10 +++++++--- src/meshTools/octree/treeBoundBox.H | 2 +- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/applications/utilities/surface/surfaceCheck/surfaceCheck.C b/applications/utilities/surface/surfaceCheck/surfaceCheck.C index 577f1470ae..85593d457f 100644 --- a/applications/utilities/surface/surfaceCheck/surfaceCheck.C +++ b/applications/utilities/surface/surfaceCheck/surfaceCheck.C @@ -212,7 +212,7 @@ int main(int argc, char *argv[]) // write bounding box corners if (args.optionFound("blockMesh")) { - pointField cornerPts = boundBox(surf.points()).corners(); + pointField cornerPts = boundBox(surf.points()).points(); Info<<"// blockMeshDict info" << nl; diff --git a/src/OpenFOAM/meshes/boundBox/boundBox.C b/src/OpenFOAM/meshes/boundBox/boundBox.C index 74061716c2..279412ab4d 100644 --- a/src/OpenFOAM/meshes/boundBox/boundBox.C +++ b/src/OpenFOAM/meshes/boundBox/boundBox.C @@ -111,7 +111,7 @@ Foam::boundBox::boundBox(Istream& is) // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -Foam::tmp Foam::boundBox::corners() const +Foam::tmp Foam::boundBox::points() const { tmp tPts = tmp(new pointField(8)); pointField& pt = tPts(); diff --git a/src/OpenFOAM/meshes/boundBox/boundBox.H b/src/OpenFOAM/meshes/boundBox/boundBox.H index bd3edfa5ea..b55aa90de8 100644 --- a/src/OpenFOAM/meshes/boundBox/boundBox.H +++ b/src/OpenFOAM/meshes/boundBox/boundBox.H @@ -177,7 +177,7 @@ public: } //- Return corner points in an order corresponding to a 'hex' cell - tmp corners() const; + tmp points() const; // Query diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.C b/src/lagrangian/basic/InteractionLists/InteractionLists.C index 511fcc74d5..4636911d5a 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionLists.C +++ b/src/lagrangian/basic/InteractionLists/InteractionLists.C @@ -179,7 +179,7 @@ void Foam::InteractionLists::buildInteractionLists() treeBoundBox tempTransformedBb ( - transform.invTransform(cellBbsToExchange[bbI].corners()) + transform.invTransform(cellBbsToExchange[bbI].points()) ); treeBoundBox extendedBb @@ -396,7 +396,7 @@ void Foam::InteractionLists::buildInteractionLists() treeBoundBox tempTransformedBb ( - transform.invTransform(wallFaceBbsToExchange[bbI].corners()) + transform.invTransform(wallFaceBbsToExchange[bbI].points()) ); treeBoundBox extendedBb @@ -701,7 +701,7 @@ void Foam::InteractionLists::findExtendedProcBbsInRange ( transform.transform ( - allExtendedProcBbs[procI].corners() + allExtendedProcBbs[procI].points() ) ); @@ -748,7 +748,7 @@ void Foam::InteractionLists::findExtendedProcBbsInRange ( transform.transform ( - allExtendedProcBbs[procI].corners() + allExtendedProcBbs[procI].points() ) ); @@ -791,7 +791,7 @@ void Foam::InteractionLists::findExtendedProcBbsInRange ( transform.transform ( - allExtendedProcBbs[procI].corners() + allExtendedProcBbs[procI].points() ) ); diff --git a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C index 42d5c1ae81..47d049e20d 100644 --- a/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C +++ b/src/mesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C @@ -486,7 +486,7 @@ void Foam::conformalVoronoiMesh::createFeaturePoints() { Info<< nl << "Creating bounding points" << endl; - pointField farPts = geometryToConformTo_.bounds().corners(); + pointField farPts = geometryToConformTo_.bounds().points(); // Shift corners of bounds relative to origin farPts -= geometryToConformTo_.bounds().midpoint(); diff --git a/src/meshTools/octree/treeBoundBox.C b/src/meshTools/octree/treeBoundBox.C index 8906affeaa..9499e53b0e 100644 --- a/src/meshTools/octree/treeBoundBox.C +++ b/src/meshTools/octree/treeBoundBox.C @@ -192,15 +192,19 @@ Foam::treeBoundBox::treeBoundBox(Istream& is) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::pointField Foam::treeBoundBox::points() const +Foam::tmp Foam::treeBoundBox::points() const { - pointField points(8); + tmp tPts = tmp(new pointField(8)); + + pointField& points = tPts(); + forAll(points, octant) { points[octant] = corner(octant); } - return points; + + return tPts; } diff --git a/src/meshTools/octree/treeBoundBox.H b/src/meshTools/octree/treeBoundBox.H index f462c719ae..824a9d4b5f 100644 --- a/src/meshTools/octree/treeBoundBox.H +++ b/src/meshTools/octree/treeBoundBox.H @@ -191,7 +191,7 @@ public: inline scalar typDim() const; //- vertex coordinates. In octant coding. - pointField points() const; + tmp points() const; // Check