From 63e24812c280f3719a56517f63bcd7d941a30b9a Mon Sep 17 00:00:00 2001 From: graham Date: Mon, 13 Dec 2010 14:39:55 +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 +++++----- src/meshTools/octree/treeBoundBox.C | 10 +++++++--- src/meshTools/octree/treeBoundBox.H | 2 +- 6 files changed, 16 insertions(+), 12 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 2f510bc9e7..0c110b8509 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/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