From ee8b1f433214bb926b90c5cc7e7e72fa8aeb571b Mon Sep 17 00:00:00 2001 From: laurence Date: Thu, 1 Aug 2013 10:42:33 +0100 Subject: [PATCH] BUG: foamyHexMesh: Incorrect logic for serial mesh motion --- .../DelaunayMesh/DelaunayMesh.C | 15 ------------ .../conformalVoronoiMesh.C | 23 +++++++++++++------ .../generation/foamyHexMesh/foamyHexMesh.C | 5 ++-- .../foamyHexMesh/vectorTools/vectorTools.H | 2 +- 4 files changed, 20 insertions(+), 25 deletions(-) diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMesh.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMesh.C index 581a019818..875e71b182 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMesh.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DelaunayMesh.C @@ -31,12 +31,6 @@ License #include "labelIOField.H" #include "pointConversion.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - - -// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * // - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template @@ -358,15 +352,6 @@ void Foam::DelaunayMesh::rangeInsertWithInfo } -// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // - - -// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * // - - -// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * // - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "DelaunayMeshIO.C" diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C index ea024a55fb..93dcd83436 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C @@ -1277,14 +1277,23 @@ void Foam::conformalVoronoiMesh::move() { const Foam::point newPt(0.5*(dVA + dVB)); - if - ( - Pstream::parRun() - && decomposition().positionOnThisProcessor(newPt) - ) + // Prevent insertions spanning surfaces + if (internalPointIsInside(newPt)) { - // Prevent insertions spanning surfaces - if (internalPointIsInside(newPt)) + if (Pstream::parRun()) + { + if + ( + decomposition().positionOnThisProcessor + ( + newPt + ) + ) + { + pointsToInsert.append(toPoint(newPt)); + } + } + else { pointsToInsert.append(toPoint(newPt)); } diff --git a/applications/utilities/mesh/generation/foamyHexMesh/foamyHexMesh.C b/applications/utilities/mesh/generation/foamyHexMesh/foamyHexMesh.C index d636a7e9e9..f435aa616a 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/foamyHexMesh.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/foamyHexMesh.C @@ -140,9 +140,10 @@ int main(int argc, char *argv[]) mesh.move(); - Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + Info<< nl + << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" - << endl; + << nl << endl; } } diff --git a/applications/utilities/mesh/generation/foamyHexMesh/vectorTools/vectorTools.H b/applications/utilities/mesh/generation/foamyHexMesh/vectorTools/vectorTools.H index a1b5d13816..a716a1bb68 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/vectorTools/vectorTools.H +++ b/applications/utilities/mesh/generation/foamyHexMesh/vectorTools/vectorTools.H @@ -47,7 +47,7 @@ namespace Foam //- Collection of functions for testing relationships between two vectors. namespace vectorTools { - //- Test if a and b are parallel: a.b = 1 + //- Test if a and b are parallel: a^b = 0 // Uses the cross product, so the tolerance is proportional to // the sine of the angle between a and b in radians template