Remove enum WellQueryMode

This commit is contained in:
Joakim Hove 2019-09-01 07:57:48 +02:00
parent 3c22559849
commit 7021669758
5 changed files with 10 additions and 16 deletions

View File

@ -176,7 +176,7 @@ namespace Opm
std::vector<Well2> getWells2atEnd() const;
std::vector<const Group2*> getChildGroups2(const std::string& group_name, size_t timeStep) const;
std::vector<Well2> getChildWells2(const std::string& group_name, size_t timeStep, GroupWellQueryMode query_mode) const;
std::vector<Well2> getChildWells2(const std::string& group_name, size_t timeStep) const;
const OilVaporizationProperties& getOilVaporizationProperties(size_t timestep) const;
const UDQActive& udqActive(size_t timeStep) const;

View File

@ -162,12 +162,6 @@ namespace Opm {
}
enum class GroupWellQueryMode {
Immediate,
Recursive
};
}
#endif

View File

@ -1098,7 +1098,7 @@ inline std::vector<Well2> find_wells( const Schedule& schedule,
if( type == ECL_SMSPEC_GROUP_VAR ) {
if( !schedule.hasGroup( name ) ) return {};
return schedule.getChildWells2( name, sim_step, GroupWellQueryMode::Recursive);
return schedule.getChildWells2( name, sim_step);
}
if( type == ECL_SMSPEC_FIELD_VAR )

View File

@ -2081,7 +2081,7 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
}
std::vector< Well2 > Schedule::getChildWells2(const std::string& group_name, size_t timeStep, GroupWellQueryMode query_mode) const {
std::vector< Well2 > Schedule::getChildWells2(const std::string& group_name, size_t timeStep) const {
if (!hasGroup(group_name))
throw std::invalid_argument("No such group: '" + group_name + "'");
{
@ -2090,9 +2090,9 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
if (group_ptr) {
std::vector<Well2> wells;
if (group_ptr->groups().size() && query_mode == GroupWellQueryMode::Recursive) {
if (group_ptr->groups().size()) {
for (const auto& child_name : group_ptr->groups()) {
const auto& child_wells = getChildWells2( child_name, timeStep, query_mode );
const auto& child_wells = getChildWells2( child_name, timeStep);
wells.insert( wells.end() , child_wells.begin() , child_wells.end());
}
} else {

View File

@ -399,9 +399,9 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWellsOrderedGRUPTREE) {
Runspec runspec (deck);
Schedule schedule(deck, grid , eclipseProperties, runspec);
BOOST_CHECK_THROW( schedule.getChildWells2( "NO_SUCH_GROUP" , 1 , GroupWellQueryMode::Recursive), std::invalid_argument);
BOOST_CHECK_THROW( schedule.getChildWells2( "NO_SUCH_GROUP" , 1 ), std::invalid_argument);
{
auto field_wells = schedule.getChildWells2("FIELD" , 0, GroupWellQueryMode::Recursive);
auto field_wells = schedule.getChildWells2("FIELD" , 0);
BOOST_CHECK_EQUAL( field_wells.size() , 4U);
BOOST_CHECK( has_well( field_wells, "DW_0" ));
@ -411,7 +411,7 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWellsOrderedGRUPTREE) {
}
{
auto platform_wells = schedule.getChildWells2("PLATFORM" , 0, GroupWellQueryMode::Recursive);
auto platform_wells = schedule.getChildWells2("PLATFORM" , 0);
BOOST_CHECK_EQUAL( platform_wells.size() , 4U);
BOOST_CHECK( has_well( platform_wells, "DW_0" ));
@ -421,7 +421,7 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWellsOrderedGRUPTREE) {
}
{
auto child_wells1 = schedule.getChildWells2("CG1" , 0, GroupWellQueryMode::Recursive);
auto child_wells1 = schedule.getChildWells2("CG1" , 0);
BOOST_CHECK_EQUAL( child_wells1.size() , 2U);
BOOST_CHECK( has_well( child_wells1, "DW_0" ));
@ -429,7 +429,7 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWellsOrderedGRUPTREE) {
}
{
auto parent_wells2 = schedule.getChildWells2("PG2" , 0, GroupWellQueryMode::Recursive);
auto parent_wells2 = schedule.getChildWells2("PG2" , 0);
BOOST_CHECK_EQUAL( parent_wells2.size() , 2U);
BOOST_CHECK( has_well( parent_wells2, "BW_2" ));