diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C index 2480f2dc75ff30b0b71d569791b4704a3b440e42..ada7d06b5bc5df1e0b255187576be016ddb0e175 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -2535,16 +2535,6 @@ Foam::labelBits Foam::indexedOctree<Type>::findNode const node& nod = nodes_[nodeI]; - if (debug) - { - if (!nod.bb_.contains(sample)) - { - FatalErrorInFunction - << "Cannot find " << sample << " in node " << nodeI - << abort(FatalError); - } - } - direction octant = nod.bb_.subOctant(sample); labelBits index = nod.subNodes_[octant]; diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index adaec0eb8e4c40cd927b1fa57213ea59386c63f7..b8ada24283f8f6cdd4f1f95bc3c6d7273da4bb88 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -1130,6 +1130,21 @@ Foam::tmp<Foam::scalarField> Foam::polyMesh::movePoints geometricD_ = Zero; solutionD_ = Zero; + // Reset cell tree - it gets built from mesh geometry so might have + // wrong boxes. It is correct as long as none of the cells leaves + // the boxes it is in which most likely is almost never the case except + // for tiny displacements. An alternative is to check the displacements + // to see if they are tiny - imagine a big windtunnel with a small rotating + // object. In this case the processors without the rotating object wouldn't + // have to clear any geometry. However your critical path still stays the + // same so no time would be gained (unless the decomposition gets weighted). + // Small benefit for lots of scope for problems so not done. + cellTreePtr_.clear(); + + // Note: tet-base decomposition does not get cleared. Ideally your face + // decomposition should not change during mesh motion ... + + meshObject::movePoints<polyMesh>(*this); meshObject::movePoints<pointMesh>(*this);