[GL] Enlarge delta for grid meta data computation.#1369
[GL] Enlarge delta for grid meta data computation.#1369TomFischer merged 1 commit intoufz:masterfrom
Conversation
|
Jenkins: OGS-6/Linux-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs/2661/ |
|
Jenkins: OGS-6/Linux-PRs-dynamic failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs-dynamic/884/ |
|
Jenkins, test this please. |
|
Jenkins: OGS-6/Linux-PRs-dynamic failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs-dynamic/894/ |
|
Jenkins: OGS-6/Linux-PRs failed: https://svn.ufz.de:8443/job/OGS-6/job/Linux-PRs/2671/ |
|
Jenkins, test this please. |
|
|
||
| // enlarge delta | ||
| for (auto & d : delta) | ||
| d = std::nextafter(d, std::numeric_limits<double>::max()); |
There was a problem hiding this comment.
delta is the space diagonal of the bbox of the grid? Why do you have to extend it such a tiny bit?
There was a problem hiding this comment.
Yes, delta is the space diagonal of the bounding box and also of the grid. The bounding box itself is extended already such a tiny bit during its construction. But when delta is computed from the bounding box the tiny extension of the bounding box could get lost because of numerical precision. So here the delta is enlarged again such that all points fits into the grid.
There was a problem hiding this comment.
I'm not really happy with this. I think the result of std::nextafter can be cancelled out by very many arithmetic operations (e.g. adding or subtracting a large number). I think multiplying with 1+eps would be more robust, but I don't know if that has any implications for our current code.
So if nobody else objects and the solution works for you: ⏩
There was a problem hiding this comment.
I think the result of std::nextafter can be cancelled out by very many arithmetic operations (e.g. adding or subtracting a large number).
In general you re right. The bounding box is an half open interval. As you pointed out already out the arithmetic operations computing delta cancel out the results of std::nextafter in the bounding box. For this reason I reenlarge delta.
I think multiplying with 1+eps would be more robust ...
Sometimes all points have the same z coordinate, i.e., the delta[2] == 0. So the half open interval has to be enlarged. In this case the multiplication with 1+eps does not lead to the desired solution.
|
⏩ |
|
OpenGeoSys development has been moved to GitLab. |
As titled.