mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Addde ParseMode argument to parse and EclipseState
This commit is contained in:
@@ -86,6 +86,7 @@
|
|||||||
#include <opm/parser/eclipse/OpmLog/CounterLog.hpp>
|
#include <opm/parser/eclipse/OpmLog/CounterLog.hpp>
|
||||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||||
|
#include <opm/parser/eclipse/Parser/ParseMode.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
|
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
|
|
||||||
@@ -212,12 +213,14 @@ try
|
|||||||
Opm::OpmLog::addBackend( "COUNTER" , counterLog );
|
Opm::OpmLog::addBackend( "COUNTER" , counterLog );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Opm::ParseMode parseMode;
|
||||||
Opm::DeckConstPtr deck;
|
Opm::DeckConstPtr deck;
|
||||||
std::shared_ptr<EclipseState> eclipseState;
|
std::shared_ptr<EclipseState> eclipseState;
|
||||||
|
parseMode.randomSlash = InputError::IGNORE;
|
||||||
try {
|
try {
|
||||||
deck = parser->parseFile(deck_filename);
|
deck = parser->parseFile(deck_filename, parseMode);
|
||||||
Opm::checkDeck(deck);
|
Opm::checkDeck(deck);
|
||||||
eclipseState.reset(new Opm::EclipseState(deck));
|
eclipseState.reset(new Opm::EclipseState(deck , parseMode));
|
||||||
}
|
}
|
||||||
catch (const std::invalid_argument& e) {
|
catch (const std::invalid_argument& e) {
|
||||||
std::cerr << "Failed to create valid ECLIPSESTATE object. See logfile: " << logFile << std::endl;
|
std::cerr << "Failed to create valid ECLIPSESTATE object. See logfile: " << logFile << std::endl;
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <ert/ecl/ecl_nnc_export.h>
|
#include <ert/ecl/ecl_nnc_export.h>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||||
|
#include <opm/parser/eclipse/Parser/ParseMode.hpp>
|
||||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/Grid/TransMult.hpp>
|
#include <opm/parser/eclipse/EclipseState/Grid/TransMult.hpp>
|
||||||
@@ -344,9 +345,10 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
ParserPtr parser(new Parser());
|
ParserPtr parser(new Parser());
|
||||||
|
|
||||||
|
ParseMode parseMode;
|
||||||
std::cout << "Parsing input file ............: " << input_file << std::endl;
|
std::cout << "Parsing input file ............: " << input_file << std::endl;
|
||||||
DeckConstPtr deck = parser->parseFile(input_file);
|
DeckConstPtr deck = parser->parseFile(input_file, parseMode);
|
||||||
std::shared_ptr<EclipseState> state = std::make_shared<EclipseState>( deck );
|
std::shared_ptr<EclipseState> state = std::make_shared<EclipseState>( deck , parseMode );
|
||||||
|
|
||||||
std::cout << "Loading eclipse INIT file .....: " << init_file << std::endl;
|
std::cout << "Loading eclipse INIT file .....: " << init_file << std::endl;
|
||||||
ecl_file_type * ecl_init = ecl_file_open( init_file.c_str() , 0 );
|
ecl_file_type * ecl_init = ecl_file_open( init_file.c_str() , 0 );
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
#include <opm/autodiff/SimulatorIncompTwophaseAd.hpp>
|
#include <opm/autodiff/SimulatorIncompTwophaseAd.hpp>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||||
|
#include <opm/parser/eclipse/Parser/ParseMode.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
@@ -111,8 +112,9 @@ try
|
|||||||
double gravity[3] = { 0.0 };
|
double gravity[3] = { 0.0 };
|
||||||
if (use_deck) {
|
if (use_deck) {
|
||||||
std::string deck_filename = param.get<std::string>("deck_filename");
|
std::string deck_filename = param.get<std::string>("deck_filename");
|
||||||
deck = parser->parseFile(deck_filename);
|
Opm::ParseMode parseMode;
|
||||||
eclipseState.reset(new EclipseState(deck));
|
deck = parser->parseFile(deck_filename, parseMode);
|
||||||
|
eclipseState.reset(new EclipseState(deck , parseMode));
|
||||||
|
|
||||||
// Grid init
|
// Grid init
|
||||||
grid.reset(new GridManager(deck));
|
grid.reset(new GridManager(deck));
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||||
|
#include <opm/parser/eclipse/Parser/ParseMode.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
|
|
||||||
@@ -45,9 +46,10 @@
|
|||||||
struct SetupSimple {
|
struct SetupSimple {
|
||||||
SetupSimple()
|
SetupSimple()
|
||||||
{
|
{
|
||||||
|
Opm::ParseMode parseMode;
|
||||||
Opm::ParserPtr parser(new Opm::Parser());
|
Opm::ParserPtr parser(new Opm::Parser());
|
||||||
deck = parser->parseFile("fluid.data");
|
deck = parser->parseFile("fluid.data", parseMode);
|
||||||
eclState.reset(new Opm::EclipseState(deck));
|
eclState.reset(new Opm::EclipseState(deck , parseMode));
|
||||||
|
|
||||||
param.disableOutput();
|
param.disableOutput();
|
||||||
param.insertParameter("init_rock" , "false" );
|
param.insertParameter("init_rock" , "false" );
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#include <opm/core/simulator/BlackoilState.hpp>
|
#include <opm/core/simulator/BlackoilState.hpp>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||||
|
#include <opm/parser/eclipse/Parser/ParseMode.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
|
|
||||||
@@ -47,8 +48,9 @@ struct SetupSimple {
|
|||||||
SetupSimple()
|
SetupSimple()
|
||||||
{
|
{
|
||||||
Opm::ParserPtr parser(new Opm::Parser());
|
Opm::ParserPtr parser(new Opm::Parser());
|
||||||
deck = parser->parseFile("fluid.data");
|
Opm::ParseMode parseMode;
|
||||||
eclState.reset(new Opm::EclipseState(deck));
|
deck = parser->parseFile("fluid.data" , parseMode);
|
||||||
|
eclState.reset(new Opm::EclipseState(deck , parseMode));
|
||||||
|
|
||||||
param.disableOutput();
|
param.disableOutput();
|
||||||
param.insertParameter("init_rock" , "false" );
|
param.insertParameter("init_rock" , "false" );
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||||
|
#include <opm/parser/eclipse/Parser/ParseMode.hpp>
|
||||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
|
|
||||||
@@ -158,11 +159,12 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
|
|||||||
{
|
{
|
||||||
Opm::parameter::ParameterGroup param;
|
Opm::parameter::ParameterGroup param;
|
||||||
Opm::ParserPtr parser(new Opm::Parser() );
|
Opm::ParserPtr parser(new Opm::Parser() );
|
||||||
|
Opm::ParseMode parseMode;
|
||||||
|
|
||||||
/////
|
/////
|
||||||
// create a DerivedGeology object without any multipliers involved
|
// create a DerivedGeology object without any multipliers involved
|
||||||
Opm::DeckConstPtr origDeck = parser->parseString(origDeckString);
|
Opm::DeckConstPtr origDeck = parser->parseString(origDeckString, parseMode);
|
||||||
Opm::EclipseStateConstPtr origEclipseState(new Opm::EclipseState(origDeck));
|
Opm::EclipseStateConstPtr origEclipseState(new Opm::EclipseState(origDeck , parseMode));
|
||||||
|
|
||||||
auto origGridManager = std::make_shared<Opm::GridManager>(origEclipseState->getEclipseGrid());
|
auto origGridManager = std::make_shared<Opm::GridManager>(origEclipseState->getEclipseGrid());
|
||||||
auto origProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(origDeck, origEclipseState, *(origGridManager->c_grid()));
|
auto origProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(origDeck, origEclipseState, *(origGridManager->c_grid()));
|
||||||
@@ -172,8 +174,8 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
|
|||||||
|
|
||||||
/////
|
/////
|
||||||
// create a DerivedGeology object _with_ transmissibility multipliers involved
|
// create a DerivedGeology object _with_ transmissibility multipliers involved
|
||||||
Opm::DeckConstPtr multDeck = parser->parseString(multDeckString);
|
Opm::DeckConstPtr multDeck = parser->parseString(multDeckString, parseMode);
|
||||||
Opm::EclipseStateConstPtr multEclipseState(new Opm::EclipseState(multDeck));
|
Opm::EclipseStateConstPtr multEclipseState(new Opm::EclipseState(multDeck, parseMode));
|
||||||
|
|
||||||
auto multGridManager = std::make_shared<Opm::GridManager>(multEclipseState->getEclipseGrid());
|
auto multGridManager = std::make_shared<Opm::GridManager>(multEclipseState->getEclipseGrid());
|
||||||
auto multProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(multDeck, multEclipseState, *(multGridManager->c_grid()));
|
auto multProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(multDeck, multEclipseState, *(multGridManager->c_grid()));
|
||||||
@@ -184,8 +186,8 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
|
|||||||
/////
|
/////
|
||||||
// create a DerivedGeology object _with_ transmissibility multipliers involved for
|
// create a DerivedGeology object _with_ transmissibility multipliers involved for
|
||||||
// the negative faces
|
// the negative faces
|
||||||
Opm::DeckConstPtr multMinusDeck = parser->parseString(multMinusDeckString);
|
Opm::DeckConstPtr multMinusDeck = parser->parseString(multMinusDeckString, parseMode);
|
||||||
Opm::EclipseStateConstPtr multMinusEclipseState(new Opm::EclipseState(multMinusDeck));
|
Opm::EclipseStateConstPtr multMinusEclipseState(new Opm::EclipseState(multMinusDeck , parseMode));
|
||||||
|
|
||||||
auto multMinusGridManager = std::make_shared<Opm::GridManager>(multMinusEclipseState->getEclipseGrid());
|
auto multMinusGridManager = std::make_shared<Opm::GridManager>(multMinusEclipseState->getEclipseGrid());
|
||||||
auto multMinusProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(multMinusDeck, multMinusEclipseState, *(multMinusGridManager->c_grid()));
|
auto multMinusProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(multMinusDeck, multMinusEclipseState, *(multMinusGridManager->c_grid()));
|
||||||
@@ -195,8 +197,8 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
|
|||||||
|
|
||||||
/////
|
/////
|
||||||
// create a DerivedGeology object with the NTG keyword involved
|
// create a DerivedGeology object with the NTG keyword involved
|
||||||
Opm::DeckConstPtr ntgDeck = parser->parseString(ntgDeckString);
|
Opm::DeckConstPtr ntgDeck = parser->parseString(ntgDeckString, parseMode);
|
||||||
Opm::EclipseStateConstPtr ntgEclipseState(new Opm::EclipseState(ntgDeck));
|
Opm::EclipseStateConstPtr ntgEclipseState(new Opm::EclipseState(ntgDeck, parseMode));
|
||||||
|
|
||||||
auto ntgGridManager = std::make_shared<Opm::GridManager>(ntgEclipseState->getEclipseGrid());
|
auto ntgGridManager = std::make_shared<Opm::GridManager>(ntgEclipseState->getEclipseGrid());
|
||||||
auto ntgProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(ntgDeck, ntgEclipseState, *(ntgGridManager->c_grid()));
|
auto ntgProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(ntgDeck, ntgEclipseState, *(ntgGridManager->c_grid()));
|
||||||
@@ -272,11 +274,12 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersCpGrid)
|
|||||||
|
|
||||||
Opm::parameter::ParameterGroup param;
|
Opm::parameter::ParameterGroup param;
|
||||||
Opm::ParserPtr parser(new Opm::Parser() );
|
Opm::ParserPtr parser(new Opm::Parser() );
|
||||||
|
Opm::ParseMode parseMode;
|
||||||
|
|
||||||
/////
|
/////
|
||||||
// create a DerivedGeology object without any multipliers involved
|
// create a DerivedGeology object without any multipliers involved
|
||||||
Opm::DeckConstPtr origDeck = parser->parseString(origDeckString);
|
Opm::DeckConstPtr origDeck = parser->parseString(origDeckString , parseMode);
|
||||||
Opm::EclipseStateConstPtr origEclipseState(new Opm::EclipseState(origDeck));
|
Opm::EclipseStateConstPtr origEclipseState(new Opm::EclipseState(origDeck , parseMode));
|
||||||
|
|
||||||
auto origGrid = std::make_shared<Dune::CpGrid>();
|
auto origGrid = std::make_shared<Dune::CpGrid>();
|
||||||
origGrid->processEclipseFormat(origEclipseState->getEclipseGrid(), 0.0, false);
|
origGrid->processEclipseFormat(origEclipseState->getEclipseGrid(), 0.0, false);
|
||||||
@@ -290,8 +293,8 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersCpGrid)
|
|||||||
|
|
||||||
/////
|
/////
|
||||||
// create a DerivedGeology object _with_ transmissibility multipliers involved
|
// create a DerivedGeology object _with_ transmissibility multipliers involved
|
||||||
Opm::DeckConstPtr multDeck = parser->parseString(multDeckString);
|
Opm::DeckConstPtr multDeck = parser->parseString(multDeckString,parseMode);
|
||||||
Opm::EclipseStateConstPtr multEclipseState(new Opm::EclipseState(multDeck));
|
Opm::EclipseStateConstPtr multEclipseState(new Opm::EclipseState(multDeck, parseMode));
|
||||||
|
|
||||||
auto multGrid = std::make_shared<Dune::CpGrid>();
|
auto multGrid = std::make_shared<Dune::CpGrid>();
|
||||||
multGrid->processEclipseFormat(multEclipseState->getEclipseGrid(), 0.0, false);
|
multGrid->processEclipseFormat(multEclipseState->getEclipseGrid(), 0.0, false);
|
||||||
@@ -304,8 +307,8 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersCpGrid)
|
|||||||
/////
|
/////
|
||||||
// create a DerivedGeology object _with_ transmissibility multipliers involved for
|
// create a DerivedGeology object _with_ transmissibility multipliers involved for
|
||||||
// the negative faces
|
// the negative faces
|
||||||
Opm::DeckConstPtr multMinusDeck = parser->parseString(multMinusDeckString);
|
Opm::DeckConstPtr multMinusDeck = parser->parseString(multMinusDeckString , parseMode);
|
||||||
Opm::EclipseStateConstPtr multMinusEclipseState(new Opm::EclipseState(multMinusDeck));
|
Opm::EclipseStateConstPtr multMinusEclipseState(new Opm::EclipseState(multMinusDeck, parseMode));
|
||||||
|
|
||||||
auto multMinusGrid = std::make_shared<Dune::CpGrid>();
|
auto multMinusGrid = std::make_shared<Dune::CpGrid>();
|
||||||
multMinusGrid->processEclipseFormat(multMinusEclipseState->getEclipseGrid(), 0.0, false);
|
multMinusGrid->processEclipseFormat(multMinusEclipseState->getEclipseGrid(), 0.0, false);
|
||||||
@@ -318,8 +321,8 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersCpGrid)
|
|||||||
|
|
||||||
/////
|
/////
|
||||||
// create a DerivedGeology object with the NTG keyword involved
|
// create a DerivedGeology object with the NTG keyword involved
|
||||||
Opm::DeckConstPtr ntgDeck = parser->parseString(ntgDeckString);
|
Opm::DeckConstPtr ntgDeck = parser->parseString(ntgDeckString, parseMode);
|
||||||
Opm::EclipseStateConstPtr ntgEclipseState(new Opm::EclipseState(ntgDeck));
|
Opm::EclipseStateConstPtr ntgEclipseState(new Opm::EclipseState(ntgDeck, parseMode));
|
||||||
|
|
||||||
auto ntgGrid = std::make_shared<Dune::CpGrid>();
|
auto ntgGrid = std::make_shared<Dune::CpGrid>();
|
||||||
ntgGrid->processEclipseFormat(ntgEclipseState->getEclipseGrid(), 0.0, false);
|
ntgGrid->processEclipseFormat(ntgEclipseState->getEclipseGrid(), 0.0, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user