From 65baa26a804e46ca42ad93ab6a45a6c27f0d6110 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs@hunt.opencfd.co.uk>
Date: Thu, 26 Feb 2009 20:14:20 +0000
Subject: [PATCH] mergeDist never set.

---
 .../distributedTriSurfaceMesh.C               | 75 ++++++++++++++-----
 .../distributedTriSurfaceMesh.H               |  5 +-
 2 files changed, 59 insertions(+), 21 deletions(-)

diff --git a/src/meshTools/searchableSurface/distributedTriSurfaceMesh.C b/src/meshTools/searchableSurface/distributedTriSurfaceMesh.C
index 501998cafcd..7f86c0f6581 100644
--- a/src/meshTools/searchableSurface/distributedTriSurfaceMesh.C
+++ b/src/meshTools/searchableSurface/distributedTriSurfaceMesh.C
@@ -76,10 +76,8 @@ bool Foam::distributedTriSurfaceMesh::read()
     // Distribution type
     distType_ = distributionTypeNames_.read(dict_.lookup("distributionType"));
 
-    if (dict_.found("mergeDistance"))
-    {
-        dict_.lookup("mergeDistance") >> mergeDist_;
-    }
+    // Merge distance
+    mergeDist_ = readScalar(dict_.lookup("mergeDistance"));
 
     return true;
 }
@@ -1346,6 +1344,19 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
     {
         Info<< "Constructed from triSurface:" << endl;
         writeStats(Info);
+
+        labelList nTris(Pstream::nProcs());
+        nTris[Pstream::myProcNo()] = triSurface::size();
+        Pstream::gatherList(nTris);
+        Pstream::scatterList(nTris);
+
+        Info<< endl<< "\tproc\ttris\tbb" << endl;
+        forAll(nTris, procI)
+        {
+            Info<< '\t' << procI << '\t' << nTris[procI]
+                 << '\t' << procBb_[procI] << endl;
+        }
+        Info<< endl;
     }
 }
 
@@ -1370,13 +1381,13 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh(const IOobject& io)
     (
         IOobject
         (
-            triSurfaceMesh::name() + "Dict",
-            triSurfaceMesh::instance(),
-            triSurfaceMesh::local(),
-            triSurfaceMesh::db(),
-            triSurfaceMesh::readOpt(),
-            triSurfaceMesh::writeOpt(),
-            triSurfaceMesh::registerObject()
+            searchableSurface::name() + "Dict",
+            searchableSurface::instance(),
+            searchableSurface::local(),
+            searchableSurface::db(),
+            searchableSurface::readOpt(),
+            searchableSurface::writeOpt(),
+            searchableSurface::registerObject()
         )
     )
 {
@@ -1387,6 +1398,19 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh(const IOobject& io)
         Info<< "Read distributedTriSurface from " << io.objectPath()
             << ':' << endl;
         writeStats(Info);
+
+        labelList nTris(Pstream::nProcs());
+        nTris[Pstream::myProcNo()] = triSurface::size();
+        Pstream::gatherList(nTris);
+        Pstream::scatterList(nTris);
+
+        Info<< endl<< "\tproc\ttris\tbb" << endl;
+        forAll(nTris, procI)
+        {
+            Info<< '\t' << procI << '\t' << nTris[procI]
+                 << '\t' << procBb_[procI] << endl;
+        }
+        Info<< endl;
     }
 }
 
@@ -1416,13 +1440,13 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
     (
         IOobject
         (
-            triSurfaceMesh::name() + "Dict",
-            triSurfaceMesh::instance(),
-            triSurfaceMesh::local(),
-            triSurfaceMesh::db(),
-            triSurfaceMesh::readOpt(),
-            triSurfaceMesh::writeOpt(),
-            triSurfaceMesh::registerObject()
+            searchableSurface::name() + "Dict",
+            searchableSurface::instance(),
+            searchableSurface::local(),
+            searchableSurface::db(),
+            searchableSurface::readOpt(),
+            searchableSurface::writeOpt(),
+            searchableSurface::registerObject()
         )
     )
 {
@@ -1433,6 +1457,19 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
         Info<< "Read distributedTriSurface from " << io.objectPath()
             << " and dictionary:" << endl;
         writeStats(Info);
+
+        labelList nTris(Pstream::nProcs());
+        nTris[Pstream::myProcNo()] = triSurface::size();
+        Pstream::gatherList(nTris);
+        Pstream::scatterList(nTris);
+
+        Info<< endl<< "\tproc\ttris\tbb" << endl;
+        forAll(nTris, procI)
+        {
+            Info<< '\t' << procI << '\t' << nTris[procI]
+                 << '\t' << procBb_[procI] << endl;
+        }
+        Info<< endl;
     }
 }
 
@@ -2436,6 +2473,8 @@ void Foam::distributedTriSurfaceMesh::writeStats(Ostream& os) const
     boundBox bb;
     label nPoints;
     calcBounds(bb, nPoints);
+    reduce(bb.min(), minOp<point>());
+    reduce(bb.max(), maxOp<point>());
 
     os  << "Triangles    : " << returnReduce(triSurface::size(), sumOp<label>())
         << endl
diff --git a/src/meshTools/searchableSurface/distributedTriSurfaceMesh.H b/src/meshTools/searchableSurface/distributedTriSurfaceMesh.H
index 678f1199d4c..4d5f7dfd173 100644
--- a/src/meshTools/searchableSurface/distributedTriSurfaceMesh.H
+++ b/src/meshTools/searchableSurface/distributedTriSurfaceMesh.H
@@ -91,15 +91,14 @@ public:
 
 private:
 
+    // Private member data
+
         //- Merging distance
         scalar mergeDist_;
 
         //- Decomposition used when independently decomposing surface.
         autoPtr<decompositionMethod> decomposer_;
 
-
-    // Private member data
-
         //- Bounding box settings
         IOdictionary dict_;
 
-- 
GitLab