View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001102 | OpenFOAM | Bug | public | 2013-12-05 21:50 | 2013-12-06 09:11 |
Reporter | wyldckat | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | sometimes |
Status | resolved | Resolution | fixed | ||
Summary | 0001102: Bug in Foam::searchableSphere::findNearest | ||||
Description | This is somewhat of an odd bug, which I triggered by accident. And after looking at the source code since 1.7.x, it's this way at least since then! When using snappyHexMesh, with a "searchableSphere", if the centre is located in an identical location to the "sample" point, it will lead to a sigFpe in the method "Foam::searchableSphere::findNearest". This is because - as implied in the patch provided on the section "Steps To Reproduce" - if the "magN" value is smaller than "ROOTVSMALL" (1e-150 in scalar of type double), it will still try to divide "1/magN". The curious result is that if by any chance the value for "magN" were indeed "1e-151" or similar, then the "rawPoint" would be located at "1e151", which is a pretty far away point for something that should be nearby ;) | ||||
Steps To Reproduce | diff --git a/src/meshTools/searchableSurface/searchableSphere.C b/src/meshTools/searchableSurface/searchableSphere.C index 5f3e98a..d9d8538 100644 --- a/src/meshTools/searchableSurface/searchableSphere.C +++ b/src/meshTools/searchableSurface/searchableSphere.C @@ -54,7 +54,7 @@ Foam::pointIndexHit Foam::searchableSphere::findNearest { if (magN < ROOTVSMALL) { - info.rawPoint() = centre_ + vector(1,0,0)/magN*radius_; + info.rawPoint() = centre_; } else { | ||||
Additional Information | I had a quick look at the other "searchable" geometries and couldn't find anything like this. But I did accidentally find the method "Foam::face::contactSphereDiameter" in "src/OpenFOAM/meshes/meshShapes/face/faceContactSphere.C" and it relies on the usual mathematical trick: vector n1 = n/(magN + SMALL); | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2013-12-05 21:50 | wyldckat | New Issue | |
2013-12-06 09:11 |
|
Note Added: 0002675 | |
2013-12-06 09:11 |
|
Status | new => resolved |
2013-12-06 09:11 |
|
Fixed in Version | => 2.2.x |
2013-12-06 09:11 |
|
Resolution | open => fixed |
2013-12-06 09:11 |
|
Assigned To | => user4 |