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
f7d4e8a8
Commit
f7d4e8a8
authored
Jan 29, 2020
by
mattijs
Browse files
BUG: searchableExtrudedCircle: incorrect search sphere. Fixes
#1567
.
parent
fdece1d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/meshTools/searchableSurfaces/searchableExtrudedCircle/searchableExtrudedCircle.C
View file @
f7d4e8a8
...
...
@@ -181,13 +181,35 @@ void Foam::searchableExtrudedCircle::findNearest
forAll
(
samples
,
i
)
{
info
[
i
]
=
tree
.
findNearest
(
samples
[
i
],
nearestDistSqr
[
i
]);
const
scalar
nearestDist
=
Foam
::
sqrt
(
nearestDistSqr
[
i
]);
const
scalar
searchDistSqr
=
Foam
::
sqr
(
nearestDist
+
radius_
);
// Find nearest on central edge
info
[
i
]
=
tree
.
findNearest
(
samples
[
i
],
searchDistSqr
);
if
(
info
[
i
].
hit
())
{
const
vector
d
=
normalised
(
samples
[
i
]
-
info
[
i
].
hitPoint
());
// Derive distance to nearest surface from distance to nearest edge
const
vector
d
(
samples
[
i
]
-
info
[
i
].
hitPoint
());
const
scalar
s
(
mag
(
d
));
info
[
i
].
setPoint
(
info
[
i
].
hitPoint
()
+
d
*
radius_
);
if
(
s
<
ROOTVSMALL
)
{
// Point is on edge. TBD.
info
[
i
].
setMiss
();
}
else
{
const
scalar
distToSurface
=
radius_
-
s
;
if
(
mag
(
distToSurface
)
>
nearestDist
)
{
info
[
i
].
setMiss
();
}
else
{
info
[
i
].
setPoint
(
info
[
i
].
hitPoint
()
+
d
/
s
*
radius_
);
}
}
}
}
}
...
...
src/meshTools/searchableSurfaces/searchableExtrudedCircle/searchableExtrudedCircle.H
View file @
f7d4e8a8
...
...
@@ -38,7 +38,9 @@ Description
\endtable
Note
The edge mesh file is to be located in the constant/geometry directory.
- The edge mesh file is to be located in the constant/geometry directory.
- Can not be used with snappyHexMesh since only implements nearest
searching.
SourceFiles
searchableExtrudedCircle.C
...
...
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