BUG: octree.C : tree building criterion needs to look at any change in tree.

This commit is contained in:
mattijs
2011-05-23 12:24:13 +01:00
parent a2919d8079
commit c334f75873

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -149,6 +149,7 @@ Foam::octree<Type>::octree
// - has some guaranteed maximum size (maxShapeRatio)
label oldNLeaves = -1; // make test below pass first time.
label oldNNodes = -1;
deepestLevel_ = 1;
while
(
@ -169,11 +170,11 @@ Foam::octree<Type>::octree
break;
}
if (oldNLeaves == nLeaves())
if ((oldNLeaves == nLeaves()) && (oldNNodes == nNodes()))
{
if (debug & 1)
{
Pout<< "octree : exiting since nLeaves does not change"
Pout<< "octree : exiting since nLeaves and nNodes do not change"
<< endl;
}
break;
@ -185,6 +186,7 @@ Foam::octree<Type>::octree
}
oldNLeaves = nLeaves();
oldNNodes = nNodes();
topNode_->redistribute
(