mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-30 13:03:49 -06:00
Prevent dereferencing the end iterator.
This happened for empty regions and surfaced when compiling with "-D_GLIBCXX_DEBUG -DDEBUG -DGLIBCXX_FORCE_NEW".
This commit is contained in:
parent
74430caae2
commit
f15a78ac9e
@ -264,6 +264,11 @@ namespace Opm
|
||||
if (deck->hasKeyword("DISGAS")) {
|
||||
const TableContainer& rsvdTables = tables.getRsvdTables();
|
||||
for (size_t i = 0; i < rec.size(); ++i) {
|
||||
if (eqlmap.cells(i).empty())
|
||||
{
|
||||
rs_func_.push_back(std::shared_ptr<Miscibility::RsVD>());
|
||||
continue;
|
||||
}
|
||||
const int cell = *(eqlmap.cells(i).begin());
|
||||
if (!rec[i].liveOilInitConstantRs()) {
|
||||
if (rsvdTables.size() <= 0 ) {
|
||||
@ -297,6 +302,11 @@ namespace Opm
|
||||
if (deck->hasKeyword("VAPOIL")) {
|
||||
const TableContainer& rvvdTables = tables.getRvvdTables();
|
||||
for (size_t i = 0; i < rec.size(); ++i) {
|
||||
if (eqlmap.cells(i).empty())
|
||||
{
|
||||
rv_func_.push_back(std::shared_ptr<Miscibility::RvVD>());
|
||||
continue;
|
||||
}
|
||||
const int cell = *(eqlmap.cells(i).begin());
|
||||
if (!rec[i].wetGasInitConstantRv()) {
|
||||
if (rvvdTables.size() <= 0) {
|
||||
@ -381,6 +391,10 @@ namespace Opm
|
||||
{
|
||||
for (const auto& r : reg.activeRegions()) {
|
||||
const auto& cells = reg.cells(r);
|
||||
if (cells.empty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
const int repcell = *cells.begin();
|
||||
|
||||
const RhoCalc calc(props, repcell);
|
||||
|
Loading…
Reference in New Issue
Block a user