mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-18 21:43:27 -06:00
Fix access to keywords, while still silencing warning.
Previous fix was wrong because it called getKeyword() outside the hasKeyword() check. Current version (like original code) uses the short-circuiting behaviour of && to ensure this.
This commit is contained in:
parent
b225970686
commit
ba26696d22
@ -525,8 +525,8 @@ namespace Opm
|
||||
for (size_t i = 0; i < rec.size(); ++i) {
|
||||
const int cell = *(eqlmap.cells(i).begin());
|
||||
if (rec[i].live_oil_table_index > 0) {
|
||||
const int tab_size = newParserDeck->getKeyword("RSVD")->size();
|
||||
if (newParserDeck->hasKeyword("RSVD") && rec[i].live_oil_table_index <= tab_size) {
|
||||
if (newParserDeck->hasKeyword("RSVD") &&
|
||||
size_t(rec[i].live_oil_table_index) <= newParserDeck->getKeyword("RSVD")->size()) {
|
||||
Opm::SimpleTable rsvd(newParserDeck->getKeyword("RSVD"),std::vector<std::string>{"vd", "rs"},rec[i].live_oil_table_index-1);
|
||||
std::vector<double> vd(rsvd.getColumn("vd"));
|
||||
std::vector<double> rs(rsvd.getColumn("rs"));
|
||||
@ -556,8 +556,8 @@ namespace Opm
|
||||
for (size_t i = 0; i < rec.size(); ++i) {
|
||||
const int cell = *(eqlmap.cells(i).begin());
|
||||
if (rec[i].wet_gas_table_index > 0) {
|
||||
const int tab_size = newParserDeck->getKeyword("RVVD")->size();
|
||||
if (newParserDeck->hasKeyword("RVVD") && rec[i].wet_gas_table_index <= tab_size) {
|
||||
if (newParserDeck->hasKeyword("RVVD") &&
|
||||
size_t(rec[i].wet_gas_table_index) <= newParserDeck->getKeyword("RVVD")->size()) {
|
||||
Opm::SimpleTable rvvd(newParserDeck->getKeyword("RVVD"),std::vector<std::string>{"vd", "rv"},rec[i].wet_gas_table_index-1);
|
||||
std::vector<double> vd(rvvd.getColumn("vd"));
|
||||
std::vector<double> rv(rvvd.getColumn("rv"));
|
||||
|
Loading…
Reference in New Issue
Block a user