mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-18 21:43:27 -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
cae4d39a86
commit
9f99484347
@ -264,6 +264,11 @@ namespace Opm
|
|||||||
if (deck->hasKeyword("DISGAS")) {
|
if (deck->hasKeyword("DISGAS")) {
|
||||||
const TableContainer& rsvdTables = tables.getRsvdTables();
|
const TableContainer& rsvdTables = tables.getRsvdTables();
|
||||||
for (size_t i = 0; i < rec.size(); ++i) {
|
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());
|
const int cell = *(eqlmap.cells(i).begin());
|
||||||
if (!rec[i].liveOilInitConstantRs()) {
|
if (!rec[i].liveOilInitConstantRs()) {
|
||||||
if (rsvdTables.size() <= 0 ) {
|
if (rsvdTables.size() <= 0 ) {
|
||||||
@ -297,6 +302,11 @@ namespace Opm
|
|||||||
if (deck->hasKeyword("VAPOIL")) {
|
if (deck->hasKeyword("VAPOIL")) {
|
||||||
const TableContainer& rvvdTables = tables.getRvvdTables();
|
const TableContainer& rvvdTables = tables.getRvvdTables();
|
||||||
for (size_t i = 0; i < rec.size(); ++i) {
|
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());
|
const int cell = *(eqlmap.cells(i).begin());
|
||||||
if (!rec[i].wetGasInitConstantRv()) {
|
if (!rec[i].wetGasInitConstantRv()) {
|
||||||
if (rvvdTables.size() <= 0) {
|
if (rvvdTables.size() <= 0) {
|
||||||
@ -381,6 +391,10 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
for (const auto& r : reg.activeRegions()) {
|
for (const auto& r : reg.activeRegions()) {
|
||||||
const auto& cells = reg.cells(r);
|
const auto& cells = reg.cells(r);
|
||||||
|
if (cells.empty())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const int repcell = *cells.begin();
|
const int repcell = *cells.begin();
|
||||||
|
|
||||||
const RhoCalc calc(props, repcell);
|
const RhoCalc calc(props, repcell);
|
||||||
|
Loading…
Reference in New Issue
Block a user