mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use vector::empty() instead of size() to test for entries.
This commit is contained in:
parent
07e676371e
commit
b6c1a1533c
@ -840,8 +840,8 @@ namespace Opm {
|
||||
const auto& perf_data = this->well_perf_data_[wellID];
|
||||
|
||||
// Cater for case where local part might have no perforations.
|
||||
const int pvtreg = perf_data.size() ?
|
||||
pvt_region_idx_[perf_data.front().cell_index] : 0;
|
||||
const int pvtreg = perf_data.empty() ?
|
||||
0 : pvt_region_idx_[perf_data.front().cell_index];
|
||||
const auto& parallel_well_info = *local_parallel_well_info_[wellID];
|
||||
auto global_pvtreg = parallel_well_info.broadcastFirstPerforationValue(pvtreg);
|
||||
|
||||
|
@ -377,8 +377,8 @@ namespace Opm
|
||||
: (prod_controls.cmode == Well::ProducerCMode::GRUP);
|
||||
|
||||
const double inj_surf_rate = well.isInjector() ? inj_controls.surface_rate : 0.0; // To avoid a "maybe-uninitialized" warning.
|
||||
const double local_pressure = well_perf_data_[w].size() ?
|
||||
cellPressures[well_perf_data_[w][0].cell_index] : 0;
|
||||
const double local_pressure = well_perf_data_[w].empty() ?
|
||||
0 : cellPressures[well_perf_data_[w][0].cell_index];
|
||||
const double global_pressure = well_info.broadcastFirstPerforationValue(local_pressure);
|
||||
if (well.getStatus() == Well::Status::STOP) {
|
||||
// Stopped well:
|
||||
|
Loading…
Reference in New Issue
Block a user