mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
sim_fibo_ad*: print the log messages from the parser/EclipseState
This commit is contained in:
parent
3c97fa0d64
commit
566c7c03d7
@ -102,10 +102,29 @@ try
|
|||||||
double gravity[3] = { 0.0 };
|
double gravity[3] = { 0.0 };
|
||||||
std::string deck_filename = param.get<std::string>("deck_filename");
|
std::string deck_filename = param.get<std::string>("deck_filename");
|
||||||
|
|
||||||
Opm::ParserPtr newParser(new Opm::Parser() );
|
Opm::ParserPtr parser(new Opm::Parser() );
|
||||||
|
Opm::ParserLogPtr parserLog(new Opm::ParserLog());
|
||||||
bool strict_parsing = param.getDefault("strict_parsing", true);
|
bool strict_parsing = param.getDefault("strict_parsing", true);
|
||||||
Opm::DeckConstPtr deck = newParser->parseFile(deck_filename, strict_parsing);
|
Opm::DeckConstPtr deck;
|
||||||
std::shared_ptr<EclipseState> eclipseState(new EclipseState(deck));
|
std::shared_ptr<EclipseState> eclipseState;
|
||||||
|
try {
|
||||||
|
deck = parser->parseFile(deck_filename, strict_parsing, parserLog);
|
||||||
|
EclipseState::checkDeck(deck, parserLog);
|
||||||
|
eclipseState.reset(new EclipseState(deck, parserLog));
|
||||||
|
}
|
||||||
|
catch (const std::invalid_argument& e) {
|
||||||
|
std::cerr << "error while parsing the deck file: " << e.what() << "\n";
|
||||||
|
if (parserLog->size() > 0) {
|
||||||
|
std::cerr << "Issues found while parsing the deck file:\n";
|
||||||
|
parserLog->printAll(std::cerr);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parserLog->size() > 0) {
|
||||||
|
std::cerr << "Issues found while parsing the deck file:\n";
|
||||||
|
parserLog->printAll(std::cerr);
|
||||||
|
}
|
||||||
|
|
||||||
// Grid init
|
// Grid init
|
||||||
std::vector<double> porv;
|
std::vector<double> porv;
|
||||||
|
@ -128,10 +128,29 @@ try
|
|||||||
double gravity[3] = { 0.0 };
|
double gravity[3] = { 0.0 };
|
||||||
std::string deck_filename = param.get<std::string>("deck_filename");
|
std::string deck_filename = param.get<std::string>("deck_filename");
|
||||||
|
|
||||||
Opm::ParserPtr newParser(new Opm::Parser() );
|
Opm::ParserPtr parser(new Opm::Parser() );
|
||||||
|
Opm::ParserLogPtr parserLog(new Opm::ParserLog());
|
||||||
bool strict_parsing = param.getDefault("strict_parsing", true);
|
bool strict_parsing = param.getDefault("strict_parsing", true);
|
||||||
Opm::DeckConstPtr deck = newParser->parseFile(deck_filename, strict_parsing);
|
Opm::DeckConstPtr deck;
|
||||||
std::shared_ptr<EclipseState> eclipseState(new EclipseState(deck));
|
std::shared_ptr<EclipseState> eclipseState;
|
||||||
|
try {
|
||||||
|
deck = parser->parseFile(deck_filename, strict_parsing, parserLog);
|
||||||
|
EclipseState::checkDeck(deck, parserLog);
|
||||||
|
eclipseState.reset(new EclipseState(deck, parserLog));
|
||||||
|
}
|
||||||
|
catch (const std::invalid_argument& e) {
|
||||||
|
std::cerr << "error while parsing the deck file: " << e.what() << "\n";
|
||||||
|
if (parserLog->size() > 0) {
|
||||||
|
std::cerr << "Issues found while parsing the deck file:\n";
|
||||||
|
parserLog->printAll(std::cerr);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parserLog->size() > 0) {
|
||||||
|
std::cerr << "Issues found while parsing the deck file:\n";
|
||||||
|
parserLog->printAll(std::cerr);
|
||||||
|
}
|
||||||
|
|
||||||
// Grid init
|
// Grid init
|
||||||
grid.reset(new Dune::CpGrid());
|
grid.reset(new Dune::CpGrid());
|
||||||
|
Loading…
Reference in New Issue
Block a user