本文整理汇总了C++中opm::Parser::parseString方法的典型用法代码示例。如果您正苦于以下问题:C++ Parser::parseString方法的具体用法?C++ Parser::parseString怎么用?C++ Parser::parseString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类opm::Parser
的用法示例。
在下文中一共展示了Parser::parseString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createDeck
static DeckPtr createDeck( const std::string& summary ) {
Opm::Parser parser;
std::string input =
"START -- 0 \n"
"10 MAI 2007 / \n"
"RUNSPEC\n"
"\n"
"DIMENS\n"
" 10 10 10 /\n"
"GRID\n"
"DXV \n 10*400 /\n"
"DYV \n 10*400 /\n"
"DZV \n 10*400 /\n"
"TOPS \n 100*2202 / \n"
"REGIONS\n"
"FIPNUM\n"
"200*1 300*2 500*3 /\n"
"SCHEDULE\n"
"WELSPECS\n"
" \'W_1\' \'OP\' 1 1 3.33 \'OIL\' 7* / \n"
" \'WX2\' \'OP\' 2 2 3.33 \'OIL\' 7* / \n"
" \'W_3\' \'OP\' 2 5 3.92 \'OIL\' 7* / \n"
" 'PRODUCER' 'G' 5 5 2000 'GAS' /\n"
"/\n"
"COMPDAT\n"
"'PRODUCER' 5 5 1 1 'OPEN' 1* -1 0.5 / \n"
"'W_1' 3 7 1 3 'OPEN' 1* 32.948 0.311 3047.839 2* 'X' 22.100 / \n"
"'W_1' 3 7 2 2 'OPEN' 1* * 0.311 4332.346 2* 'X' 22.123 / \n"
"/\n"
"SUMMARY\n"
+ summary;
return parser.parseString(input, ParseContext());
}
示例2: createDeckWithWellsAndCompletionData
static DeckPtr createDeckWithWellsAndCompletionData() {
Opm::Parser parser;
std::string input =
"START -- 0 \n"
"1 NOV 1979 / \n"
"SCHEDULE\n"
"DATES -- 1\n"
" 1 DES 1979/ \n"
"/\n"
"WELSPECS\n"
" 'OP_1' 'OP' 9 9 1* 'OIL' 1* 1* 1* 1* 1* 1* 1* / \n"
" 'OP_2' 'OP' 8 8 1* 'OIL' 1* 1* 1* 1* 1* 1* 1* / \n"
" 'OP_3' 'OP' 7 7 1* 'OIL' 1* 1* 1* 1* 1* 1* 1* / \n"
"/\n"
"COMPDAT\n"
" 'OP_1' 9 9 1 1 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
" 'OP_1' 9 9 2 2 'OPEN' 1* 46.825 0.311 4332.346 1* 1* 'X' 22.123 / \n"
" 'OP_2' 8 8 1 3 'OPEN' 1* 1.168 0.311 107.872 1* 1* 'Y' 21.925 / \n"
" 'OP_2' 8 7 3 3 'OPEN' 1* 15.071 0.311 1391.859 1* 1* 'Y' 21.920 / \n"
" 'OP_2' 8 7 3 6 'OPEN' 1* 6.242 0.311 576.458 1* 1* 'Y' 21.915 / \n"
" 'OP_3' 7 7 1 1 'OPEN' 1* 27.412 0.311 2445.337 1* 1* 'Y' 18.521 / \n"
" 'OP_3' 7 7 2 2 'OPEN' 1* 55.195 0.311 4923.842 1* 1* 'Y' 18.524 / \n"
"/\n"
"DATES -- 2,3\n"
" 10 JUL 2007 / \n"
" 10 AUG 2007 / \n"
"/\n"
"COMPDAT\n"
" 'OP_1' 9 9 3 9 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
"/\n";
return parser.parseString(input, ParseContext());
}
示例3: loadDeck
inline void loadDeck( const char * deck_file) {
Opm::ParseContext parseContext;
Opm::Parser parser;
auto deck = parser.parseFile(deck_file, parseContext);
Opm::EclipseState state( deck, parseContext );
Opm::Schedule schedule( deck, state.getInputGrid(), state.get3DProperties(), state.runspec(), parseContext);
Opm::SummaryConfig summary( deck, schedule, state.getTableManager( ), parseContext );
{
std::stringstream ss;
ss << deck;
auto deck2 = parser.parseString(ss.str(), parseContext);
if (deck.size() != deck2.size()) {
std::cerr << "Deck size mismatch original:" << deck.size() << " new: " << deck2.size( ) << std::endl;
std::exit( 1 );
}
for (size_t index=0; index < deck.size(); index++) {
const auto& kw1 = deck.getKeyword( index );
const auto& kw2 = deck2.getKeyword( index );
if (!kw1.equal( kw2 , true , true)) {
std::cerr << "Keyword " << index << " different " << kw1.name() << " " << kw2.name() << std::endl;
std::cerr << kw1 << std::endl;
std::cerr << std::endl << "-----------------------------------------------------------------" << std::endl;
std::cerr << kw2 << std::endl;
std::exit( 1 );
}
}
}
}
示例4: createDeckWithDynamicWSOLVENT
static Deck createDeckWithDynamicWSOLVENT() {
Opm::Parser parser;
std::string input =
"START -- 0 \n"
"1 JAN 2000 / \n"
"SCHEDULE\n"
"WELSPECS\n"
" 'W_1' 'OP' 1 1 1* \'GAS\' 7* / \n"
"/\n"
"COMPDAT\n"
" 'W_1' 2* 1 1 'OPEN' / \n"
"/\n"
"WCONINJE\n"
" 'W_1' 'GAS' 'OPEN' 'BHP' 1 2 3/\n/\n"
"DATES -- 2\n"
" 1 MAY 2000 / \n"
"/\n"
"WSOLVENT\n"
" 'W_1' 1 / \n "
"/\n"
"DATES -- 3,4\n"
" 1 JUL 2000 / \n"
" 1 AUG 2000 / \n"
"/\n"
"WSOLVENT\n"
" 'W_1' 0 / \n "
"/\n";
return parser.parseString(input, ParseContext());
}
示例5: createDeckWithDynamicWTRACER
static Deck createDeckWithDynamicWTRACER() {
Opm::Parser parser;
std::string input =
"START -- 0 \n"
"1 JAN 2000 / \n"
"SCHEDULE\n"
"WELSPECS\n"
" 'W_1' 'OP' 1 1 1* \'GAS\' 7* / \n"
"/\n"
"COMPDAT\n"
" 'W_1' 2* 1 1 'OPEN' / \n"
"/\n"
"WCONINJE\n"
" 'W_1' 'GAS' 'OPEN' 'BHP' 1 2 3/\n/\n"
"DATES -- 1\n"
" 1 MAY 2000 / \n"
"/\n"
"WTRACER\n"
" 'W_1' 'I1' 1 / \n "
" 'W_1' 'I2' 1 / \n "
"/\n"
"DATES -- 2, 3\n"
" 1 JUL 2000 / \n"
" 1 AUG 2000 / \n"
"/\n"
"WTRACER\n"
" 'W_1' 'I1' 0 / \n "
"/\n"
"DATES -- 4\n"
" 1 SEP 2000 / \n"
"/\n";
return parser.parseString(input);
}
示例6: createDeckWithGasInjector
static Deck createDeckWithGasInjector() {
Opm::Parser parser;
std::string input =
"GRID\n"
"PERMX\n"
" 1000*0.25/\n"
"COPY\n"
" PERMX PERMY /\n"
" PERMX PERMZ /\n"
"/\n"
"SCHEDULE\n"
"WELSPECS\n"
" 'W_1' 'OP' 1 1 1* \'GAS\' 7* / \n"
"/\n"
"COMPDAT\n"
" 'W_1' 2* 1 1 'OPEN' / \n"
"/\n"
"WCONINJE\n"
" 'W_1' 'GAS' 'OPEN' 'BHP' 1 2 3/\n/\n"
"WSOLVENT\n"
" 'W_1' 1 / \n "
"/\n";
return parser.parseString(input);
}
示例7: createTABDIMSKeyword
static const Opm::DeckKeyword createTABDIMSKeyword( ) {
const char* deckData =
"TABDIMS\n"
" 0 1 2 3 4 5 / \n"
"\n";
Opm::Parser parser;
Opm::Deck deck = parser.parseString(deckData, Opm::ParseContext());
return deck.getKeyword("TABDIMS");
}
示例8: createSATNUMKeyword
static const Opm::DeckKeyword createSATNUMKeyword( ) {
const char* deckData =
"SATNUM \n"
" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 / \n"
"\n";
Opm::Parser parser;
Opm::Deck deck = parser.parseString(deckData, Opm::ParseContext());
return deck.getKeyword("SATNUM");
}
示例9: createDeck
static DeckPtr createDeck() {
Opm::Parser parser;
std::string input =
"START\n"
"8 MAR 1998 /\n"
"\n"
"SCHEDULE\n"
"\n";
return parser.parseString(input, ParseContext());
}
示例10: createDeckMissingDIMS
static Opm::Deck createDeckMissingDIMS() {
const char* deckData =
"RUNSPEC\n"
"\n"
"GRID\n"
"EDIT\n"
"\n";
Opm::Parser parser;
return parser.parseString( deckData, Opm::ParseContext()) ;
}
示例11:
static Opm::Deck radial_missing_INRAD() {
const char* deckData =
"RUNSPEC\n"
"\n"
"DIMENS\n"
" 10 10 10 /\n"
"RADIAL\n"
"\n";
Opm::Parser parser;
return parser.parseString( deckData, Opm::ParseContext());
}
示例12: createSWOFDeck
inline Opm::Deck createSWOFDeck() {
const char *deckData =
"TABDIMS\n"
" 2 /\n"
"\n"
"SWOF\n"
" 1 2 3 4\n"
" 5 6 7 8 /\n"
" 9 10 11 12 /\n";
Opm::Parser parser;
return parser.parseString(deckData, Opm::ParseContext());
}
示例13: createDeckHeaders
static Opm::Deck createDeckHeaders() {
const char* deckData =
"RUNSPEC\n"
"\n"
"DIMENS\n"
" 10 10 10 /\n"
"GRID\n"
"EDIT\n"
"\n";
Opm::Parser parser;
return parser.parseString( deckData, Opm::ParseContext());
}
示例14: createDeckWithWellsOrdered
static DeckPtr createDeckWithWellsOrdered() {
Opm::Parser parser;
std::string input =
"START -- 0 \n"
"10 MAI 2007 / \n"
"SCHEDULE\n"
"WELSPECS\n"
" \'CW_1\' \'OP\' 30 37 3.33 \'OIL\' 7* / \n"
" \'BW_2\' \'OP\' 30 37 3.33 \'OIL\' 7* / \n"
" \'AW_3\' \'OP\' 20 51 3.92 \'OIL\' 7* / \n"
"/\n";
return parser.parseString(input, ParseContext());
}
示例15: loadCOMPDAT
Opm::WellConnections loadCOMPDAT(const std::string& compdat_keyword) {
Opm::EclipseGrid grid(10,10,10);
Opm::TableManager tables;
Opm::Parser parser;
const auto deck = parser.parseString(compdat_keyword);
Opm::Eclipse3DProperties props(deck, tables, grid );
const auto& keyword = deck.getKeyword("COMPDAT", 0);
Opm::WellConnections connections;
std::size_t totnc = 0;
for (const auto& rec : keyword)
connections.loadCOMPDAT(rec, grid, props, totnc);
return connections;
}