diff --git a/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C b/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C index ecd1d89e07..3ef8060efa 100644 --- a/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C +++ b/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C @@ -43,18 +43,11 @@ Description #include "argList.H" #include "polyMesh.H" #include "Time.H" -#include "undoableMeshCutter.H" -#include "hexCellLooper.H" #include "cellSet.H" -#include "twoDPointCorrector.H" -#include "directions.H" -#include "OFstream.H" #include "multiDirRefinement.H" #include "labelIOList.H" -#include "wedgePolyPatch.H" -#include "plane.H" -#include "SubField.H" #include "IOdictionary.H" +#include "syncTools.H" using namespace Foam; @@ -65,7 +58,7 @@ static const scalar edgeTol = 1e-3; // Print edge statistics on mesh. -void printEdgeStats(const primitiveMesh& mesh) +void printEdgeStats(const polyMesh& mesh) { label nX = 0; label nY = 0; @@ -73,66 +66,90 @@ void printEdgeStats(const primitiveMesh& mesh) scalar minX = GREAT; scalar maxX = -GREAT; - vector x(1, 0, 0); + static const vector x(1, 0, 0); scalar minY = GREAT; scalar maxY = -GREAT; - vector y(0, 1, 0); + static const vector y(0, 1, 0); scalar minZ = GREAT; scalar maxZ = -GREAT; - vector z(0, 0, 1); + static const vector z(0, 0, 1); scalar minOther = GREAT; scalar maxOther = -GREAT; + PackedBoolList isMasterEdge(syncTools::getMasterEdges(mesh)); + const edgeList& edges = mesh.edges(); forAll(edges, edgeI) { - const edge& e = edges[edgeI]; - - vector eVec(e.vec(mesh.points())); - - scalar eMag = mag(eVec); - - eVec /= eMag; - - if (mag(eVec & x) > 1-edgeTol) + if (isMasterEdge[edgeI]) { - minX = min(minX, eMag); - maxX = max(maxX, eMag); - nX++; - } - else if (mag(eVec & y) > 1-edgeTol) - { - minY = min(minY, eMag); - maxY = max(maxY, eMag); - nY++; - } - else if (mag(eVec & z) > 1-edgeTol) - { - minZ = min(minZ, eMag); - maxZ = max(maxZ, eMag); - nZ++; - } - else - { - minOther = min(minOther, eMag); - maxOther = max(maxOther, eMag); + const edge& e = edges[edgeI]; + + vector eVec(e.vec(mesh.points())); + + scalar eMag = mag(eVec); + + eVec /= eMag; + + if (mag(eVec & x) > 1-edgeTol) + { + minX = min(minX, eMag); + maxX = max(maxX, eMag); + nX++; + } + else if (mag(eVec & y) > 1-edgeTol) + { + minY = min(minY, eMag); + maxY = max(maxY, eMag); + nY++; + } + else if (mag(eVec & z) > 1-edgeTol) + { + minZ = min(minZ, eMag); + maxZ = max(maxZ, eMag); + nZ++; + } + else + { + minOther = min(minOther, eMag); + maxOther = max(maxOther, eMag); + } } } - Pout<< "Mesh edge statistics:" << endl + label nEdges = mesh.nEdges(); + reduce(nEdges, sumOp