From d68c31eb235dd1490ed6146e3c324f63f98d6793 Mon Sep 17 00:00:00 2001 From: laurence Date: Mon, 29 Jul 2013 15:51:46 +0100 Subject: [PATCH] ENH: foamyHexMesh: Move variable construction outside of loop --- .../searchableSurfaceControl.C | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/searchableSurfaceControl/searchableSurfaceControl.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/searchableSurfaceControl/searchableSurfaceControl.C index c2294f98a4..bff35cff69 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/searchableSurfaceControl/searchableSurfaceControl.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/cellShapeControl/cellSizeAndAlignmentControl/searchableSurfaceControl/searchableSurfaceControl.C @@ -328,7 +328,7 @@ Foam::searchableSurfaceControl::searchableSurfaceControl cellSizeFunctions_.reorder(invertedFunctionPriorities); - Info<< nl << "There are " << cellSizeFunctions_.size() + Info<< nl << indent << "There are " << cellSizeFunctions_.size() << " region control functions" << endl; } @@ -487,24 +487,25 @@ void Foam::searchableSurfaceControl::cellSizeFunctionVertices const scalar nearFeatDistSqrCoeff = 1e-8; + pointField ptField(1, vector::min); + scalarField distField(1, nearFeatDistSqrCoeff); + List infoList(1, pointIndexHit()); + + vectorField normals(1); + labelList region(1, -1); + forAll(points, pI) { // Is the point in the extendedFeatureEdgeMesh? If so get the // point normal, otherwise get the surface normal from // searchableSurface - - pointField ptField(1, points[pI]); - scalarField distField(1, nearFeatDistSqrCoeff); - List infoList(1, pointIndexHit()); + ptField[0] = points[pI]; searchableSurface_.findNearest(ptField, distField, infoList); if (infoList[0].hit()) { - vectorField normals(1); searchableSurface_.getNormal(infoList, normals); - - labelList region(1, -1); searchableSurface_.getRegion(infoList, region); const cellSizeFunction& sizeFunc =