From c03d6f0b4bf2c4ebd4a6d8d74e992cf0db2c5be8 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Tue, 25 Aug 2015 13:27:11 +0200 Subject: [PATCH] Ensure that thresholdPressure.hpp is compiled. Added a test to ensure that thresholdPressure is compiled; however the test is deactivated because it requires the GridHelpers from opm-autodiff. --- CMakeLists_files.cmake | 3 +- tests/test_thresholdpressure.cpp | 56 ++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 tests/test_thresholdpressure.cpp diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index f37a71a9..725aa311 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -170,7 +170,8 @@ list (APPEND TEST_SOURCE_FILES tests/test_parallelistlinformation.cpp tests/test_sparsevector.cpp tests/test_sparsetable.cpp - tests/test_velocityinterpolation.cpp + #tests/test_thresholdpressure.cpp + tests/test_velocityinterpolation.cpp tests/test_quadratures.cpp tests/test_uniformtablelinear.cpp tests/test_wells.cpp diff --git a/tests/test_thresholdpressure.cpp b/tests/test_thresholdpressure.cpp new file mode 100644 index 00000000..61d2b41a --- /dev/null +++ b/tests/test_thresholdpressure.cpp @@ -0,0 +1,56 @@ +#include +#include +#include + +#include +#include +#include +#include +#include // Note: the GridHelpers must be included before this (to make overloads available) + + +static DeckPtr createDeckSimConfig() { + const std::string& inputStr = "RUNSPEC\n" + "EQLOPTS\n" + "THPRES /\n " + "DIMENS\n" + "10 3 4 /\n" + "\n" + "GRID\n" + "REGIONS\n" + "EQLNUM\n" + "10*1 10*2 100*3 /\n " + "\n" + + "SOLUTION\n" + "THPRES\n" + "1 2 12.0/\n" + "1 3 5.0/\n" + "2 3 7.0/\n" + "/\n" + "\n"; + + + ParserPtr parser(new Parser()); + return parser->parseString(inputStr, ParseMode()) ; +} + +/* + The main purpose of this is to get the code in + thresholdPressures.hpp to compile; it currently has no users in the + opm-core codebase. +*/ + +BOOST_AUTO_TEST_CASE(CreateSimulationConfig) { + ParseMode parseMode; + typedef UnstructuredGrid Grid; + DeckPtr deck = createDeckSimConfig(); + EclipseState state(deck, parseMode); + EclipseGridConstPtr eclipseGrid = state.getEclipseGrid(); + std::vector porv = eclipseState->getDoubleGridProperty("PORV")->getData(); + GridManager gridManager( eclipseState->getEclipseGrid(), porv ); + const Grid& grid = *(gridManager.c_grid()); + + std::vector threshold_pressures = thresholdPressures(parseMode, eclipseState, grid); + BOOST_CHECK( threshold_pressures.size() > 0 ); +}