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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion opm/autodiff/WellStateFullyImplicitBlackoil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ namespace Opm
data::Wells res = WellState::report();

const int nw = this->numWells();
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?)


/* this is a reference or example on **how** to convert from
* WellState to something understood by opm-output. it is intended
Expand Down