Allow access to wells pointer for wells.

Using &stdwells.wells() throws an assertion for null pointers
without -DNDEBUG, but was used nevertheless. That prevented running
models without wells.
This commit is contained in:
Markus Blatt 2016-06-27 13:03:30 +02:00 committed by Liu Ming
parent 227b7f49b7
commit 68f9180a65
5 changed files with 15 additions and 1 deletions

View File

@ -223,7 +223,7 @@ namespace detail {
// TODO: put this for now to avoid modify the following code.
// TODO: this code can be fragile.
const Wells* wells_arg = &(asImpl().well_model_.wells());
const Wells* wells_arg = asImpl().well_model_.wellsPointer();
#if HAVE_MPI
if ( linsolver_.parallelInformation().type() == typeid(ParallelISTLInformation) )

View File

@ -294,6 +294,12 @@ namespace Opm {
}
const Wells*
MultisegmentWells::wellsPointer() const
{
return wells_;
}

View File

@ -102,6 +102,8 @@ namespace Opm {
const Wells& wells() const;
const Wells* wellsPointer() const;
int numPhases() const { return num_phases_; };
int numWells() const { return wells_multisegment_.size(); }

View File

@ -74,6 +74,8 @@ namespace Opm {
const Wells& wells() const;
const Wells* wellsPointer() const;
/// return true if wells are available in the reservoir
bool wellsActive() const;
void setWellsActive(const bool wells_active);

View File

@ -115,6 +115,10 @@ namespace Opm
}
const Wells* StandardWells::wellsPointer() const
{
return wells_;
}