Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_satfunc is broken #916

Open
akva2 opened this issue Oct 26, 2015 · 8 comments
Open

test_satfunc is broken #916

akva2 opened this issue Oct 26, 2015 · 8 comments

Comments

@akva2
Copy link
Member

akva2 commented Oct 26, 2015

The 'test_satfunc' is rather broken, or rather it highlights an issue with current code that warrants investigation.

Round-off causes significant application behavior in the interpolation classes. In particular, 6 tests break on x86 due to this. In particular values in 'dkrds' arrays significantly differ. This is due to evaluation of derivatives in kinks - undefined behavior in the first place. Due to different rounding we get the 'other' wrong value on x86. Note that this is not tied to architecture as such, if the code was built on arm it would likely fails as well (but possibly in other ways..)

I reckon the proper fix is to don't try to obtain undefined values.

@andlaus
Copy link
Contributor

andlaus commented Oct 26, 2015

I reckon the proper fix is to don't try to obtain undefined values.

I'd like to add that this issue can be also fixed by using C^1 or higher interpolation functions like monotonic splines, but this would result in results which are different from E100. (and thus they're probably unacceptable?)

@atgeirr
Copy link
Member

atgeirr commented Oct 26, 2015

I agree that this is undefined, unless we want to make certain guarantees about what value we return in the kinks. The question has been raised, especially about the exact endpoints. While I love splines, for the purpose of Flow we cannot use the C^1 functions, so the tests must change.

It is not a showstopper for the release however.

@andlaus
Copy link
Contributor

andlaus commented Oct 26, 2015

unless we want to make certain guarantees what value we return in the kinks.

that's pretty hard to implement and also wouldn't fix the issue at hand: if the input saturation ends up on the "wrong" side of the kink due to some numerical noise caused by the architecture (think of a difference of e.g. 10^-15), the returned derivative would be completely different anyway.

@atgeirr
Copy link
Member

atgeirr commented Oct 26, 2015

if the input saturation ends up on the "wrong" side of the kink due to some numerical noise caused by the architecture (think of a difference of e.g. 10^-15), the returned derivative would be completely different anyway.

I was thinking of tests that explicitly check the endpoints for example, then it might be possible. However I think we have agreed not to expect any particular behaviour at kinks.

@atgeirr
Copy link
Member

atgeirr commented Apr 15, 2016

@akva2 Is this still a problem?

@akva2
Copy link
Member Author

akva2 commented Apr 15, 2016

yes, nothing has changed as far as i know.

@andlaus
Copy link
Contributor

andlaus commented Apr 15, 2016

yes, nothing has changed as far as i know.

probably the test should be changed so that it does not check for the derivatives at kinks? testing the behaviour for something which is mathematically undefined is not a very smart idea IMO: normally it just makes the test to be adapted to the implementation and that is what happened with this unit test. (as far as I can see, this applies to the code before and after the switch to opm-material.)

@atgeirr
Copy link
Member

atgeirr commented Apr 15, 2016

I agree, testing at the kinks is inherently bad, regardless of the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants