From 4b5809ea7bd48d735c7a864653f85e032d34c317 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 16 May 2008 14:00:22 +0100 Subject: [PATCH] Printing of bounding box of patches --- .../mesh/manipulation/checkMesh/checkMesh.C | 2 +- .../manipulation/checkMesh/checkTopology.C | 73 ++++++++++++------- .../manipulation/checkMesh/checkTopology.H | 2 +- 3 files changed, 47 insertions(+), 30 deletions(-) diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C index dcbab5c1b9..ecfb565038 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) if (!noTopology) { - noFailedChecks += checkTopology(mesh, allTopology); + noFailedChecks += checkTopology(mesh, allTopology, allGeometry); } noFailedChecks += checkGeometry(mesh, allGeometry); diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C index 6fbb2c0bf9..85dc0bae62 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C @@ -7,7 +7,12 @@ #include "pointSet.H" #include "IOmanip.H" -Foam::label Foam::checkTopology(const polyMesh& mesh, const bool allTopology) +Foam::label Foam::checkTopology +( + const polyMesh& mesh, + const bool allTopology, + const bool allGeometry +) { label noFailedChecks = 0; @@ -142,39 +147,38 @@ Foam::label Foam::checkTopology(const polyMesh& mesh, const bool allTopology) << setw(20) << "Patch" << setw(9) << "Faces" << setw(9) << "Points" - << " Surface" << endl; + << setw(34) << "Surface topology"; + if (allGeometry) + { + Pout<< " Bounding box"; + } + Pout<< endl; forAll(patches, patchI) { const polyPatch& pp = patches[patchI]; + Pout<< " " + << setw(20) << pp.name() + << setw(9) << pp.size() + << setw(9) << pp.nPoints(); + + primitivePatch::surfaceTopo pTyp = pp.surfaceType(); if (pp.size() == 0) { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " ok (empty)" << endl; + Pout<< setw(34) << "ok (empty)"; } else if (pTyp == primitivePatch::MANIFOLD) { if (pp.checkPointManifold(true, &points)) { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " multiply connected (shared point)" << endl; + Pout<< setw(34) << "multiply connected (shared point)"; } else { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " ok (closed singly connected surface)" << endl; + Pout<< setw(34) << "ok (closed singly connected)"; } // Add points on non-manifold edges to make set complete @@ -186,22 +190,35 @@ Foam::label Foam::checkTopology(const polyMesh& mesh, const bool allTopology) if (pTyp == primitivePatch::OPEN) { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " ok (not multiply connected)" << endl; + Pout<< setw(34) << "ok (non-closed singly connected)"; } else { - Pout<< " " - << setw(20) << pp.name() - << setw(9) << pp.size() - << setw(9) << pp.nPoints() - << " multiply connected surface (shared edge)" - << endl; + Pout<< setw(34) << "multiply connected (shared edge)"; } } + + if (allGeometry) + { + const pointField& pts = pp.points(); + const labelList& mp = pp.meshPoints(); + + boundBox bb(vector::zero, vector::zero); + if (returnReduce(mp.size(), sumOp