Get WellMatcher Object Directly From Schedule

There's no need for us to invoke the WellMatcher constructor when
the Schedule object already knows how to do that.
This commit is contained in:
Bård Skaflestad 2024-10-25 10:30:23 +02:00
parent bf5f0c864d
commit 7f4d787522

View File

@ -220,12 +220,12 @@ fetchWellPI(const int reportStep,
const Action::ActionX& action,
const std::vector<std::string>& matching_wells) const
{
auto wellpi_wells = action.wellpi_wells(WellMatcher(schedule_[reportStep].well_order(),
schedule_[reportStep].wlist_manager()),
matching_wells);
auto wellpi_wells = action.wellpi_wells
(this->schedule_.wellMatcher(reportStep), matching_wells);
if (wellpi_wells.empty())
if (wellpi_wells.empty()) {
return {};
}
const auto num_wells = schedule_[reportStep].well_order().size();
std::vector<Scalar> wellpi_vector(num_wells);