diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.C b/src/OpenFOAM/meshes/meshShapes/face/face.C index 21576535e9aad00966b892337190341a071ef953..41650aad6c16d94bb3d16308ca740dae47871a44 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.C +++ b/src/OpenFOAM/meshes/meshShapes/face/face.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -829,4 +829,26 @@ Foam::label Foam::face::trianglesQuads } +Foam::label Foam::longestEdge(const face& f, const pointField& pts) +{ + const edgeList& eds = f.edges(); + + label longestEdgeI = -1; + scalar longestEdgeLength = -SMALL; + + forAll(eds, edI) + { + scalar edgeLength = eds[edI].mag(pts); + + if (edgeLength > longestEdgeLength) + { + longestEdgeI = edI; + longestEdgeLength = edgeLength; + } + } + + return longestEdgeI; +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.H b/src/OpenFOAM/meshes/meshShapes/face/face.H index c481258a3cc2d1803cee7239354c32950eec1fc5..adedf991bd79e260bab805a6d5e8fb1e9f2b5af7 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.H +++ b/src/OpenFOAM/meshes/meshShapes/face/face.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -408,6 +408,12 @@ public: }; +// Global functions + +//- Find the longest edge on a face. Face point labels index into pts. +label longestEdge(const face& f, const pointField& pts); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/edgeCollapser.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/edgeCollapser.C index 70c2e7c558cafe5179d88c91ab29cf28330a6b99..6ea1e748b052e3205fc31ec17f2b2b2faf24ebde 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/edgeCollapser.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/edgeCollapser.C @@ -42,32 +42,6 @@ defineTypeNameAndDebug(edgeCollapser, 0); } -Foam::label Foam::edgeCollapser::longestEdge -( - const face& f, - const pointField& pts -) -{ - const edgeList& eds = f.edges(); - - label longestEdgeI = -1; - scalar longestEdgeLength = -SMALL; - - forAll(eds, edI) - { - scalar edgeLength = eds[edI].mag(pts); - - if (edgeLength > longestEdgeLength) - { - longestEdgeI = edI; - longestEdgeLength = edgeLength; - } - } - - return longestEdgeI; -} - - Foam::HashSet<Foam::label> Foam::edgeCollapser::checkBadFaces ( const polyMesh& mesh, diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/edgeCollapser.H b/src/dynamicMesh/polyTopoChange/polyTopoChange/edgeCollapser.H index 2393458cf77be0add69297f9589e5b71d8b9e180..dab8bd298b0becb2bdae6c9c9b9ccd58e4e45d3e 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/edgeCollapser.H +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/edgeCollapser.H @@ -262,9 +262,6 @@ public: // Check - //- Find the longest edge in a face - static label longestEdge(const face& f, const pointField& pts); - //- Calls motionSmoother::checkMesh and returns a set of bad faces static HashSet<label> checkBadFaces (