Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
b414e15b
Commit
b414e15b
authored
Jan 21, 2011
by
mattijs
Browse files
ENH: meshSearch : avoid unnecessary mag()
parent
fe987dad
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/meshTools/meshSearch/meshSearch.C
View file @
b414e15b
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -101,9 +101,11 @@ Foam::label Foam::meshSearch::findNearestCellTree(const point& location) const
{
const
indexedOctree
<
treeDataCell
>&
tree
=
cellTree
();
scalar
span
=
tree
.
bb
().
mag
();
pointIndexHit
info
=
tree
.
findNearest
(
location
,
Foam
::
sqr
(
span
));
pointIndexHit
info
=
tree
.
findNearest
(
location
,
magSqr
(
tree
.
bb
().
max
()
-
tree
.
bb
().
min
())
);
if
(
!
info
.
hit
())
{
...
...
@@ -178,10 +180,12 @@ Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const
// Search nearest cell centre.
const
indexedOctree
<
treeDataCell
>&
tree
=
cellTree
();
scalar
span
=
tree
.
bb
().
mag
();
// Search with decent span
pointIndexHit
info
=
tree
.
findNearest
(
location
,
Foam
::
sqr
(
span
));
pointIndexHit
info
=
tree
.
findNearest
(
location
,
magSqr
(
tree
.
bb
().
max
()
-
tree
.
bb
().
min
())
);
if
(
!
info
.
hit
())
{
...
...
@@ -767,12 +771,10 @@ Foam::label Foam::meshSearch::findNearestBoundaryFace
{
const
indexedOctree
<
treeDataFace
>&
tree
=
boundaryTree
();
scalar
span
=
tree
.
bb
().
mag
();
pointIndexHit
info
=
boundaryTree
().
findNearest
(
location
,
Foam
::
sqr
(
span
)
magSqr
(
tree
.
bb
().
max
()
-
tree
.
bb
().
min
()
)
);
if
(
!
info
.
hit
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment