From 449b7d77315f4539ec6ab3b1962dacdaa3bce88b Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 22 Nov 2012 09:11:39 +0000 Subject: [PATCH] ENH: polyMeshGeometry: added flatness check --- .../motionSmoother/motionSmootherCheck.C | 51 ++++++- .../polyMeshGeometry/polyMeshGeometry.C | 137 +++++++++++++++++- .../polyMeshGeometry/polyMeshGeometry.H | 25 +++- 3 files changed, 206 insertions(+), 7 deletions(-) diff --git a/src/dynamicMesh/motionSmoother/motionSmootherCheck.C b/src/dynamicMesh/motionSmoother/motionSmootherCheck.C index da20ea741e..77ce89ca71 100644 --- a/src/dynamicMesh/motionSmoother/motionSmootherCheck.C +++ b/src/dynamicMesh/motionSmoother/motionSmootherCheck.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,6 +104,8 @@ bool Foam::motionSmoother::checkMesh ( readScalar(dict.lookup("minTriangleTwist", true)) ); + scalar minFaceFlatness = -1.0; + dict.readIfPresent("minFaceFlatness", minFaceFlatness, true); const scalar minDet ( readScalar(dict.lookup("minDeterminant", true)) @@ -356,6 +358,30 @@ bool Foam::motionSmoother::checkMesh nWrongFaces = nNewWrongFaces; } + if (minFaceFlatness > -SMALL) + { + polyMeshGeometry::checkFaceFlatness + ( + report, + minFaceFlatness, + mesh, + mesh.faceAreas(), + mesh.faceCentres(), + mesh.points(), + checkFaces, + &wrongFaces + ); + + label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp