2015-06-12 10:54:25 +02:00
|
|
|
/*
|
|
|
|
|
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 BoxTest
|
|
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
|
#include <boost/test/test_tools.hpp>
|
|
|
|
|
|
|
|
|
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
2016-02-09 12:09:40 +01:00
|
|
|
#include <opm/parser/eclipse/Deck/Section.hpp>
|
2015-06-12 10:54:25 +02:00
|
|
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
2015-07-24 15:38:22 +02:00
|
|
|
#include <opm/parser/eclipse/Parser/ParseMode.hpp>
|
2016-01-18 17:51:15 +01:00
|
|
|
#include <opm/parser/eclipse/Parser/ParserKeywords/F.hpp>
|
2016-02-09 12:09:40 +01:00
|
|
|
#include <opm/parser/eclipse/Parser/ParserKeywords/G.hpp>
|
2016-01-18 17:51:15 +01:00
|
|
|
#include <opm/parser/eclipse/Parser/ParserKeywords/S.hpp>
|
2015-06-12 10:54:25 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
2016-01-15 08:42:57 +01:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
|
|
|
|
#include <opm/parser/eclipse/EclipseState/Grid/FaultCollection.hpp>
|
2015-06-12 10:54:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
using namespace Opm;
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE( test_parse ) {
|
|
|
|
|
Parser parser(false);
|
2015-07-24 15:38:22 +02:00
|
|
|
ParseMode parseMode;
|
2015-08-08 12:36:52 +02:00
|
|
|
|
|
|
|
|
parseMode.update( ParseMode::PARSE_UNKNOWN_KEYWORD , InputError::IGNORE );
|
|
|
|
|
parseMode.update( ParseMode::PARSE_RANDOM_TEXT , InputError::IGNORE );
|
|
|
|
|
parseMode.update( ParseMode::PARSE_RANDOM_SLASH , InputError::IGNORE );
|
2015-06-12 10:54:25 +02:00
|
|
|
|
|
|
|
|
parser.addKeyword<ParserKeywords::SPECGRID>();
|
|
|
|
|
parser.addKeyword<ParserKeywords::FAULTS>();
|
2015-07-24 15:38:22 +02:00
|
|
|
|
|
|
|
|
auto deck = parser.parseFile("testdata/integration_tests/Resinsight/DECK1.DATA" , parseMode);
|
2015-06-12 10:54:25 +02:00
|
|
|
|
|
|
|
|
BOOST_CHECK( deck->hasKeyword<ParserKeywords::SPECGRID>() );
|
|
|
|
|
BOOST_CHECK( deck->hasKeyword<ParserKeywords::FAULTS>() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE( test_state ) {
|
|
|
|
|
Parser parser(false);
|
2015-07-24 15:38:22 +02:00
|
|
|
ParseMode parseMode;
|
2015-08-08 12:36:52 +02:00
|
|
|
|
|
|
|
|
parseMode.update( ParseMode::PARSE_UNKNOWN_KEYWORD , InputError::IGNORE );
|
|
|
|
|
parseMode.update( ParseMode::PARSE_RANDOM_TEXT , InputError::IGNORE );
|
|
|
|
|
parseMode.update( ParseMode::PARSE_RANDOM_SLASH , InputError::IGNORE );
|
2015-06-12 10:54:25 +02:00
|
|
|
|
|
|
|
|
parser.addKeyword<ParserKeywords::SPECGRID>();
|
|
|
|
|
parser.addKeyword<ParserKeywords::FAULTS>();
|
2016-02-09 12:09:40 +01:00
|
|
|
parser.addKeyword<ParserKeywords::GRID>();
|
2015-07-24 15:38:22 +02:00
|
|
|
auto deck = parser.parseFile("testdata/integration_tests/Resinsight/DECK1.DATA" , parseMode);
|
2016-02-09 12:09:40 +01:00
|
|
|
|
2015-06-12 10:54:25 +02:00
|
|
|
auto grid = std::make_shared<EclipseGrid>( deck );
|
2016-02-09 12:09:40 +01:00
|
|
|
auto gsec = std::make_shared< GRIDSection >( *deck );
|
|
|
|
|
auto faults = std::make_shared<FaultCollection>( gsec, grid );
|
2015-06-12 10:54:25 +02:00
|
|
|
}
|