From 88c1626b5bd482ec585c220c01ff0839712de619 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 12 Sep 2019 13:54:26 +0100 Subject: [PATCH] ENH: indexedOctree: print max leaf size --- src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C index 2c3cea29c7..7b1c7bd43c 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C @@ -2239,8 +2239,10 @@ Foam::indexedOctree::indexedOctree { // Count number of references into shapes (i.e. contents) label nEntries = 0; + label maxEntries = 0; forAll(contents, i) { + maxEntries = max(maxEntries, contents[i].size()); nEntries += contents[i].size(); } @@ -2253,6 +2255,8 @@ Foam::indexedOctree::indexedOctree << " nEntries per shape (duplicity):" << nEntries/shapes.size() << nl + << " max nEntries:" << maxEntries + << nl << endl; } @@ -2328,8 +2332,10 @@ Foam::indexedOctree::indexedOctree if (debug) { label nEntries = 0; + label maxEntries = 0; forAll(contents_, i) { + maxEntries = max(maxEntries, contents_[i].size()); nEntries += contents_[i].size(); } @@ -2348,6 +2354,8 @@ Foam::indexedOctree::indexedOctree << scalar(nEntries)/contents.size() << nl << " per shape (duplicity):" << scalar(nEntries)/shapes.size() << nl + << " max nEntries:" << maxEntries + << nl << " total memory:" << memSize-oldMemSize << endl; }