Make numWellVars work for null well pointers.

This commit is contained in:
Markus Blatt 2016-06-27 13:06:16 +02:00 committed by Liu Ming
parent 1a1797a061
commit b4feb28389

View File

@ -153,8 +153,13 @@ namespace Opm
int
StandardWells::numWellVars() const
{
if ( !localWellsActive() )
{
return 0;
}
// For each well, we have a bhp variable, and one flux per phase.
const int nw = localWellsActive() ? wells().number_of_wells : 0;
const int nw = wells().number_of_wells;
return (numPhases() + 1) * nw;
}