From dcc82bf77b8851fd90275550984264202c24b2a7 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 31 Dec 2008 17:58:23 +0100 Subject: [PATCH] boundingBox has mag() and span() methods - use them --- .../generation/blockMesh/createMergeList.C | 2 +- .../mesh/generation/extrudeMesh/extrudeMesh.C | 4 +- .../generation/snappyHexMesh/snappyHexMesh.C | 2 +- .../manipulation/checkMesh/checkGeometry.C | 2 +- .../reconstructParMesh/reconstructParMesh.C | 19 +++++----- .../redistributeMeshPar/redistributeMeshPar.C | 36 +++++++----------- .../surface/surfaceCheck/surfaceCheck.C | 12 +++--- .../surface/surfaceToPatch/surfaceToPatch.C | 9 ++--- src/OpenFOAM/meshes/boundBox/boundBox.H | 11 ++++++ .../polyMesh/globalMeshData/globalMeshData.C | 4 +- .../autoHexMeshDriver/autoHexMeshDriver.C | 10 ++--- .../autoHexMesh/shellSurfaces/shellSurfaces.C | 2 +- .../polyTopoChange/polyTopoChange/hexRef8.C | 3 +- .../displacementSBRStressFvMotionSolver.C | 6 +-- .../displacementInterpolationFvMotionSolver.C | 8 ++-- .../displacementLaplacianFvMotionSolver.C | 10 ++--- ...aceSlipDisplacementPointPatchVectorField.C | 6 +-- .../directMappedPolyPatch.C | 2 +- .../indexedOctree/treeDataTriSurface.C | 2 +- src/meshTools/meshSearch/meshSearch.C | 8 ++-- src/meshTools/octree/treeBoundBoxI.H | 10 ++--- .../booleanSurface/booleanSurface.C | 16 +++----- .../orientedSurface/orientedSurface.C | 6 +-- src/randomProcesses/Kmesh/Kmesh.C | 37 +++++++++---------- .../cubeRootVolDelta/cubeRootVolDelta.C | 2 +- 25 files changed, 106 insertions(+), 123 deletions(-) diff --git a/applications/utilities/mesh/generation/blockMesh/createMergeList.C b/applications/utilities/mesh/generation/blockMesh/createMergeList.C index b6e91a3ca0..5e07c75de2 100644 --- a/applications/utilities/mesh/generation/blockMesh/createMergeList.C +++ b/applications/utilities/mesh/generation/blockMesh/createMergeList.C @@ -93,7 +93,7 @@ Foam::labelList Foam::blockMesh::createMergeList() // the size of the block. boundBox bb(blockCells[blockPlabel].points(blockFaces, blockPoints)); - const scalar mergeSqrDist = SMALL*magSqr(bb.max() - bb.min()); + const scalar mergeSqrDist = SMALL*magSqr(bb.span()); // This is an N^2 algorithm diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C index bcb9df59c0..94bdfc5f72 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C @@ -177,9 +177,9 @@ int main(int argc, char *argv[]) const boundBox& bb = mesh.globalData().bb(); - const vector span(bb.max() - bb.min()); + const vector span = bb.span(); const scalar minDim = min(span[0], min(span[1], span[2])); - const scalar mergeDim = 1E-4*minDim; + const scalar mergeDim = 1E-4 * minDim; Pout<< "Mesh bounding box:" << bb << nl << " with span:" << span << nl diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index edcfbf2aee..a749a1a390 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -55,7 +55,7 @@ using namespace Foam; scalar getMergeDistance(const polyMesh& mesh, const scalar mergeTol) { const boundBox& meshBb = mesh.bounds(); - scalar mergeDist = mergeTol*mag(meshBb.max() - meshBb.min()); + scalar mergeDist = mergeTol * meshBb.mag(); scalar writeTol = std::pow ( scalar(10.0), diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C index 8eb1f3f05f..52f23658a8 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C @@ -20,7 +20,7 @@ Foam::label Foam::checkGeometry(const polyMesh& mesh, const bool allGeometry) // Min length - scalar minDistSqr = magSqr(1e-6*(globalBb.max() - globalBb.min())); + scalar minDistSqr = magSqr(1e-6 * globalBb.span()); // Non-empty directions const Vector