mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of noisy:/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -1623,6 +1623,8 @@ void Foam::indexedOctree<Type>::traverseNode
|
|||||||
{
|
{
|
||||||
const labelList& indices = contents_[getContent(index)];
|
const labelList& indices = contents_[getContent(index)];
|
||||||
|
|
||||||
|
if (indices.size())
|
||||||
|
{
|
||||||
if (findAny)
|
if (findAny)
|
||||||
{
|
{
|
||||||
// Find any intersection
|
// Find any intersection
|
||||||
@ -1634,6 +1636,8 @@ void Foam::indexedOctree<Type>::traverseNode
|
|||||||
point pt;
|
point pt;
|
||||||
bool hit = shapes_.intersects(shapeI, start, end, pt);
|
bool hit = shapes_.intersects(shapeI, start, end, pt);
|
||||||
|
|
||||||
|
// Note that intersection of shape might actually be
|
||||||
|
// in a neighbouring box. For findAny this is not important.
|
||||||
if (hit)
|
if (hit)
|
||||||
{
|
{
|
||||||
// Hit so pt is nearer than nearestPoint.
|
// Hit so pt is nearer than nearestPoint.
|
||||||
@ -1647,7 +1651,9 @@ void Foam::indexedOctree<Type>::traverseNode
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Find nearest intersection.
|
// Find nearest intersection
|
||||||
|
|
||||||
|
const treeBoundBox octantBb(subBbox(nodeI, octant));
|
||||||
|
|
||||||
point nearestPoint(end);
|
point nearestPoint(end);
|
||||||
|
|
||||||
@ -1656,9 +1662,20 @@ void Foam::indexedOctree<Type>::traverseNode
|
|||||||
label shapeI = indices[elemI];
|
label shapeI = indices[elemI];
|
||||||
|
|
||||||
point pt;
|
point pt;
|
||||||
bool hit = shapes_.intersects(shapeI, start, nearestPoint, pt);
|
bool hit = shapes_.intersects
|
||||||
|
(
|
||||||
|
shapeI,
|
||||||
|
start,
|
||||||
|
nearestPoint,
|
||||||
|
pt
|
||||||
|
);
|
||||||
|
|
||||||
if (hit)
|
// Note that intersection of shape might actually be
|
||||||
|
// in a neighbouring box. Since we need to maintain strict
|
||||||
|
// (findAny=false) ordering skip such an intersection. It
|
||||||
|
// will be found when we are doing the next box.
|
||||||
|
|
||||||
|
if (hit && octantBb.contains(pt))
|
||||||
{
|
{
|
||||||
// Hit so pt is nearer than nearestPoint.
|
// Hit so pt is nearer than nearestPoint.
|
||||||
nearestPoint = pt;
|
nearestPoint = pt;
|
||||||
@ -1676,6 +1693,7 @@ void Foam::indexedOctree<Type>::traverseNode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Nothing intersected in this node
|
// Nothing intersected in this node
|
||||||
// Traverse to end of node. Do by ray tracing back from end and finding
|
// Traverse to end of node. Do by ray tracing back from end and finding
|
||||||
|
|||||||
Reference in New Issue
Block a user