Merge remote-tracking branch 'upstream/master' into track-default
This commit is contained in:
commit
2d68ebe94c
@ -13,17 +13,26 @@
|
||||
void printDeckDiagnostics(Opm::DeckConstPtr deck, bool printAllKeywords) {
|
||||
int recognizedKeywords = 0;
|
||||
int unrecognizedKeywords = 0;
|
||||
|
||||
for (size_t i = 0; i < deck->size(); i++) {
|
||||
if (!deck->getKeyword(i)->isKnown()) {
|
||||
if (!deck->getKeyword(i)->isKnown())
|
||||
unrecognizedKeywords++;
|
||||
std::cout << "Warning, this looks like a keyword, but is not in the configuration: " << deck->getKeyword(i)->name() << std::endl;
|
||||
} else
|
||||
else
|
||||
recognizedKeywords++;
|
||||
|
||||
if (printAllKeywords) {
|
||||
std::cout << "Keyword (" << i << "): " << deck->getKeyword(i)->name() << " " << std::endl;
|
||||
}
|
||||
}
|
||||
{
|
||||
for (size_t iw = 0; iw < deck->numWarnings(); iw++) {
|
||||
const std::pair<std::string,std::pair<std::string,size_t> >& warning = deck->getWarning( iw );
|
||||
const std::pair<std::string,size_t>& location = warning.second;
|
||||
|
||||
std::cout << warning.first << " at " << location.first << ":" << location.second << std::endl;
|
||||
}
|
||||
}
|
||||
std::cout << "Total number of warnings: " << deck->numWarnings() << std::endl;
|
||||
std::cout << "Number of recognized keywords: " << recognizedKeywords << std::endl;
|
||||
std::cout << "Number of unrecognized keywords: " << unrecognizedKeywords << std::endl;
|
||||
std::cout << "Total number of keywords: " << deck->size() << std::endl;
|
||||
|
@ -59,6 +59,24 @@ namespace Opm {
|
||||
return m_keywords->size();
|
||||
}
|
||||
|
||||
size_t Deck::numWarnings() const {
|
||||
return m_warnings.size();
|
||||
}
|
||||
|
||||
void Deck::addWarning(const std::string& warningText , const std::string& filename , size_t lineNR) {
|
||||
std::pair<std::string,size_t> location(filename , lineNR);
|
||||
std::pair<std::string , std::pair<std::string,size_t> > warning(warningText , location);
|
||||
|
||||
m_warnings.push_back( warning );
|
||||
}
|
||||
|
||||
const std::pair<std::string , std::pair<std::string,size_t> >& Deck::getWarning( size_t index ) const {
|
||||
if (index < m_warnings.size())
|
||||
return m_warnings[index];
|
||||
else
|
||||
throw std::invalid_argument("Index out of range");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -40,8 +40,12 @@ namespace Opm {
|
||||
size_t numKeywords(const std::string& keyword);
|
||||
const std::vector<DeckKeywordConstPtr>& getKeywordList(const std::string& keyword);
|
||||
size_t size() const;
|
||||
size_t numWarnings() const;
|
||||
void addWarning(const std::string& warningText , const std::string& filename , size_t lineNR);
|
||||
const std::pair<std::string , std::pair<std::string,size_t> >& getWarning( size_t index ) const;
|
||||
private:
|
||||
KeywordContainerPtr m_keywords;
|
||||
std::vector<std::pair<std::string , std::pair<std::string,size_t> > > m_warnings; //<"Warning Text" , <"Filename" , LineNR>>
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<Deck> DeckPtr;
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckIntItem.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserRecord.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserStringItem.hpp>
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
using namespace Opm;
|
||||
@ -112,4 +114,14 @@ BOOST_AUTO_TEST_CASE(get_oneoftwo_returnscorrectitem) {
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(StringsWithSpaceOK) {
|
||||
ParserStringItemPtr itemString(new ParserStringItem(std::string("STRINGITEM1")));
|
||||
ParserRecordPtr record1(new ParserRecord());
|
||||
RawRecordPtr rawRecord(new Opm::RawRecord(" ' VALUE ' /"));
|
||||
record1->addItem( itemString );
|
||||
|
||||
|
||||
DeckRecordConstPtr deckRecord = record1->parse( rawRecord );
|
||||
BOOST_CHECK_EQUAL(" VALUE " , deckRecord->getItem(0)->getString(0));
|
||||
}
|
||||
|
||||
|
@ -118,3 +118,27 @@ BOOST_AUTO_TEST_CASE(size_twokeyword_return2) {
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(DECKWARNING_EMPTYOK) {
|
||||
Deck deck;
|
||||
BOOST_CHECK_EQUAL(0U, deck.numWarnings());
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(DECKAddWarning) {
|
||||
Deck deck;
|
||||
deck.addWarning("WARNING" , "FILE" , 100U);
|
||||
BOOST_CHECK_EQUAL(1U, deck.numWarnings());
|
||||
|
||||
deck.addWarning("WARNING2" , "FILE2" , 200U);
|
||||
BOOST_CHECK_EQUAL(2U, deck.numWarnings());
|
||||
|
||||
const std::pair<std::string,std::pair<std::string,size_t> >& warning = deck.getWarning( 0 );
|
||||
const std::pair<std::string,size_t>& location = warning.second;
|
||||
|
||||
BOOST_CHECK_EQUAL( warning.first , "WARNING" );
|
||||
BOOST_CHECK_EQUAL( location.first , "FILE" );
|
||||
BOOST_CHECK_EQUAL( location.second , 100U );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,14 +12,19 @@ add_test(NAME runParseWCONHIST WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} COMMA
|
||||
|
||||
add_executable(runParsePORO ParsePORO.cpp)
|
||||
target_link_libraries(runParsePORO Parser ${Boost_LIBRARIES})
|
||||
add_test(NAME runParsePORO WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} COMMAND runParsePORO)
|
||||
add_test(NAME runParsePORO WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} COMMAND runParsePORO)
|
||||
|
||||
add_executable(runParseACTION ParseACTION.cpp)
|
||||
target_link_libraries(runParseACTION Parser ${Boost_LIBRARIES})
|
||||
add_test(NAME runParseACTION WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} COMMAND runParseACTION)
|
||||
|
||||
add_executable(runIncludeTest IncludeTest.cpp)
|
||||
target_link_libraries(runIncludeTest Parser ${Boost_LIBRARIES})
|
||||
add_test(NAME runIncludeTest WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} COMMAND runIncludeTest)
|
||||
|
||||
|
||||
|
||||
|
||||
add_executable(runParseEQUIL ParseEQUIL.cpp)
|
||||
target_link_libraries(runParseEQUIL Parser ${Boost_LIBRARIES})
|
||||
add_test(NAME runParseEQUIL
|
||||
|
@ -106,7 +106,6 @@ createDeckWithInclude(path& datafile)
|
||||
BOOST_AUTO_TEST_CASE(parse_fileWithWWCTKeyword_deckReturned) {
|
||||
path datafile;
|
||||
ParserPtr parser(new Parser());
|
||||
parser->loadKeywordsFromDirectory(KEYWORD_DIRECTORY);
|
||||
createDeckWithInclude (datafile);
|
||||
DeckConstPtr deck = parser->parse(datafile.string());
|
||||
|
||||
|
@ -172,7 +172,6 @@ BOOST_AUTO_TEST_CASE(parse_unknownkeywordWithstrictparsing_exceptionthrown) {
|
||||
// Datafile contains 3 RADFIN4 keywords. One fully specified, one with 2 out of 11 items, and one with no items.
|
||||
BOOST_AUTO_TEST_CASE(parse_truncatedrecords_deckFilledWithDefaults) {
|
||||
ParserPtr parser(new Parser());
|
||||
parser->loadKeywordsFromDirectory(KEYWORD_DIRECTORY);
|
||||
DeckPtr deck = parser->parse("testdata/integration_tests/truncated_records.data");
|
||||
BOOST_CHECK_EQUAL(4U, deck->size());
|
||||
DeckKeywordConstPtr radfin4_0_full= deck->getKeyword("RADFIN4", 0);
|
||||
|
93
opm/parser/eclipse/IntegrationTests/ParseACTION.cpp
Normal file
93
opm/parser/eclipse/IntegrationTests/ParseACTION.cpp
Normal file
@ -0,0 +1,93 @@
|
||||
/*
|
||||
Copyright 2013 Statoil ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define BOOST_TEST_MODULE ParserIntegrationTests
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserRecord.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserIntItem.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserStringItem.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/Parser/ParserEnums.hpp>
|
||||
|
||||
using namespace Opm;
|
||||
|
||||
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE( parse_ACTION_OK ) {
|
||||
ParserPtr parser(new Parser( false ));
|
||||
boost::filesystem::path actionFile("testdata/integration_tests/ACTION/ACTION.txt");
|
||||
boost::filesystem::path actionFile2("testdata/integration_tests/ACTION/ACTION_EXCEPTION.txt");
|
||||
ParserKeywordConstPtr DIMENS( new ParserKeyword("DIMENS" , (size_t) 1 , IGNORE_WARNING ));
|
||||
ParserKeywordConstPtr THROW( new ParserKeyword("THROW" , THROW_EXCEPTION ));
|
||||
|
||||
BOOST_REQUIRE( parser->loadKeywordFromFile( boost::filesystem::path( std::string(KEYWORD_DIRECTORY) + std::string("/W/WCONHIST") )) );
|
||||
parser->addKeyword( DIMENS );
|
||||
parser->addKeyword( THROW );
|
||||
|
||||
BOOST_REQUIRE( parser->hasKeyword( "DIMENS" ));
|
||||
BOOST_REQUIRE( parser->hasKeyword( "WCONHIST" ));
|
||||
BOOST_REQUIRE( parser->hasKeyword( "THROW" ));
|
||||
|
||||
BOOST_REQUIRE_THROW( parser->parse( actionFile2.string() , false) , std::invalid_argument );
|
||||
|
||||
|
||||
DeckPtr deck = parser->parse(actionFile.string() , false);
|
||||
DeckKeywordConstPtr kw1 = deck->getKeyword("WCONHIST" , 0);
|
||||
BOOST_CHECK_EQUAL( 3U , kw1->size() );
|
||||
|
||||
|
||||
DeckRecordConstPtr rec1 = kw1->getRecord(0);
|
||||
BOOST_CHECK_EQUAL( 11U , rec1->size() );
|
||||
|
||||
DeckRecordConstPtr rec3 = kw1->getRecord(2);
|
||||
BOOST_CHECK_EQUAL( 11U , rec3->size() );
|
||||
|
||||
DeckItemConstPtr item1 = rec1->getItem("WellName");
|
||||
DeckItemConstPtr item1_index = rec1->getItem(0);
|
||||
|
||||
BOOST_CHECK_EQUAL( item1 , item1_index );
|
||||
BOOST_CHECK_EQUAL( "OP_1" , item1->getString(0));
|
||||
|
||||
|
||||
item1 = rec3->getItem("WellName");
|
||||
BOOST_CHECK_EQUAL( "OP_3" , item1->getString(0));
|
||||
|
||||
|
||||
BOOST_CHECK_EQUAL( false , deck->hasKeyword( "DIMENS" ));
|
||||
BOOST_CHECK_EQUAL( 2U , deck->numWarnings() );
|
||||
{
|
||||
const std::pair<std::string,std::pair<std::string,size_t> >& warning = deck->getWarning( 0 );
|
||||
const std::pair<std::string,size_t>& location = warning.second;
|
||||
BOOST_CHECK_EQUAL( actionFile.string() , location.first);
|
||||
BOOST_CHECK_EQUAL( 2U , location.second);
|
||||
}
|
||||
{
|
||||
const std::pair<std::string,std::pair<std::string,size_t> >& warning = deck->getWarning( 1 );
|
||||
const std::pair<std::string,size_t>& location = warning.second;
|
||||
BOOST_CHECK_EQUAL( actionFile.string() , location.first);
|
||||
BOOST_CHECK_EQUAL( 6U , location.second);
|
||||
}
|
||||
|
||||
}
|
@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE( parse_PVTG_OK ) {
|
||||
ParserPtr parser2(new Parser());
|
||||
ParserPtr parser(new Parser(false));
|
||||
ParserKeywordPtr tabdimsKeyword( new ParserKeyword("TABDIMS" , 1));
|
||||
ParserKeywordPtr pvtgKeyword( new ParserKeyword("PVTG" , "TABDIMS" , "NTPVT" , true));
|
||||
ParserKeywordPtr pvtgKeyword( new ParserKeyword("PVTG" , "TABDIMS" , "NTPVT" , INTERNALIZE , true));
|
||||
{
|
||||
ParserIntItemConstPtr item(new ParserIntItem(std::string("NTSFUN")));
|
||||
tabdimsKeyword->addItem(item);
|
||||
|
@ -37,7 +37,6 @@ using namespace Opm;
|
||||
|
||||
BOOST_AUTO_TEST_CASE( parse_WCHONHIST_OK ) {
|
||||
ParserPtr parser(new Parser());
|
||||
parser->loadKeywordsFromDirectory(KEYWORD_DIRECTORY);
|
||||
boost::filesystem::path wconhistFile("testdata/integration_tests/WCONHIST/WCONHIST1");
|
||||
DeckPtr deck = parser->parse(wconhistFile.string());
|
||||
DeckKeywordConstPtr kw1 = deck->getKeyword("WCONHIST" , 0);
|
||||
|
@ -72,6 +72,13 @@ namespace Opm {
|
||||
return m_parserKeywords.find(keyword) != m_parserKeywords.end();
|
||||
}
|
||||
|
||||
bool Parser::dropKeyword(const std::string& keyword) {
|
||||
if (m_parserKeywords.erase( keyword ) == 1)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
ParserKeywordConstPtr Parser::getKeyword(const std::string& keyword) const {
|
||||
if (hasKeyword(keyword)) {
|
||||
return m_parserKeywords.at(keyword);
|
||||
@ -85,12 +92,13 @@ namespace Opm {
|
||||
void Parser::parseFile(DeckPtr deck, const boost::filesystem::path& file, const boost::filesystem::path& rootPath, bool parseStrict) const {
|
||||
bool verbose = false;
|
||||
std::ifstream inputstream;
|
||||
size_t lineNR = 0;
|
||||
inputstream.open(file.string().c_str());
|
||||
|
||||
if (inputstream) {
|
||||
RawKeywordPtr rawKeyword;
|
||||
|
||||
while (tryParseKeyword(deck, inputstream, rawKeyword, parseStrict)) {
|
||||
|
||||
while (tryParseKeyword(deck, file.string() , lineNR , inputstream, rawKeyword, parseStrict)) {
|
||||
if (rawKeyword->getKeywordName() == Opm::RawConsts::include) {
|
||||
RawRecordConstPtr firstRecord = rawKeyword->getRecord(0);
|
||||
std::string includeFileString = firstRecord->getItem(0);
|
||||
@ -109,11 +117,16 @@ namespace Opm {
|
||||
|
||||
if (hasKeyword(rawKeyword->getKeywordName())) {
|
||||
ParserKeywordConstPtr parserKeyword = m_parserKeywords.at(rawKeyword->getKeywordName());
|
||||
DeckKeywordConstPtr deckKeyword = parserKeyword->parse(rawKeyword);
|
||||
deck->addKeyword(deckKeyword);
|
||||
ParserKeywordActionEnum action = parserKeyword->getAction();
|
||||
if (action == INTERNALIZE) {
|
||||
DeckKeywordConstPtr deckKeyword = parserKeyword->parse(rawKeyword);
|
||||
deck->addKeyword(deckKeyword);
|
||||
} else if (action == IGNORE_WARNING)
|
||||
deck->addWarning( "The keyword " + rawKeyword->getKeywordName() + " is ignored - this might potentially affect the results" , file.string() , rawKeyword->getLineNR());
|
||||
} else {
|
||||
DeckKeywordPtr deckKeyword(new DeckKeyword(rawKeyword->getKeywordName(), false));
|
||||
DeckKeywordConstPtr deckKeyword(new DeckKeyword(rawKeyword->getKeywordName(), false));
|
||||
deck->addKeyword(deckKeyword);
|
||||
deck->addWarning( "The keyword " + rawKeyword->getKeywordName() + " is not recognized" , file.string() , lineNR);
|
||||
}
|
||||
}
|
||||
rawKeyword.reset();
|
||||
@ -137,11 +150,16 @@ namespace Opm {
|
||||
throw std::invalid_argument("Input JSON object is not an array");
|
||||
}
|
||||
|
||||
RawKeywordPtr Parser::createRawKeyword(const DeckConstPtr deck, const std::string& keywordString, bool strictParsing) const {
|
||||
RawKeywordPtr Parser::createRawKeyword(const DeckConstPtr deck, const std::string& filename , size_t lineNR , const std::string& keywordString, bool strictParsing) const {
|
||||
if (hasKeyword(keywordString)) {
|
||||
ParserKeywordConstPtr parserKeyword = m_parserKeywords.find(keywordString)->second;
|
||||
ParserKeywordActionEnum action = parserKeyword->getAction();
|
||||
|
||||
if (action == THROW_EXCEPTION)
|
||||
throw std::invalid_argument("Parsing terminated by fatal keyword: " + keywordString);
|
||||
|
||||
if (parserKeyword->getSizeType() == SLASH_TERMINATED)
|
||||
return RawKeywordPtr(new RawKeyword(keywordString));
|
||||
return RawKeywordPtr(new RawKeyword(keywordString , filename , lineNR));
|
||||
else {
|
||||
size_t targetSize;
|
||||
|
||||
@ -157,26 +175,28 @@ namespace Opm {
|
||||
}
|
||||
targetSize = sizeDefinitionItem->getInt(0);
|
||||
}
|
||||
return RawKeywordPtr(new RawKeyword(keywordString, targetSize , parserKeyword->isTableCollection()));
|
||||
return RawKeywordPtr(new RawKeyword(keywordString, filename , lineNR , targetSize , parserKeyword->isTableCollection()));
|
||||
}
|
||||
} else {
|
||||
if (strictParsing) {
|
||||
throw std::invalid_argument("Keyword " + keywordString + " not recognized ");
|
||||
} else {
|
||||
return RawKeywordPtr(new RawKeyword(keywordString, 0));
|
||||
return RawKeywordPtr(new RawKeyword(keywordString, filename , lineNR , 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Parser::tryParseKeyword(const DeckConstPtr deck, std::ifstream& inputstream, RawKeywordPtr& rawKeyword, bool strictParsing) const {
|
||||
std::string line;
|
||||
|
||||
bool Parser::tryParseKeyword(const DeckConstPtr deck, const std::string& filename , size_t& lineNR , std::ifstream& inputstream, RawKeywordPtr& rawKeyword, bool strictParsing) const {
|
||||
std::string line;
|
||||
|
||||
while (std::getline(inputstream, line)) {
|
||||
std::string keywordString;
|
||||
|
||||
lineNR++;
|
||||
|
||||
if (rawKeyword == NULL) {
|
||||
if (RawKeyword::tryParseKeyword(line, keywordString)) {
|
||||
rawKeyword = createRawKeyword(deck, keywordString, strictParsing);
|
||||
rawKeyword = createRawKeyword(deck, filename , lineNR , keywordString, strictParsing);
|
||||
}
|
||||
} else {
|
||||
if (RawKeyword::useLine(line)) {
|
||||
|
@ -47,6 +47,7 @@ namespace Opm {
|
||||
/// Method to add ParserKeyword instances, these holding type and size information about the keywords and their data.
|
||||
void addKeyword(ParserKeywordConstPtr parserKeyword);
|
||||
bool hasKeyword(const std::string& keyword) const;
|
||||
bool dropKeyword(const std::string& keyword);
|
||||
ParserKeywordConstPtr getKeyword(const std::string& keyword) const;
|
||||
|
||||
void loadKeywords(const Json::JsonObject& jsonKeywords);
|
||||
@ -56,9 +57,9 @@ namespace Opm {
|
||||
size_t size() const;
|
||||
private:
|
||||
std::map<std::string, ParserKeywordConstPtr> m_parserKeywords;
|
||||
bool tryParseKeyword(const DeckConstPtr deck , std::ifstream& inputstream , RawKeywordPtr& rawKeyword, bool strictParsing) const;
|
||||
bool tryParseKeyword(const DeckConstPtr deck , const std::string& filename , size_t& lineNR , std::ifstream& inputstream , RawKeywordPtr& rawKeyword, bool strictParsing) const;
|
||||
void parseFile(DeckPtr deck , const boost::filesystem::path& file, const boost::filesystem::path& rootPath, bool strictParsing) const;
|
||||
RawKeywordPtr createRawKeyword(const DeckConstPtr deck , const std::string& keywordString, bool strictParsing) const;
|
||||
RawKeywordPtr createRawKeyword(const DeckConstPtr deck , const std::string& filename , size_t lineNR , const std::string& keywordString, bool strictParsing) const;
|
||||
void addDefaultKeywords();
|
||||
};
|
||||
|
||||
|
@ -103,4 +103,41 @@ namespace Opm {
|
||||
else
|
||||
throw std::invalid_argument("String: " + stringValue + " can not be converted to enum value");
|
||||
}
|
||||
|
||||
/*****************************************************************/
|
||||
|
||||
const std::string ParserKeywordActionEnum2String(ParserKeywordActionEnum enumValue) {
|
||||
switch (enumValue) {
|
||||
case INTERNALIZE:
|
||||
return "INTERNALIZE";
|
||||
break;
|
||||
case IGNORE:
|
||||
return "IGNORE";
|
||||
break;
|
||||
case THROW_EXCEPTION:
|
||||
return "THROW_EXCEPTION";
|
||||
break;
|
||||
case IGNORE_WARNING:
|
||||
return "IGNORE_WARNING";
|
||||
break;
|
||||
default:
|
||||
throw std::invalid_argument("Implementation error - should NOT be here");
|
||||
}
|
||||
}
|
||||
|
||||
ParserKeywordActionEnum ParserKeywordActionEnumFromString(const std::string& stringValue) {
|
||||
if (stringValue == "INTERNALIZE")
|
||||
return INTERNALIZE;
|
||||
else if (stringValue == "IGNORE")
|
||||
return IGNORE;
|
||||
else if (stringValue == "THROW_EXCEPTION")
|
||||
return THROW_EXCEPTION;
|
||||
else if (stringValue == "IGNORE_WARNING")
|
||||
return IGNORE_WARNING;
|
||||
else
|
||||
throw std::invalid_argument("String: " + stringValue + " can not be converted to enum value");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -47,6 +47,14 @@ namespace Opm {
|
||||
};
|
||||
|
||||
|
||||
enum ParserKeywordActionEnum {
|
||||
INTERNALIZE = 0,
|
||||
IGNORE = 1,
|
||||
IGNORE_WARNING = 2,
|
||||
THROW_EXCEPTION = 3
|
||||
};
|
||||
|
||||
const std::string ParserKeywordActionEnum2String(ParserKeywordActionEnum enumValue);
|
||||
const std::string ParserItemSizeEnum2String(ParserItemSizeEnum enumValue);
|
||||
const std::string ParserKeywordSizeEnum2String(ParserKeywordSizeEnum enumValue);
|
||||
const std::string ParserValueTypeEnum2String(ParserValueTypeEnum enumValue);
|
||||
@ -54,6 +62,7 @@ namespace Opm {
|
||||
ParserItemSizeEnum ParserItemSizeEnumFromString(const std::string& stringValue);
|
||||
ParserKeywordSizeEnum ParserKeywordSizeEnumFromString(const std::string& stringValue);
|
||||
ParserValueTypeEnum ParserValueTypeEnumFromString(const std::string& stringValue);
|
||||
ParserKeywordActionEnum ParserKeywordActionEnumFromString(const std::string& stringValue);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
|
||||
ParserIntItem::ParserIntItem(const std::string& itemName) : ParserItem(itemName) {
|
||||
m_default = defaultInt();
|
||||
}
|
||||
|
@ -25,6 +25,10 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
template<> void ParserItem::fillVectorFromStringStream<std::string>(std::istringstream& inputStream , std::string& token , std::deque<std::string>& dataVector) const {
|
||||
dataVector.push_back(token);
|
||||
}
|
||||
|
||||
ParserItem::ParserItem(const std::string& itemName, ParserItemSizeEnum sizeType) {
|
||||
m_name.assign(itemName);
|
||||
m_sizeType = sizeType;
|
||||
|
@ -17,14 +17,39 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
Pushing the converted values onto the dataVector is in this seperate
|
||||
function to be able to specialize the implementation for type
|
||||
std::string. The problem is that in the code:
|
||||
|
||||
std::istringstream inputStream(" WITH_SPACE ");
|
||||
inputStream >> stringValue;
|
||||
|
||||
The leading and trailing spaces will be stripped from the final
|
||||
stringValue (have tried manipulating the skipws flag to no
|
||||
avail). To avoid this a specialized
|
||||
fillVectorFromStringStream<std::string> implementation is in
|
||||
ParserItem.cpp.
|
||||
*/
|
||||
|
||||
template<class T> void fillVectorFromStringStream(std::istringstream& inputStream , std::string& token , std::deque<T>& dataVector) const {
|
||||
T value;
|
||||
inputStream >> value;
|
||||
dataVector.push_back(value);
|
||||
|
||||
inputStream.get();
|
||||
if (!inputStream.eof())
|
||||
throw std::invalid_argument("Spurious data at the end of: <" + token + ">");
|
||||
}
|
||||
|
||||
|
||||
template<class T> void fillVectorFromStringToken(std::string token, std::deque<T>& dataVector, T defaultValue, bool& defaultActive) const {
|
||||
std::istringstream inputStream(token);
|
||||
size_t starPos = token.find('*');
|
||||
T value;
|
||||
bool hasStar = (starPos != std::string::npos);
|
||||
|
||||
defaultActive = false;
|
||||
|
||||
if (hasStar) {
|
||||
bool singleDefault = (starPos == 0);
|
||||
|
||||
@ -37,6 +62,7 @@ template<class T> void fillVectorFromStringToken(std::string token, std::deque<T
|
||||
} else {
|
||||
size_t multiplier;
|
||||
int starChar;
|
||||
T value;
|
||||
|
||||
inputStream >> multiplier;
|
||||
starChar = inputStream.get();
|
||||
@ -49,20 +75,16 @@ template<class T> void fillVectorFromStringToken(std::string token, std::deque<T
|
||||
value = defaultValue;
|
||||
else
|
||||
inputStream >> value;
|
||||
|
||||
|
||||
for (size_t i = 0; i < multiplier; i++)
|
||||
dataVector.push_back(value);
|
||||
}
|
||||
} else {
|
||||
inputStream >> value;
|
||||
dataVector.push_back(value);
|
||||
}
|
||||
|
||||
inputStream.get();
|
||||
if (!inputStream.eof())
|
||||
throw std::invalid_argument("Spurious data at the end of: <" + token + ">");
|
||||
} else
|
||||
fillVectorFromStringStream(inputStream , token , dataVector);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<class T> std::deque<T> readFromRawRecord(RawRecordPtr rawRecord, bool scanAll, T defaultValue, bool& defaultActive) const {
|
||||
std::deque<T> data;
|
||||
if (rawRecord->size() == 0) {
|
||||
|
@ -33,28 +33,44 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
|
||||
ParserKeyword::ParserKeyword(const std::string& name) {
|
||||
commonInit(name);
|
||||
void ParserKeyword::commonInit(const std::string& name , ParserKeywordActionEnum action) {
|
||||
if (!validName(name))
|
||||
throw std::invalid_argument("Invalid name: " + name + "keyword must be all upper case, max 8 characters. Starting with character.");
|
||||
|
||||
m_keywordSizeType = SLASH_TERMINATED;
|
||||
m_isDataKeyword = false;
|
||||
m_isTableCollection = false;
|
||||
m_name = name;
|
||||
m_action = action;
|
||||
m_record = ParserRecordPtr(new ParserRecord);
|
||||
}
|
||||
|
||||
|
||||
ParserKeyword::ParserKeyword(const char * name) {
|
||||
commonInit(name);
|
||||
ParserKeyword::ParserKeyword(const std::string& name, ParserKeywordActionEnum action) {
|
||||
commonInit(name , action);
|
||||
m_action = action;
|
||||
}
|
||||
|
||||
|
||||
ParserKeyword::ParserKeyword(const std::string& name , const std::string& sizeKeyword , const std::string& sizeItem, bool isTableCollection) {
|
||||
commonInit(name);
|
||||
ParserKeyword::ParserKeyword(const char * name , ParserKeywordActionEnum action) {
|
||||
commonInit(name , action);
|
||||
m_action = action;
|
||||
}
|
||||
|
||||
|
||||
ParserKeyword::ParserKeyword(const std::string& name, size_t fixedKeywordSize , ParserKeywordActionEnum action) {
|
||||
commonInit(name,action);
|
||||
m_keywordSizeType = FIXED;
|
||||
m_fixedSize = fixedKeywordSize;
|
||||
}
|
||||
|
||||
|
||||
ParserKeyword::ParserKeyword(const std::string& name , const std::string& sizeKeyword , const std::string& sizeItem , ParserKeywordActionEnum action , bool isTableCollection) {
|
||||
commonInit(name,action);
|
||||
m_isTableCollection = isTableCollection;
|
||||
initSizeKeyword(sizeKeyword , sizeItem);
|
||||
}
|
||||
|
||||
ParserKeyword::ParserKeyword(const std::string& name, size_t fixedKeywordSize) {
|
||||
commonInit(name);
|
||||
m_keywordSizeType = FIXED;
|
||||
m_fixedSize = fixedKeywordSize;
|
||||
}
|
||||
|
||||
|
||||
bool ParserKeyword::isTableCollection() const {
|
||||
@ -98,8 +114,13 @@ namespace Opm {
|
||||
|
||||
|
||||
ParserKeyword::ParserKeyword(const Json::JsonObject& jsonConfig) {
|
||||
ParserKeywordActionEnum action = INTERNALIZE;
|
||||
|
||||
if (jsonConfig.has_item("action"))
|
||||
action = ParserKeywordActionEnumFromString( jsonConfig.get_string("action") );
|
||||
|
||||
if (jsonConfig.has_item("name")) {
|
||||
commonInit(jsonConfig.get_string("name"));
|
||||
commonInit(jsonConfig.get_string("name") , action);
|
||||
} else
|
||||
throw std::invalid_argument("Json object is missing name: property");
|
||||
|
||||
@ -114,7 +135,7 @@ namespace Opm {
|
||||
if (isTableCollection())
|
||||
addTableItems();
|
||||
|
||||
if (m_fixedSize == 0 && m_keywordSizeType == FIXED)
|
||||
if ((m_fixedSize == 0 && m_keywordSizeType == FIXED) || (m_action != INTERNALIZE))
|
||||
return;
|
||||
else {
|
||||
if (numItems() == 0)
|
||||
@ -155,17 +176,6 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
void ParserKeyword::commonInit(const std::string& name) {
|
||||
if (!validName(name))
|
||||
throw std::invalid_argument("Invalid name: " + name + "keyword must be all upper case, max 8 characters. Starting with character.");
|
||||
|
||||
m_keywordSizeType = SLASH_TERMINATED;
|
||||
m_isDataKeyword = false;
|
||||
m_isTableCollection = false;
|
||||
m_name = name;
|
||||
m_record = ParserRecordPtr(new ParserRecord);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -287,6 +297,11 @@ namespace Opm {
|
||||
return m_record;
|
||||
}
|
||||
|
||||
|
||||
ParserKeywordActionEnum ParserKeyword::getAction() const {
|
||||
return m_action;
|
||||
}
|
||||
|
||||
|
||||
const std::string& ParserKeyword::getName() const {
|
||||
return m_name;
|
||||
@ -335,7 +350,8 @@ namespace Opm {
|
||||
(m_record->equal( *(other.m_record) )) &&
|
||||
(m_keywordSizeType == other.m_keywordSizeType) &&
|
||||
(m_isDataKeyword == other.m_isDataKeyword) &&
|
||||
(m_isTableCollection == other.m_isTableCollection))
|
||||
(m_isTableCollection == other.m_isTableCollection) &&
|
||||
(m_action == other.m_action))
|
||||
{
|
||||
bool equal = false;
|
||||
switch(m_keywordSizeType) {
|
||||
@ -360,39 +376,41 @@ namespace Opm {
|
||||
|
||||
|
||||
void ParserKeyword::inlineNew(std::ostream& os , const std::string& lhs, const std::string& indent) const {
|
||||
switch(m_keywordSizeType) {
|
||||
case SLASH_TERMINATED:
|
||||
os << lhs << " = new ParserKeyword(\"" << m_name << "\");" << std::endl;
|
||||
break;
|
||||
case FIXED:
|
||||
os << lhs << " = new ParserKeyword(\"" << m_name << "\",(size_t)" << m_fixedSize << ");" << std::endl;
|
||||
break;
|
||||
case OTHER:
|
||||
if (isTableCollection())
|
||||
os << lhs << " = new ParserKeyword(\"" << m_name << "\",\"" << m_sizeDefinitionPair.first << "\",\"" << m_sizeDefinitionPair.second << "\" , true);" << std::endl;
|
||||
else
|
||||
os << lhs << " = new ParserKeyword(\"" << m_name << "\",\"" << m_sizeDefinitionPair.first << "\",\"" << m_sizeDefinitionPair.second << "\");" << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_record->size(); i++) {
|
||||
os << indent << "{" << std::endl;
|
||||
{
|
||||
const std::string local_indent = indent + " ";
|
||||
ParserItemConstPtr item = m_record->get(i);
|
||||
os << local_indent << "ParserItemConstPtr item(";
|
||||
item->inlineNew(os);
|
||||
os << ");" << std::endl;
|
||||
{
|
||||
std::string addItemMethod = "addItem";
|
||||
if (m_isDataKeyword)
|
||||
addItemMethod = "addDataItem";
|
||||
|
||||
os << local_indent << lhs << "->" << addItemMethod << "(item);" << std::endl;
|
||||
}
|
||||
}
|
||||
os << indent << "}" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
const std::string actionString(ParserKeywordActionEnum2String( m_action ));
|
||||
switch(m_keywordSizeType) {
|
||||
case SLASH_TERMINATED:
|
||||
os << lhs << " = new ParserKeyword(\"" << m_name << "\"," << actionString << ");" << std::endl;
|
||||
break;
|
||||
case FIXED:
|
||||
os << lhs << " = new ParserKeyword(\"" << m_name << "\",(size_t)" << m_fixedSize << "," << actionString << ");" << std::endl;
|
||||
break;
|
||||
case OTHER:
|
||||
if (isTableCollection())
|
||||
os << lhs << " = new ParserKeyword(\"" << m_name << "\",\"" << m_sizeDefinitionPair.first << "\",\"" << m_sizeDefinitionPair.second << "\"," << actionString << ", true);" << std::endl;
|
||||
else
|
||||
os << lhs << " = new ParserKeyword(\"" << m_name << "\",\"" << m_sizeDefinitionPair.first << "\",\"" << m_sizeDefinitionPair.second << "\"," << actionString << ");" << std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_record->size(); i++) {
|
||||
os << indent << "{" << std::endl;
|
||||
{
|
||||
const std::string local_indent = indent + " ";
|
||||
ParserItemConstPtr item = m_record->get(i);
|
||||
os << local_indent << "ParserItemConstPtr item(";
|
||||
item->inlineNew(os);
|
||||
os << ");" << std::endl;
|
||||
{
|
||||
std::string addItemMethod = "addItem";
|
||||
if (m_isDataKeyword)
|
||||
addItemMethod = "addDataItem";
|
||||
|
||||
os << local_indent << lhs << "->" << addItemMethod << "(item);" << std::endl;
|
||||
}
|
||||
}
|
||||
os << indent << "}" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <opm/json/JsonObject.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/Parser/ParserRecord.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserEnums.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
#include <opm/parser/eclipse/RawDeck/RawKeyword.hpp>
|
||||
|
||||
@ -34,17 +35,17 @@ namespace Opm {
|
||||
|
||||
class ParserKeyword {
|
||||
public:
|
||||
ParserKeyword(const char * name);
|
||||
ParserKeyword(const std::string& name);
|
||||
ParserKeyword(const std::string& name, size_t fixedKeywordSize);
|
||||
ParserKeyword(const std::string& name , const std::string& sizeKeyword , const std::string& sizeItem, bool isTableCollection = false);
|
||||
ParserKeyword(const char * name , ParserKeywordActionEnum action = INTERNALIZE);
|
||||
ParserKeyword(const std::string& name , ParserKeywordActionEnum action = INTERNALIZE);
|
||||
ParserKeyword(const std::string& name, size_t fixedKeywordSize,ParserKeywordActionEnum action = INTERNALIZE);
|
||||
ParserKeyword(const std::string& name , const std::string& sizeKeyword , const std::string& sizeItem, ParserKeywordActionEnum action = INTERNALIZE , bool isTableCollection = false);
|
||||
ParserKeyword(const Json::JsonObject& jsonConfig);
|
||||
|
||||
static bool validName(const std::string& name);
|
||||
|
||||
ParserRecordPtr getRecord() const;
|
||||
const std::string& getName() const;
|
||||
|
||||
ParserKeywordActionEnum getAction() const;
|
||||
size_t getFixedSize() const;
|
||||
bool hasFixedSize() const;
|
||||
bool isTableCollection() const;
|
||||
@ -68,12 +69,13 @@ namespace Opm {
|
||||
size_t m_fixedSize;
|
||||
bool m_isDataKeyword;
|
||||
bool m_isTableCollection;
|
||||
|
||||
ParserKeywordActionEnum m_action;
|
||||
|
||||
void initData( const Json::JsonObject& jsonConfig );
|
||||
void initSize( const Json::JsonObject& jsonConfig );
|
||||
void initSizeKeyword( const std::string& sizeKeyword, const std::string& sizeItem);
|
||||
void initSizeKeyword(const Json::JsonObject& sizeObject);
|
||||
void commonInit(const std::string& name);
|
||||
void commonInit(const std::string& name, ParserKeywordActionEnum action);
|
||||
void addItems( const Json::JsonObject& jsonConfig);
|
||||
void addTableItems();
|
||||
};
|
||||
|
@ -100,3 +100,38 @@ BOOST_AUTO_TEST_CASE(TestValueTypeEnumLoop) {
|
||||
BOOST_CHECK_EQUAL( "FLOAT" , ParserValueTypeEnum2String(ParserValueTypeEnumFromString( "FLOAT" ) ));
|
||||
BOOST_CHECK_EQUAL( "STRING" , ParserValueTypeEnum2String(ParserValueTypeEnumFromString( "STRING" ) ));
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************/
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TestKeywordActionEnum2String) {
|
||||
BOOST_CHECK_EQUAL( "INTERNALIZE" , ParserKeywordActionEnum2String(INTERNALIZE));
|
||||
BOOST_CHECK_EQUAL( "IGNORE" , ParserKeywordActionEnum2String(IGNORE));
|
||||
BOOST_CHECK_EQUAL( "IGNORE_WARNING" , ParserKeywordActionEnum2String(IGNORE_WARNING));
|
||||
BOOST_CHECK_EQUAL( "THROW_EXCEPTION" , ParserKeywordActionEnum2String(THROW_EXCEPTION));
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TestKeywordActionEnumFromString) {
|
||||
BOOST_CHECK_THROW( ParserKeywordActionEnumFromString("XXX") , std::invalid_argument );
|
||||
BOOST_CHECK_EQUAL( INTERNALIZE , ParserKeywordActionEnumFromString("INTERNALIZE"));
|
||||
BOOST_CHECK_EQUAL( IGNORE_WARNING , ParserKeywordActionEnumFromString("IGNORE_WARNING"));
|
||||
BOOST_CHECK_EQUAL( IGNORE , ParserKeywordActionEnumFromString("IGNORE"));
|
||||
BOOST_CHECK_EQUAL( THROW_EXCEPTION , ParserKeywordActionEnumFromString("THROW_EXCEPTION"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TestKeywordActionEnumLoop) {
|
||||
BOOST_CHECK_EQUAL( INTERNALIZE , ParserKeywordActionEnumFromString( ParserKeywordActionEnum2String( INTERNALIZE ) ));
|
||||
BOOST_CHECK_EQUAL( IGNORE , ParserKeywordActionEnumFromString( ParserKeywordActionEnum2String( IGNORE ) ));
|
||||
BOOST_CHECK_EQUAL( IGNORE_WARNING , ParserKeywordActionEnumFromString( ParserKeywordActionEnum2String( IGNORE_WARNING ) ));
|
||||
BOOST_CHECK_EQUAL( THROW_EXCEPTION , ParserKeywordActionEnumFromString( ParserKeywordActionEnum2String( THROW_EXCEPTION ) ));
|
||||
|
||||
BOOST_CHECK_EQUAL( "INTERNALIZE" , ParserKeywordActionEnum2String(ParserKeywordActionEnumFromString( "INTERNALIZE" ) ));
|
||||
BOOST_CHECK_EQUAL( "IGNORE" , ParserKeywordActionEnum2String(ParserKeywordActionEnumFromString( "IGNORE" ) ));
|
||||
BOOST_CHECK_EQUAL( "IGNORE_WARNING" , ParserKeywordActionEnum2String(ParserKeywordActionEnumFromString( "IGNORE_WARNING" ) ));
|
||||
BOOST_CHECK_EQUAL( "THROW_EXCEPTION" , ParserKeywordActionEnum2String(ParserKeywordActionEnumFromString( "THROW_EXCEPTION" ) ));
|
||||
}
|
||||
|
||||
|
||||
|
@ -130,8 +130,18 @@ BOOST_AUTO_TEST_CASE(ConstructFromJsonObject) {
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ConstructFromJsonObjectWithActionInvalidThrows) {
|
||||
Json::JsonObject jsonObject("{\"name\": \"XXX\" , \"size\" : 0, \"action\" : \"WhatEver?\"}");
|
||||
BOOST_CHECK_THROW(ParserKeyword parserKeyword(jsonObject) , std::invalid_argument);
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ConstructFromJsonObjectWithAction) {
|
||||
Json::JsonObject jsonObject("{\"name\": \"XXX\" , \"size\" : 0, \"action\" : \"IGNORE\"}");
|
||||
ParserKeyword parserKeyword(jsonObject);
|
||||
BOOST_CHECK_EQUAL( IGNORE , parserKeyword.getAction() );
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ConstructFromJsonObject_withSize) {
|
||||
Json::JsonObject jsonObject("{\"name\": \"BPR\", \"size\" : 100 , \"items\" :[{\"name\":\"ItemX\" , \"size_type\":\"SINGLE\" , \"value_type\" : \"FLOAT\"}]}");
|
||||
@ -150,6 +160,12 @@ BOOST_AUTO_TEST_CASE(ConstructFromJsonObject_missingItemThrows) {
|
||||
BOOST_CHECK_THROW( ParserKeyword parserKeyword(jsonObject) , std::invalid_argument);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ConstructFromJsonObject_missingItemActionIgnoreOK) {
|
||||
Json::JsonObject jsonObject("{\"name\": \"BPR\", \"size\" : 100, \"action\" : \"IGNORE\"}");
|
||||
BOOST_CHECK_NO_THROW( ParserKeyword parserKeyword(jsonObject));
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ConstructFromJsonObject_nosize_notItems_OK) {
|
||||
Json::JsonObject jsonObject("{\"name\": \"BPR\"}");
|
||||
ParserKeyword parserKeyword(jsonObject);
|
||||
@ -324,7 +340,7 @@ BOOST_AUTO_TEST_CASE(DefaultIsNot_TableKeyword) {
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ConstructorIsTableCollection) {
|
||||
ParserKeywordPtr parserKeyword(new ParserKeyword("JA" , "TABDIMS" , "NTPVT" , true));
|
||||
ParserKeywordPtr parserKeyword(new ParserKeyword("JA" , "TABDIMS" , "NTPVT" , INTERNALIZE , true));
|
||||
const std::pair<std::string,std::string>& sizeKW = parserKeyword->getSizeDefinitionPair();
|
||||
BOOST_CHECK(parserKeyword->isTableCollection());
|
||||
BOOST_CHECK(!parserKeyword->hasFixedSize());
|
||||
@ -339,7 +355,7 @@ BOOST_AUTO_TEST_CASE(ConstructorIsTableCollection) {
|
||||
BOOST_AUTO_TEST_CASE(ParseEmptyRecord) {
|
||||
ParserKeywordPtr tabdimsKeyword( new ParserKeyword("TEST" , 1));
|
||||
ParserIntItemConstPtr item(new ParserIntItem(std::string("ITEM") , ALL));
|
||||
RawKeywordPtr rawkeyword(new RawKeyword( tabdimsKeyword->getName() , 1));
|
||||
RawKeywordPtr rawkeyword(new RawKeyword( tabdimsKeyword->getName() , "FILE" , 10U , 1));
|
||||
|
||||
|
||||
|
||||
@ -356,3 +372,17 @@ BOOST_AUTO_TEST_CASE(ParseEmptyRecord) {
|
||||
BOOST_CHECK_EQUAL(0U , deckItem->size());
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************/
|
||||
/* Action value */
|
||||
|
||||
BOOST_AUTO_TEST_CASE(DefaultActionISINTERNALIZE) {
|
||||
ParserKeywordPtr parserKeyword(new ParserKeyword("JA"));
|
||||
BOOST_CHECK_EQUAL(INTERNALIZE , parserKeyword->getAction());
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CreateWithAction) {
|
||||
ParserKeywordPtr parserKeyword(new ParserKeyword("JA" , IGNORE));
|
||||
BOOST_CHECK_EQUAL(IGNORE , parserKeyword->getAction());
|
||||
}
|
||||
|
@ -216,6 +216,14 @@ BOOST_AUTO_TEST_CASE(loadConfigFromDirectory_default) {
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(DropKeyword) {
|
||||
ParserPtr parser(new Parser());
|
||||
BOOST_CHECK_EQUAL(false , parser->dropKeyword("DoesNotHaveThis"));
|
||||
BOOST_CHECK_EQUAL(true , parser->dropKeyword("BPR"));
|
||||
BOOST_CHECK_EQUAL(false , parser->dropKeyword("BPR"));
|
||||
}
|
||||
|
||||
|
||||
/***************** Simple Int parsing ********************************/
|
||||
|
||||
ParserKeywordPtr setupParserKeywordInt(std::string name, int numberOfItems) {
|
||||
|
@ -26,13 +26,13 @@
|
||||
namespace Opm {
|
||||
|
||||
|
||||
RawKeyword::RawKeyword(const std::string& name) {
|
||||
commonInit(name);
|
||||
RawKeyword::RawKeyword(const std::string& name, const std::string& filename, size_t lineNR) {
|
||||
commonInit(name,filename,lineNR);
|
||||
}
|
||||
|
||||
|
||||
RawKeyword::RawKeyword(const std::string& name , size_t inputSize, bool isTableCollection ) {
|
||||
commonInit(name);
|
||||
RawKeyword::RawKeyword(const std::string& name , const std::string& filename, size_t lineNR , size_t inputSize, bool isTableCollection ) {
|
||||
commonInit(name,filename,lineNR);
|
||||
if (isTableCollection) {
|
||||
m_isTableCollection = true;
|
||||
m_numTables = inputSize;
|
||||
@ -47,8 +47,10 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
void RawKeyword::commonInit(const std::string& name) {
|
||||
void RawKeyword::commonInit(const std::string& name , const std::string& filename, size_t lineNR) {
|
||||
setKeywordName( name );
|
||||
m_filename = filename;
|
||||
m_lineNR = lineNR;
|
||||
m_isFinished = false;
|
||||
m_fixedSizeKeyword = false;
|
||||
m_isTableCollection = false;
|
||||
@ -178,5 +180,13 @@ namespace Opm {
|
||||
return m_isFinished;
|
||||
}
|
||||
|
||||
const std::string& RawKeyword::getFilename() const {
|
||||
return m_filename;
|
||||
}
|
||||
|
||||
size_t RawKeyword::getLineNR() const {
|
||||
return m_lineNR;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -36,8 +36,8 @@ namespace Opm {
|
||||
|
||||
class RawKeyword {
|
||||
public:
|
||||
RawKeyword(const std::string& name);
|
||||
RawKeyword(const std::string& name , size_t inputSize , bool isTableCollection = false);
|
||||
RawKeyword(const std::string& name , const std::string& filename, size_t lineNR);
|
||||
RawKeyword(const std::string& name , const std::string& filename, size_t lineNR , size_t inputSize , bool isTableCollection = false);
|
||||
|
||||
const std::string& getKeywordName() const;
|
||||
void addRawRecordString(const std::string& partialRecordString);
|
||||
@ -52,6 +52,9 @@ namespace Opm {
|
||||
bool isFinished() const;
|
||||
bool isTableCollection() const;
|
||||
|
||||
const std::string& getFilename() const;
|
||||
size_t getLineNR() const;
|
||||
|
||||
|
||||
private:
|
||||
bool m_isTableCollection;
|
||||
@ -64,7 +67,10 @@ namespace Opm {
|
||||
std::vector<RawRecordPtr> m_records;
|
||||
std::string m_partialRecordString;
|
||||
|
||||
void commonInit(const std::string& name);
|
||||
size_t m_lineNR;
|
||||
std::string m_filename;
|
||||
|
||||
void commonInit(const std::string& name,const std::string& filename, size_t lineNR);
|
||||
void setKeywordName(const std::string& keyword);
|
||||
static bool isValidKeyword(const std::string& keywordCandidate);
|
||||
};
|
||||
|
@ -26,45 +26,45 @@
|
||||
using namespace Opm;
|
||||
|
||||
BOOST_AUTO_TEST_CASE(RawKeywordGiveKeywordToConstructorKeywordSet) {
|
||||
RawKeyword keyword("KEYYWORD");
|
||||
RawKeyword keyword("KEYYWORD", "FILE" , 10U);
|
||||
BOOST_CHECK(keyword.getKeywordName() == "KEYYWORD");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(RawKeywordGiveKeywordToConstructorTooLongThrows) {
|
||||
BOOST_CHECK_THROW(RawKeyword keyword("KEYYYWORD"), std::invalid_argument);
|
||||
BOOST_CHECK_THROW(RawKeyword keyword("KEYYYWORD", "FILE" , 10U), std::invalid_argument);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(RawKeywordSetKeywordInitialWhitespaceInKeywordThrows) {
|
||||
BOOST_CHECK_THROW(RawKeyword(" TELONG"), std::invalid_argument);
|
||||
BOOST_CHECK_THROW(RawKeyword(" TELONG", "FILE" , 10U), std::invalid_argument);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(constructor_mixedCaseName_throws) {
|
||||
BOOST_CHECK_THROW(RawKeyword("Test"), std::invalid_argument);
|
||||
BOOST_CHECK_THROW(RawKeyword("Test", "FILE" , 10U), std::invalid_argument);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(RawKeywordSetKeywordInitialTabInKeywordThrows) {
|
||||
BOOST_CHECK_THROW( RawKeyword("\tTELONG"), std::invalid_argument);
|
||||
BOOST_CHECK_THROW( RawKeyword("\tTELONG", "FILE" , 10U), std::invalid_argument);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(RawKeywordSetCorrectLenghtKeywordNoError) {
|
||||
RawKeyword keyword("GOODONE");
|
||||
RawKeyword keyword("GOODONE", "FILE" , 10U);
|
||||
BOOST_CHECK(keyword.getKeywordName() == "GOODONE");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(RawKeywordSet8CharKeywordWithTrailingWhitespaceKeywordTrimmed) {
|
||||
RawKeyword keyword("GOODONEE ");
|
||||
RawKeyword keyword("GOODONEE ", "FILE" , 10U);
|
||||
BOOST_CHECK(keyword.getKeywordName() == "GOODONEE");
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addRecord_singleRecord_recordAdded) {
|
||||
RawKeyword keyword("TEST");
|
||||
RawKeyword keyword("TEST", "FILE" , 10U);
|
||||
keyword.addRawRecordString("test 1 3 4 /");
|
||||
BOOST_CHECK_EQUAL(1U, keyword.size());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(getRecord_outOfRange_throws) {
|
||||
RawKeyword keyword("TEST");
|
||||
RawKeyword keyword("TEST", "FILE" , 10U);
|
||||
keyword.addRawRecordString("test 1 3 4 /");
|
||||
BOOST_CHECK_THROW(keyword.getRecord(1), std::range_error);
|
||||
}
|
||||
@ -72,7 +72,7 @@ BOOST_AUTO_TEST_CASE(getRecord_outOfRange_throws) {
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(isFinished_undef_size) {
|
||||
RawKeyword keyword("TEST");
|
||||
RawKeyword keyword("TEST", "FILE" , 10U);
|
||||
|
||||
BOOST_CHECK( !keyword.isFinished() );
|
||||
keyword.addRawRecordString("test 1 3 4 /");
|
||||
@ -87,14 +87,14 @@ BOOST_AUTO_TEST_CASE(isFinished_undef_size) {
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(isFinished_Fixedsize0) {
|
||||
RawKeyword keyword("TEST" ,0U);
|
||||
RawKeyword keyword("TEST" , "FILE" , 10U , 0U);
|
||||
|
||||
BOOST_CHECK( keyword.isFinished() );
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(isFinished_Fixedsize1) {
|
||||
RawKeyword keyword("TEST" , 1U);
|
||||
RawKeyword keyword("TEST" , "FILE" , 10U, 1U);
|
||||
BOOST_CHECK( !keyword.isFinished() );
|
||||
keyword.addRawRecordString("test 1 3 4 /");
|
||||
BOOST_CHECK( keyword.isFinished() );
|
||||
@ -102,7 +102,7 @@ BOOST_AUTO_TEST_CASE(isFinished_Fixedsize1) {
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(isFinished_FixedsizeMulti) {
|
||||
RawKeyword keyword("TEST" , 4U);
|
||||
RawKeyword keyword("TEST", "FILE" , 10U , 4U);
|
||||
BOOST_CHECK( !keyword.isFinished() );
|
||||
keyword.addRawRecordString("test 1 3 4 /");
|
||||
BOOST_CHECK( !keyword.isFinished() );
|
||||
@ -146,16 +146,23 @@ BOOST_AUTO_TEST_CASE(useLine) {
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(isTableCollection) {
|
||||
RawKeyword keyword1("TEST" , 4U , false);
|
||||
RawKeyword keyword2("TEST2");
|
||||
RawKeyword keyword1("TEST" , "FILE" , 10U, 4U , false);
|
||||
RawKeyword keyword2("TEST2", "FILE" , 10U);
|
||||
BOOST_CHECK_EQUAL( false , keyword1.isTableCollection());
|
||||
BOOST_CHECK_EQUAL( false , keyword2.isTableCollection());
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CreateTableCollection) {
|
||||
RawKeyword keyword1("TEST" , 2, true);
|
||||
RawKeyword keyword1("TEST" , "FILE" , 10U, 2, true);
|
||||
BOOST_CHECK_EQUAL( true , keyword1.isTableCollection());
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CreateWithFileAndLine) {
|
||||
RawKeyword keyword1("TEST" , "XXX", 100);
|
||||
BOOST_CHECK_EQUAL( "XXX" , keyword1.getFilename());
|
||||
BOOST_CHECK_EQUAL( 100U , keyword1.getLineNR() );
|
||||
}
|
||||
|
||||
|
||||
|
3
opm/parser/share/keywords/C/CGFR
Normal file
3
opm/parser/share/keywords/C/CGFR
Normal file
@ -0,0 +1,3 @@
|
||||
{"name" : "CGFR", "items" : [
|
||||
{"name" : "MNEMONIC_LIST" , "size_type" : "ALL" , "value_type" : "STRING"}
|
||||
]}
|
3
opm/parser/share/keywords/C/CGPT
Normal file
3
opm/parser/share/keywords/C/CGPT
Normal file
@ -0,0 +1,3 @@
|
||||
{"name" : "CGPT", "items" : [
|
||||
{"name" : "MNEMONIC_LIST" , "size_type" : "ALL" , "value_type" : "STRING"}
|
||||
]}
|
3
opm/parser/share/keywords/C/CWFR
Normal file
3
opm/parser/share/keywords/C/CWFR
Normal file
@ -0,0 +1,3 @@
|
||||
{"name" : "CWFR", "items" : [
|
||||
{"name" : "MNEMONIC_LIST" , "size_type" : "ALL" , "value_type" : "STRING"}
|
||||
]}
|
3
opm/parser/share/keywords/C/CWIR
Normal file
3
opm/parser/share/keywords/C/CWIR
Normal file
@ -0,0 +1,3 @@
|
||||
{"name" : "CWIR", "items" : [
|
||||
{"name" : "MNEMONIC_LIST" , "size_type" : "ALL" , "value_type" : "STRING"}
|
||||
]}
|
3
opm/parser/share/keywords/C/CWIT
Normal file
3
opm/parser/share/keywords/C/CWIT
Normal file
@ -0,0 +1,3 @@
|
||||
{"name" : "CWIT", "items" : [
|
||||
{"name" : "MNEMONIC_LIST" , "size_type" : "ALL" , "value_type" : "STRING"}
|
||||
]}
|
1
opm/parser/share/keywords/D/DATE
Normal file
1
opm/parser/share/keywords/D/DATE
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "DATE"}
|
4
opm/parser/share/keywords/D/DENSITY
Normal file
4
opm/parser/share/keywords/D/DENSITY
Normal file
@ -0,0 +1,4 @@
|
||||
{"name" : "DENSITY", "size" : {"keyword":"TABDIMS", "item":"NTPVT" }, "items" :
|
||||
[{"name": "OIL" , "value_type" : "FLOAT", "default": 600},
|
||||
{"name": "WATER" , "value_type" : "FLOAT", "default": 999.014},
|
||||
{"name": "GAS" , "value_type" : "FLOAT", "default": 1}]}
|
4
opm/parser/share/keywords/D/DRSDT
Normal file
4
opm/parser/share/keywords/D/DRSDT
Normal file
@ -0,0 +1,4 @@
|
||||
{"name" : "DRSDT", "size" : 1, "items" :
|
||||
[{"name" : "DRSDT" , "value_type" : "FLOAT"},
|
||||
{"name" : "Option" , "value_type" : "STRING", "default" : "ALL"}]
|
||||
}
|
15
opm/parser/share/keywords/E/EHYSTR
Normal file
15
opm/parser/share/keywords/E/EHYSTR
Normal file
@ -0,0 +1,15 @@
|
||||
{"name" : "EHYSTR" , "size" : 1, "items" :
|
||||
[
|
||||
{"name" : "curvature_caplillary_pressure_hyst", "value_type" : "FLOAT", "default" : 0.1},
|
||||
{"name" : "relative_perm_hyst", "value_type" : "INT", "default" : 0, "comment" : "Default is 2 for Eclipse300"},
|
||||
{"name" : "curvature_param_killough_wetting", "value_type" : "FLOAT", "default" : 1.0},
|
||||
{"name" : "mod_param_trapped", "value_type" : "FLOAT", "default" : 0.1},
|
||||
{"name" : "limiting_hyst_flag", "value_type" : "STRING", "default" : "BOTH"},
|
||||
{"name" : "shape_cap_press_flag", "value_type" : "STRING", "default" : "RETR"},
|
||||
{"name" : "init_fluid_mob_flag", "value_type" : "STRING", "default" : "DRAIN"},
|
||||
{"name" : "wetting_phase_flag", "value_type" : "STRING"},
|
||||
{"name" : "baker_flag_oil", "value_type" : "STRING", "default" : "NO"},
|
||||
{"name" : "baker_flag_gas", "value_type" : "STRING", "default" : "NO"},
|
||||
{"name" : "baker_flag_water", "value_type" : "STRING", "default" : "NO"},
|
||||
{"name" : "threshold_saturation", "value_type" : "FLOAT", "default" : 0.0}
|
||||
]}
|
3
opm/parser/share/keywords/E/EQLNUM
Normal file
3
opm/parser/share/keywords/E/EQLNUM
Normal file
@ -0,0 +1,3 @@
|
||||
{"name" : "EQLNUM" , "size" : 1, "items" :
|
||||
[{"name" : "EQL_REGION", "value_type" : "INT"}]
|
||||
}
|
14
opm/parser/share/keywords/F/FAULTS
Normal file
14
opm/parser/share/keywords/F/FAULTS
Normal file
@ -0,0 +1,14 @@
|
||||
{"name" : "FAULTS", "items" :
|
||||
[
|
||||
{"name" : "NAME", "value_type" : "STRING"},
|
||||
{"name" : "IX1", "value_type" : "INT"},
|
||||
{"name" : "IX2", "value_type" : "INT"},
|
||||
{"name" : "IY1", "value_type" : "INT"},
|
||||
{"name" : "IY2", "value_type" : "INT"},
|
||||
{"name" : "IZ1", "value_type" : "INT"},
|
||||
{"name" : "IZ2", "value_type" : "INT"},
|
||||
{"name" : "FACE", "value_type" : "STRING"}
|
||||
]
|
||||
}
|
||||
|
||||
|
1
opm/parser/share/keywords/F/FGCR
Normal file
1
opm/parser/share/keywords/F/FGCR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGCR" }
|
1
opm/parser/share/keywords/F/FGCT
Normal file
1
opm/parser/share/keywords/F/FGCT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGCT" }
|
1
opm/parser/share/keywords/F/FGIP
Normal file
1
opm/parser/share/keywords/F/FGIP
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGIP" }
|
1
opm/parser/share/keywords/F/FGIR
Normal file
1
opm/parser/share/keywords/F/FGIR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGIR" }
|
1
opm/parser/share/keywords/F/FGIRH
Normal file
1
opm/parser/share/keywords/F/FGIRH
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGIRH" }
|
1
opm/parser/share/keywords/F/FGIT
Normal file
1
opm/parser/share/keywords/F/FGIT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGIT" }
|
1
opm/parser/share/keywords/F/FGITH
Normal file
1
opm/parser/share/keywords/F/FGITH
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGITH" }
|
1
opm/parser/share/keywords/F/FGOR
Normal file
1
opm/parser/share/keywords/F/FGOR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGOR" }
|
1
opm/parser/share/keywords/F/FGORH
Normal file
1
opm/parser/share/keywords/F/FGORH
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGORH" }
|
1
opm/parser/share/keywords/F/FGPR
Normal file
1
opm/parser/share/keywords/F/FGPR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGPR" }
|
1
opm/parser/share/keywords/F/FGPRH
Normal file
1
opm/parser/share/keywords/F/FGPRH
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGPRH" }
|
1
opm/parser/share/keywords/F/FGPT
Normal file
1
opm/parser/share/keywords/F/FGPT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGPT" }
|
1
opm/parser/share/keywords/F/FGPTH
Normal file
1
opm/parser/share/keywords/F/FGPTH
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGPTH" }
|
1
opm/parser/share/keywords/F/FGSR
Normal file
1
opm/parser/share/keywords/F/FGSR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGSR" }
|
1
opm/parser/share/keywords/F/FGST
Normal file
1
opm/parser/share/keywords/F/FGST
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FGST" }
|
1
opm/parser/share/keywords/F/FLPR
Normal file
1
opm/parser/share/keywords/F/FLPR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FLPR" }
|
1
opm/parser/share/keywords/F/FLPRH
Normal file
1
opm/parser/share/keywords/F/FLPRH
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FLPRH" }
|
1
opm/parser/share/keywords/F/FLPT
Normal file
1
opm/parser/share/keywords/F/FLPT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FLPT" }
|
1
opm/parser/share/keywords/F/FLPTH
Normal file
1
opm/parser/share/keywords/F/FLPTH
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FLPTH" }
|
1
opm/parser/share/keywords/F/FOIP
Normal file
1
opm/parser/share/keywords/F/FOIP
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FOIP" }
|
1
opm/parser/share/keywords/F/FOPR
Normal file
1
opm/parser/share/keywords/F/FOPR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FOPR" }
|
1
opm/parser/share/keywords/F/FOPRH
Normal file
1
opm/parser/share/keywords/F/FOPRH
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FOPRH" }
|
1
opm/parser/share/keywords/F/FOPT
Normal file
1
opm/parser/share/keywords/F/FOPT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FOPT" }
|
1
opm/parser/share/keywords/F/FOPTH
Normal file
1
opm/parser/share/keywords/F/FOPTH
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FOPTH" }
|
1
opm/parser/share/keywords/F/FPR
Normal file
1
opm/parser/share/keywords/F/FPR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FPR" }
|
1
opm/parser/share/keywords/F/FVIR
Normal file
1
opm/parser/share/keywords/F/FVIR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FVIR" }
|
1
opm/parser/share/keywords/F/FVIT
Normal file
1
opm/parser/share/keywords/F/FVIT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FVIT" }
|
1
opm/parser/share/keywords/F/FVPR
Normal file
1
opm/parser/share/keywords/F/FVPR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FVPR" }
|
1
opm/parser/share/keywords/F/FVPT
Normal file
1
opm/parser/share/keywords/F/FVPT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FVPT" }
|
1
opm/parser/share/keywords/F/FWCT
Normal file
1
opm/parser/share/keywords/F/FWCT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FWCT" }
|
1
opm/parser/share/keywords/F/FWCTH
Normal file
1
opm/parser/share/keywords/F/FWCTH
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FWCTH" }
|
1
opm/parser/share/keywords/F/FWIP
Normal file
1
opm/parser/share/keywords/F/FWIP
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FWIP" }
|
1
opm/parser/share/keywords/F/FWIR
Normal file
1
opm/parser/share/keywords/F/FWIR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FWIR" }
|
1
opm/parser/share/keywords/F/FWIRH
Normal file
1
opm/parser/share/keywords/F/FWIRH
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FWIRH" }
|
1
opm/parser/share/keywords/F/FWIT
Normal file
1
opm/parser/share/keywords/F/FWIT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FWIT" }
|
1
opm/parser/share/keywords/F/FWITH
Normal file
1
opm/parser/share/keywords/F/FWITH
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FWITH" }
|
1
opm/parser/share/keywords/F/FWPR
Normal file
1
opm/parser/share/keywords/F/FWPR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FWPR" }
|
1
opm/parser/share/keywords/F/FWPRH
Normal file
1
opm/parser/share/keywords/F/FWPRH
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FWPRH" }
|
1
opm/parser/share/keywords/F/FWPT
Normal file
1
opm/parser/share/keywords/F/FWPT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FWPT" }
|
1
opm/parser/share/keywords/F/FWPTH
Normal file
1
opm/parser/share/keywords/F/FWPTH
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "FWPTH" }
|
1
opm/parser/share/keywords/G/GGIR
Normal file
1
opm/parser/share/keywords/G/GGIR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GGIR" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GGIT
Normal file
1
opm/parser/share/keywords/G/GGIT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GGIT" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GGPR
Normal file
1
opm/parser/share/keywords/G/GGPR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GGPR" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GGPT
Normal file
1
opm/parser/share/keywords/G/GGPT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GGPT" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GLPR
Normal file
1
opm/parser/share/keywords/G/GLPR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GLPR" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GMCTG
Normal file
1
opm/parser/share/keywords/G/GMCTG
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GMCTG" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GMCTW
Normal file
1
opm/parser/share/keywords/G/GMCTW
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GMCTW" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GOPR
Normal file
1
opm/parser/share/keywords/G/GOPR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GOPR" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GOPT
Normal file
1
opm/parser/share/keywords/G/GOPT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GOPT" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GPR
Normal file
1
opm/parser/share/keywords/G/GPR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GPR" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GPRW
Normal file
1
opm/parser/share/keywords/G/GPRW
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GPRW" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
9
opm/parser/share/keywords/G/GRUPNET
Normal file
9
opm/parser/share/keywords/G/GRUPNET
Normal file
@ -0,0 +1,9 @@
|
||||
{"name" : "GRUPNET" , "items" : [
|
||||
{"name" : "NAME" , "value_type" : "STRING"},
|
||||
{"name" : "TERMINAL_PRESSURE" , "value_type" : "FLOAT"},
|
||||
{"name" : "VFP_TABLE" , "value_type" : "INT" , "default" : 0},
|
||||
{"name" : "ALQ" , "value_type" : "FLOAT" , "default" : 0},
|
||||
{"name" : "SUB_SEA_MANIFOLD" , "value_type" : "STRING" , "default" : "NO"},
|
||||
{"name" : "LIFT_GAS_FLOW_THROUGH" , "value_type" : "STRING" , "default" : "NO"},
|
||||
{"name" : "ALQ_SURFACE_EQV" , "value_type" : "STRING" , "default" : "NONE"}]}
|
||||
|
1
opm/parser/share/keywords/G/GVIR
Normal file
1
opm/parser/share/keywords/G/GVIR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GVIR" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GVIT
Normal file
1
opm/parser/share/keywords/G/GVIT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GVIT" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GVPR
Normal file
1
opm/parser/share/keywords/G/GVPR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GVPR" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GVPT
Normal file
1
opm/parser/share/keywords/G/GVPT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GVPT" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GWCT
Normal file
1
opm/parser/share/keywords/G/GWCT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GWCT" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GWIR
Normal file
1
opm/parser/share/keywords/G/GWIR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GWIR" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GWIT
Normal file
1
opm/parser/share/keywords/G/GWIT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GWIT" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GWPR
Normal file
1
opm/parser/share/keywords/G/GWPR
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GWPR" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
1
opm/parser/share/keywords/G/GWPT
Normal file
1
opm/parser/share/keywords/G/GWPT
Normal file
@ -0,0 +1 @@
|
||||
{"name" : "GWPT" , "size" : 1 , "items" : [{"name" : "GROUPS" , "size_type" : "ALL" , "value_type" : "STRING"}]}
|
7
opm/parser/share/keywords/M/MAPAXES
Normal file
7
opm/parser/share/keywords/M/MAPAXES
Normal file
@ -0,0 +1,7 @@
|
||||
{"name" : "MAPAXES" , "size" : 1 , "items" : [
|
||||
{"name" : "X1" , "value_type" : "FLOAT"},
|
||||
{"name" : "Y1" , "value_type" : "FLOAT"},
|
||||
{"name" : "X2" , "value_type" : "FLOAT"},
|
||||
{"name" : "Y2" , "value_type" : "FLOAT"},
|
||||
{"name" : "X3" , "value_type" : "FLOAT"},
|
||||
{"name" : "Y3" , "value_type" : "FLOAT"}]}
|
3
opm/parser/share/keywords/M/MAPUNITS
Normal file
3
opm/parser/share/keywords/M/MAPUNITS
Normal file
@ -0,0 +1,3 @@
|
||||
{"name" : "MAPUNITS" , "size" : 1 , "items" : [
|
||||
{"name" : "UNIT" , "value_type" : "STRING" , "default" : "METRES"}]}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user