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