Skip to content
Snippets Groups Projects
Commit 03fb8f04 authored by mattijs's avatar mattijs
Browse files

ENH: cyclicAMI: restart search with large bounding box. Fixes #3175

parent 45ec64e6
No related branches found
No related tags found
1 merge request!695OpenFOAM v2406
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2015-2022 OpenCFD Ltd. Copyright (C) 2015-2022,2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -335,9 +335,15 @@ Foam::label Foam::advancingFrontAMI::findTargetFace ...@@ -335,9 +335,15 @@ Foam::label Foam::advancingFrontAMI::findTargetFace
const point srcPt = const point srcPt =
srcFacePti == -1 ? bb.centre() : srcPts[srcFace[srcFacePti]]; srcFacePti == -1 ? bb.centre() : srcPts[srcFace[srcFacePti]];
const pointIndexHit sample = pointIndexHit sample =
treePtr_->findNearest(srcPt, 0.25*bb.magSqr(), fnOp); treePtr_->findNearest(srcPt, 0.25*bb.magSqr(), fnOp);
if (!sample.hit())
{
// Fall-back for extreme cases. Should only occur sparsely
sample = treePtr_->findNearest(srcPt, Foam::sqr(GREAT), fnOp);
}
if (sample.hit() && isCandidate(srcFacei, sample.index())) if (sample.hit() && isCandidate(srcFacei, sample.index()))
{ {
targetFacei = sample.index(); targetFacei = sample.index();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment