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

Fix handling of no wells in WellStateFullyImplicitBlackoil.hpp #742

Merged
merged 1 commit into from
Jun 27, 2016

Conversation

blattms
Copy link
Member

@blattms blattms commented Jun 27, 2016

In that case we cannot call numPhases() on the wells as it produces
a floating point exception. As we do not use that information in this case
anyway, we simply use -1 instead to prevent the call.

Closes #731

In that case we cannot call numPhases() on the wells as it produces
a floating point exception. As we do not use that information in this case
anyway, we simply use -1 instead to prevent the call.
const int np = this->numPhases();
// If there are now wells numPhases throws a floating point
// exception.
const int np = nw ? this->numPhases() : -1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more elegant fix: move the np variable inside the for-loop, since it is only used there. (Won't require, tell me if you want to do that or keep this as currently proposed.)

Copy link
Member Author

@blattms blattms Jun 27, 2016 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

(But I don't see why we'd need an if, that was the point of putting it in the loop where it would unconditionally be ok?)

@atgeirr atgeirr merged commit 4d834ee into OPM:master Jun 27, 2016
@blattms blattms deleted the fix-wellstate-for-no-wells branch June 27, 2016 13:54
akva2 added a commit to akva2/opm-simulators that referenced this pull request Jan 13, 2023
return proper communicator for DUNE2.6 (<2.7)
akva2 added a commit to akva2/opm-simulators that referenced this pull request Sep 2, 2024
return proper communicator for DUNE2.6 (<2.7)
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

Successfully merging this pull request may close these issues.

2 participants