void MULTREGTScanner::assertKeywordSupported( const DeckKeyword& deckKeyword, const std::string& defaultRegion) { for (auto iter = deckKeyword.begin(); iter != deckKeyword.end(); ++iter) { MULTREGTRecord record( *iter , defaultRegion); if (record.m_nncBehaviour == MULTREGT::NOAQUNNC) throw std::invalid_argument("Sorry - currently we do not support \'NOAQUNNC\' for MULTREGT."); if (!record.m_srcRegion.hasValue()) throw std::invalid_argument("Sorry - currently it is not supported with a defaulted source region value."); if (!record.m_targetRegion.hasValue()) throw std::invalid_argument("Sorry - currently it is not supported with a defaulted target region value."); if (record.m_srcRegion.getValue() == record.m_targetRegion.getValue()) throw std::invalid_argument("Sorry - multregt applied internally to a region is not yet supported"); } }
void MULTREGTScanner::addKeyword( const DeckKeyword& deckKeyword , const std::string& defaultRegion) { assertKeywordSupported( deckKeyword , defaultRegion ); for (auto iter = deckKeyword.begin(); iter != deckKeyword.end(); ++iter) { MULTREGTRecord record( *iter , defaultRegion ); /* The default value for the region item is to use the region item on the previous record, or alternatively 'MULTNUM' for the first record. */ if (!record.m_region.hasValue()) { if (m_records.size() > 0) { auto previousRecord = m_records.back(); record.m_region.setValue( previousRecord.m_region.getValue() ); } else record.m_region.setValue( "MULTNUM" ); } m_records.push_back( record ); } }
Equil::Equil( const DeckKeyword& keyword ) : records( keyword.begin(), keyword.end() ) {}