Merge pull request #2086 from joakim-hove/group-is-field

Add method Group::is_field()
This commit is contained in:
Joakim Hove 2020-11-09 12:47:07 +01:00 committed by GitHub
commit 624ff50628
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View File

@ -231,6 +231,7 @@ struct ProductionControls {
bool defined(std::size_t timeStep) const;
std::size_t insert_index() const;
const std::string& name() const;
bool is_field() const;
int getGroupNetVFPTable() const;
bool updateNetVFPTable(int vfp_arg);

View File

@ -134,6 +134,10 @@ const std::string& Group::name() const {
return this->m_name;
}
bool Group::is_field() const {
return (this->m_name == "FIELD");
}
const Group::GroupProductionProperties& Group::productionProperties() const {
return this->production_properties;
}

View File

@ -523,6 +523,9 @@ BOOST_AUTO_TEST_CASE(GCONINJE_GCONPROD) {
BOOST_CHECK(!g2.injectionGroupControlAvailable(Phase::WATER));
BOOST_CHECK( g1.injectionGroupControlAvailable(Phase::GAS));
BOOST_CHECK( g2.injectionGroupControlAvailable(Phase::GAS));
BOOST_CHECK(f.is_field());
BOOST_CHECK(!g1.is_field());
}
{
const auto& g1 = schedule.getGroup("G1", 1);