Use an unordered_set of string to identify defunct wells.

We do not rely on the order of the set and hope that the lookup
might be faster as it prevents string comparisons.
This commit is contained in:
Markus Blatt 2016-09-12 12:03:39 +02:00
parent 21de431eb1
commit 82822160af
3 changed files with 8 additions and 7 deletions

View File

@ -341,7 +341,7 @@ namespace Opm
UgGridHelpers::dimensions(grid),
UgGridHelpers::cell2Faces(grid), UgGridHelpers::beginFaceCentroids(grid),
permeability, dummy_list_econ_limited, dummy_well_potentials,
std::set<std::string>());
std::unordered_set<std::string>());
}

View File

@ -20,6 +20,7 @@
#ifndef OPM_WELLSMANAGER_HEADER_INCLUDED
#define OPM_WELLSMANAGER_HEADER_INCLUDED
#include <unordered_set>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
@ -94,7 +95,7 @@ namespace Opm
const DynamicListEconLimited& list_econ_limited,
bool is_parallel_run=false,
const std::vector<double>& well_potentials={},
const std::set<std::string>& deactivated_wells = {});
const std::unordered_set<std::string>& deactivated_wells = {});
WellsManager(const Opm::EclipseStateConstPtr eclipseState,
const size_t timeStep,
@ -164,7 +165,7 @@ namespace Opm
const double* permeability,
const DynamicListEconLimited& list_econ_limited,
const std::vector<double>& well_potentials,
const std::set<std::string>& deactivated_wells);
const std::unordered_set<std::string>& deactivated_wells);
// Disable copying and assignment.
WellsManager(const WellsManager& other);
WellsManager& operator=(const WellsManager& other);
@ -189,7 +190,7 @@ namespace Opm
const double* permeability,
const NTG& ntg,
std::vector<int>& wells_on_proc,
const std::set<std::string>& deactivated_wells,
const std::unordered_set<std::string>& deactivated_wells,
const DynamicListEconLimited& list_econ_limited);
void addChildGroups(GroupTreeNodeConstPtr parentNode, std::shared_ptr< const Schedule > schedule, size_t timeStep, const PhaseUsage& phaseUsage);

View File

@ -121,7 +121,7 @@ void WellsManager::createWellsFromSpecs(std::vector<const Well*>& wells, size_t
const double* permeability,
const NTG& ntg,
std::vector<int>& wells_on_proc,
const std::set<std::string>& ignored_wells,
const std::unordered_set<std::string>& ignored_wells,
const DynamicListEconLimited& list_econ_limited)
{
if (dimensions != 3) {
@ -317,7 +317,7 @@ WellsManager(const Opm::EclipseStateConstPtr eclipseState,
const DynamicListEconLimited& list_econ_limited,
bool is_parallel_run,
const std::vector<double>& well_potentials,
const std::set<std::string>& deactivated_wells)
const std::unordered_set<std::string>& deactivated_wells)
: w_(0), is_parallel_run_(is_parallel_run)
{
init(eclipseState, timeStep, number_of_cells, global_cell,
@ -339,7 +339,7 @@ WellsManager::init(const Opm::EclipseStateConstPtr eclipseState,
const double* permeability,
const DynamicListEconLimited& list_econ_limited,
const std::vector<double>& well_potentials,
const std::set<std::string>& deactivated_wells)
const std::unordered_set<std::string>& deactivated_wells)
{
if (dimensions != 3) {
OPM_THROW(std::runtime_error,