mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: indexedOctree : renamed find to findInside, changed findIndices to return reference.
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) 1991-2009 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,6 +25,12 @@ License
|
|||||||
|
|
||||||
#include "ListOps.H"
|
#include "ListOps.H"
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
const Foam::labelList Foam::emptyLabelList = Foam::labelList(0);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::labelList Foam::invert
|
Foam::labelList Foam::invert
|
||||||
|
|||||||
@ -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) 1991-2009 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -43,6 +43,16 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
extern const labelList emptyLabelList;
|
||||||
|
|
||||||
|
//- Return reference to zero-sized list. Compare to List::null() which returns
|
||||||
|
// null pointer cast as list reference.
|
||||||
|
template<class Type>
|
||||||
|
static const List<Type>& emptyList()
|
||||||
|
{
|
||||||
|
return *reinterpret_cast<const List<Type>* >(&emptyLabelList);
|
||||||
|
}
|
||||||
|
|
||||||
//- Renumber the values (not the indices) of a list.
|
//- Renumber the values (not the indices) of a list.
|
||||||
// Negative ListType elements are left as is.
|
// Negative ListType elements are left as is.
|
||||||
template<class ListType>
|
template<class ListType>
|
||||||
|
|||||||
@ -2497,7 +2497,7 @@ Foam::labelBits Foam::indexedOctree<Type>::findNode
|
|||||||
|
|
||||||
|
|
||||||
template <class Type>
|
template <class Type>
|
||||||
Foam::label Foam::indexedOctree<Type>::find(const point& sample) const
|
Foam::label Foam::indexedOctree<Type>::findInside(const point& sample) const
|
||||||
{
|
{
|
||||||
labelBits index = findNode(0, sample);
|
labelBits index = findNode(0, sample);
|
||||||
|
|
||||||
@ -2526,7 +2526,7 @@ Foam::label Foam::indexedOctree<Type>::find(const point& sample) const
|
|||||||
|
|
||||||
|
|
||||||
template <class Type>
|
template <class Type>
|
||||||
Foam::labelList Foam::indexedOctree<Type>::findIndices
|
const Foam::labelList& Foam::indexedOctree<Type>::findIndices
|
||||||
(
|
(
|
||||||
const point& sample
|
const point& sample
|
||||||
) const
|
) const
|
||||||
@ -2544,7 +2544,7 @@ Foam::labelList Foam::indexedOctree<Type>::findIndices
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return labelList(0);
|
return emptyList<label>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -552,11 +552,12 @@ public:
|
|||||||
// Use getNode and getOctant to extract info, or call findIndices.
|
// Use getNode and getOctant to extract info, or call findIndices.
|
||||||
labelBits findNode(const label nodeI, const point&) const;
|
labelBits findNode(const label nodeI, const point&) const;
|
||||||
|
|
||||||
//- Find shape containing point in tree
|
//- Find shape containing point. Only implemented for certain
|
||||||
label find(const point&) const;
|
// shapes.
|
||||||
|
label findInside(const point&) const;
|
||||||
|
|
||||||
//- Find the shape indices that occupy the result of findNode
|
//- Find the shape indices that occupy the result of findNode
|
||||||
labelList findIndices(const point&) const;
|
const labelList& findIndices(const point&) const;
|
||||||
|
|
||||||
//- Determine type (inside/outside/mixed) for point. unknown if
|
//- Determine type (inside/outside/mixed) for point. unknown if
|
||||||
// cannot be determined (e.g. non-manifold surface)
|
// cannot be determined (e.g. non-manifold surface)
|
||||||
|
|||||||
@ -745,7 +745,7 @@ Foam::label Foam::meshSearch::findCell
|
|||||||
{
|
{
|
||||||
if (useTreeSearch)
|
if (useTreeSearch)
|
||||||
{
|
{
|
||||||
return cellTree().find(location);
|
return cellTree().findInside(location);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user