ENH: indexedOctree: print memory size

This commit is contained in:
mattijs
2013-09-12 15:24:12 +01:00
parent 6daff22a52
commit 0cb4e1ecd8

View File

@ -27,6 +27,7 @@ License
#include "linePointRef.H" #include "linePointRef.H"
#include "OFstream.H" #include "OFstream.H"
#include "ListOps.H" #include "ListOps.H"
#include "memInfo.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -2383,12 +2384,14 @@ Foam::indexedOctree<Type>::indexedOctree
contents_(0), contents_(0),
nodeTypes_(0) nodeTypes_(0)
{ {
int oldMemSize = 0;
if (debug) if (debug)
{ {
Pout<< "indexedOctree<Type>::indexedOctree:" << nl Pout<< "indexedOctree<Type>::indexedOctree:" << nl
<< " shapes:" << shapes.size() << nl << " shapes:" << shapes.size() << nl
<< " bb:" << bb << nl << " bb:" << bb << nl
<< endl; << endl;
oldMemSize = memInfo().size();
} }
if (shapes.size() == 0) if (shapes.size() == 0)
@ -2503,6 +2506,9 @@ Foam::indexedOctree<Type>::indexedOctree
nEntries += contents_[i].size(); nEntries += contents_[i].size();
} }
label memSize = memInfo().size();
Pout<< "indexedOctree<Type>::indexedOctree" Pout<< "indexedOctree<Type>::indexedOctree"
<< " : finished construction of tree of:" << shapes.typeName << " : finished construction of tree of:" << shapes.typeName
<< nl << nl
@ -2515,6 +2521,7 @@ Foam::indexedOctree<Type>::indexedOctree
<< scalar(nEntries)/contents.size() << nl << scalar(nEntries)/contents.size() << nl
<< " per shape (duplicity):" << " per shape (duplicity):"
<< scalar(nEntries)/shapes.size() << nl << scalar(nEntries)/shapes.size() << nl
<< " total memory:" << memSize-oldMemSize
<< endl; << endl;
} }
} }