From d1260a58e9b39b3e5015aad618859c603fc88941 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 26 Sep 2008 10:33:00 +0100 Subject: [PATCH 01/10] no pointField construction --- src/OpenFOAM/meshes/meshShapes/face/face.C | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.C b/src/OpenFOAM/meshes/meshShapes/face/face.C index bb0492735f..506600c31d 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.C +++ b/src/OpenFOAM/meshes/meshShapes/face/face.C @@ -526,7 +526,7 @@ Foam::point Foam::face::centre(const pointField& meshPoints) const } -Foam::vector Foam::face::normal(const pointField& meshPoints) const +Foam::vector Foam::face::normal(const pointField& p) const { // Calculate the normal by summing the face triangle normals. // Changed to deal with small concavity by using a central decomposition @@ -539,17 +539,22 @@ Foam::vector Foam::face::normal(const pointField& meshPoints) const { return triPointRef ( - meshPoints[operator[](0)], - meshPoints[operator[](1)], - meshPoints[operator[](2)] + p[operator[](0)], + p[operator[](1)], + p[operator[](2)] ).normal(); } + label nPoints = size(); + vector n = vector::zero; - point centrePoint = Foam::average(points(meshPoints)); - - label nPoints = size(); + point centrePoint = vector::zero; + for (pI = 0; pI < nPoints; pI++) + { + centrePoint += p[operator[](pI)]; + } + centrePoint /= nPoints; point nextPoint = centrePoint; @@ -559,18 +564,18 @@ Foam::vector Foam::face::normal(const pointField& meshPoints) const { if (pI < nPoints - 1) { - nextPoint = meshPoints[operator[](pI + 1)]; + nextPoint = p[operator[](pI + 1)]; } else { - nextPoint = meshPoints[operator[](0)]; + nextPoint = p[operator[](0)]; } // Note: for best accuracy, centre point always comes last // n += triPointRef ( - meshPoints[operator[](pI)], + p[operator[](pI)], nextPoint, centrePoint ).normal(); From e81c5a29e3971765e71f8ed20c99a595b0ea0299 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 26 Sep 2008 10:33:25 +0100 Subject: [PATCH 02/10] annoying message --- src/meshTools/sets/topoSets/faceSet.C | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/meshTools/sets/topoSets/faceSet.C b/src/meshTools/sets/topoSets/faceSet.C index 7c195ca0a9..95d8dcefe9 100644 --- a/src/meshTools/sets/topoSets/faceSet.C +++ b/src/meshTools/sets/topoSets/faceSet.C @@ -205,11 +205,12 @@ void faceSet::sync(const polyMesh& mesh) reduce(nAdded, sumOp