mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-11-03 12:47:42 -06:00
replace std::fill with std::ranges::fill where appropriate
the c++-20 constrained algorithm is safer and code is more readable
This commit is contained in:
1 parent
4b2a574727
commit
f00ab30268
21 files changed
+56
-61
No files matched your search
@@ -283,7 +283,7 @@ void testQuadrature()
|
||||
|
||||
std::array<int, dim> cellRes;
|
||||
|
||||
std::fill(cellRes.begin(), cellRes.end(), 10);
|
||||
std::ranges::fill(cellRes, 10);
|
||||
|
||||
GlobalPosition upperRight(1.0);
|
||||
|
||||
|
||||
@@ -268,8 +268,8 @@ private:
|
||||
auto well_idx = ws.index("WELL-A");
|
||||
BOOST_REQUIRE(well_idx.has_value());
|
||||
auto& well = ws.well(well_idx.value());
|
||||
std::fill(well.surface_rates.begin(), well.surface_rates.end(), 0.0);
|
||||
std::fill(well.well_potentials.begin(), well.well_potentials.end(), 0.0);
|
||||
std::ranges::fill(well.surface_rates, 0.0);
|
||||
std::ranges::fill(well.well_potentials, 0.0);
|
||||
well.surface_rates[oil_phase_pos_] = wellARateSI();
|
||||
well.well_potentials[oil_phase_pos_] = -wellARateSI(); // positive
|
||||
well.production_cmode = well_a_control_;
|
||||
@@ -280,8 +280,8 @@ private:
|
||||
auto well_idx = ws.index("WELL-A2");
|
||||
BOOST_REQUIRE(well_idx.has_value());
|
||||
auto& well = ws.well(well_idx.value());
|
||||
std::fill(well.surface_rates.begin(), well.surface_rates.end(), 0.0);
|
||||
std::fill(well.well_potentials.begin(), well.well_potentials.end(), 0.0);
|
||||
std::ranges::fill(well.surface_rates, 0.0);
|
||||
std::ranges::fill(well.well_potentials, 0.0);
|
||||
well.surface_rates[oil_phase_pos_] = wellA2RateSI();
|
||||
well.well_potentials[oil_phase_pos_] = -wellA2RateSI(); // positive
|
||||
well.production_cmode = well_a2_control_;
|
||||
@@ -292,8 +292,8 @@ private:
|
||||
auto well_idx = ws.index("WELL-B");
|
||||
BOOST_REQUIRE(well_idx.has_value());
|
||||
auto& well = ws.well(well_idx.value());
|
||||
std::fill(well.surface_rates.begin(), well.surface_rates.end(), 0.0);
|
||||
std::fill(well.well_potentials.begin(), well.well_potentials.end(), 0.0);
|
||||
std::ranges::fill(well.surface_rates, 0.0);
|
||||
std::ranges::fill(well.well_potentials, 0.0);
|
||||
well.surface_rates[oil_phase_pos_] = wellBRateSI();
|
||||
well.well_potentials[oil_phase_pos_] = -wellBRateSI(); // positive
|
||||
well.production_cmode = Opm::Well::ProducerCMode::GRUP;
|
||||
@@ -304,8 +304,8 @@ private:
|
||||
auto well_idx = ws.index("WELL-C");
|
||||
BOOST_REQUIRE(well_idx.has_value());
|
||||
auto& well = ws.well(well_idx.value());
|
||||
std::fill(well.surface_rates.begin(), well.surface_rates.end(), 0.0);
|
||||
std::fill(well.well_potentials.begin(), well.well_potentials.end(), 0.0);
|
||||
std::ranges::fill(well.surface_rates, 0.0);
|
||||
std::ranges::fill(well.well_potentials, 0.0);
|
||||
well.surface_rates[oil_phase_pos_] = wellCRateSI();
|
||||
well.well_potentials[oil_phase_pos_] = -wellCRateSI(); // positive
|
||||
well.production_cmode = Opm::Well::ProducerCMode::GRUP;
|
||||
|
||||
Reference in new issue
Block a user