EclipseState: make specifying anything which requires a grid an error if no grid could be instantiated

This commit is contained in:
Andreas Lauser
2014-11-09 17:37:32 +01:00
parent 4e293ee3e6
commit a7ba8af558
6 changed files with 79 additions and 47 deletions

View File

@@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE(Empty) {
SupportedKeywordInfo("SATNUM" , 0, "1"),
SupportedKeywordInfo("FIPNUM" , 2, "1")
});
Opm::GridProperties<int> gridProperties( 10, 10, 100 , supportedKeywords);
Opm::GridProperties<int> gridProperties( NULL , supportedKeywords);
BOOST_CHECK( gridProperties.supportsKeyword("SATNUM") );
BOOST_CHECK( gridProperties.supportsKeyword("FIPNUM") );
@@ -57,7 +57,7 @@ BOOST_AUTO_TEST_CASE(addKeyword) {
std::shared_ptr<std::vector<SupportedKeywordInfo> > supportedKeywords(new std::vector<SupportedKeywordInfo>{
SupportedKeywordInfo("SATNUM" , 0, "1")
});
Opm::GridProperties<int> gridProperties( 100, 10 , 10 , supportedKeywords);
Opm::GridProperties<int> gridProperties( NULL , supportedKeywords);
BOOST_CHECK_THROW( gridProperties.addKeyword("NOT-SUPPORTED") , std::invalid_argument);
@@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE(getKeyword) {
std::shared_ptr<std::vector<SupportedKeywordInfo> > supportedKeywords(new std::vector<SupportedKeywordInfo>{
SupportedKeywordInfo("SATNUM" , 0, "1")
});
Opm::GridProperties<int> gridProperties( 100,25,4 , supportedKeywords);
Opm::GridProperties<int> gridProperties( NULL , supportedKeywords);
std::shared_ptr<Opm::GridProperty<int> > satnum1 = gridProperties.getKeyword("SATNUM");
std::shared_ptr<Opm::GridProperty<int> > satnum2 = gridProperties.getKeyword("SATNUM");

View File

@@ -427,9 +427,9 @@ BOOST_AUTO_TEST_CASE(GridPropertyPostProcessors) {
SupportedKeywordInfo kwInfo2("PORO" , 1.0 , testPostP , "1");
std::shared_ptr<std::vector<SupportedKeywordInfo> > supportedKeywords(new std::vector<SupportedKeywordInfo>{
kwInfo1 , kwInfo2 });
Opm::GridProperties<double> properties(10,10,10,supportedKeywords);
Opm::DeckPtr deck = createDeck();
Opm::EclipseGrid grid(deck);
Opm::GridProperties<double> properties(&grid, supportedKeywords);
{
auto poro = properties.getKeyword("PORO");

View File

@@ -115,7 +115,7 @@ BOOST_AUTO_TEST_CASE(InvalidInput) {
Opm::MULTREGTScanner scanner;
Opm::DeckPtr deck = createInvalidMULTREGTDeck();
Opm::EclipseGrid grid(deck);
std::shared_ptr<Opm::GridProperties<int> > gridProperties = std::make_shared<Opm::GridProperties<int> >( grid.getNX() , grid.getNY() , grid.getNZ() , supportedKeywords);
std::shared_ptr<Opm::GridProperties<int> > gridProperties = std::make_shared<Opm::GridProperties<int> >(&grid, supportedKeywords);
Opm::DeckKeywordConstPtr multregtKeyword0 = deck->getKeyword("MULTREGT",0);
Opm::DeckKeywordConstPtr multregtKeyword1 = deck->getKeyword("MULTREGT",1);
Opm::DeckKeywordConstPtr multregtKeyword2 = deck->getKeyword("MULTREGT",2);
@@ -254,7 +254,7 @@ BOOST_AUTO_TEST_CASE(SimpleMULTREGT) {
Opm::EclipseGrid grid(deck);
std::shared_ptr<const Opm::Box> inputBox = std::make_shared<const Opm::Box>( grid.getNX() , grid.getNY() , grid.getNZ() );
std::shared_ptr<Opm::GridProperties<int> > gridProperties = std::make_shared<Opm::GridProperties<int> >( grid.getNX() , grid.getNY() , grid.getNZ() , supportedKeywords);
std::shared_ptr<Opm::GridProperties<int> > gridProperties = std::make_shared<Opm::GridProperties<int> >(&grid, supportedKeywords);
std::shared_ptr<Opm::GridProperty<int> > fluxNum = gridProperties->getKeyword("FLUXNUM");
std::shared_ptr<Opm::GridProperty<int> > multNum = gridProperties->getKeyword("MULTNUM");
Opm::DeckKeywordConstPtr fluxnumKeyword = deck->getKeyword("FLUXNUM",0);