diff --git a/bin/installexternal.sh b/bin/installexternal.sh index 3b00b323c1e4f82ffa93fe4051ef0fcc4b15ed51..16b29a28432a5f0f2f5c8fe8870d9b704990345c 100755 --- a/bin/installexternal.sh +++ b/bin/installexternal.sh @@ -53,27 +53,41 @@ installAluGrid() fi } -installCornerpoint() +installErt() { cd $TOPDIR - checkLocationForDuneModules dune-cornerpoint + checkLocationForDuneModules ert if test $CORRECT_LOCATION_FOR_DUNE_MODULES == "n"; then return fi - if [ ! -e dune-cornerpoint ]; then - git clone -b release/2015.10 https://github.com/OPM/dune-cornerpoint + if [ ! -e ert ]; then + git clone -b release/2016.04 https://github.com/Ensembles/ert.git fi - + if test "$DOWNLOAD_ONLY" == "y"; then return fi if test "$CLEANUP" == "y"; then - rm -rf dune-cornerpoint + rm -rf ert return fi + + # building ert + echo "Building ert" + cd $TOPDIR/ert + mkdir build + cd build + cmake ../devel + make + + # show additional information + echo "Ert has been built in directory ert/build." + echo "Do not change this directory otherwise opm will not find ert!" + + cd $TOPDIR } installFoamGrid() @@ -217,21 +231,25 @@ installOPM() fi if [ ! -e opm-common ]; then - git clone -b release/2015.10 https://github.com/OPM/opm-common + git clone -b release/2016.04 https://github.com/OPM/opm-common fi if [ ! -e opm-core ]; then - git clone -b release/2015.10 https://github.com/OPM/opm-core + git clone -b release/2016.04 https://github.com/OPM/opm-core fi if [ ! -e opm-material ]; then - git clone -b release/2015.10 https://github.com/OPM/opm-material + git clone -b release/2016.04 https://github.com/OPM/opm-material fi if [ ! -e opm-parser ]; then - git clone -b release/2015.10 https://github.com/OPM/opm-parser + git clone -b release/2016.04 https://github.com/OPM/opm-parser fi + if [ ! -e opm-grid ]; then + git clone -b release/2016.04 https://github.com/OPM/opm-grid + fi + if test "$DOWNLOAD_ONLY" == "y"; then return fi @@ -241,23 +259,29 @@ installOPM() rm -rf opm-core rm -rf opm-material rm -rf opm-parser + rm -rf opm-grid return fi # apply patches echo "Applying patch for opm-parser" cd $TOPDIR/opm-parser - patch -p1 < $TOPDIR/dumux/patches/opm-parser-2015.10.patch + patch -p1 < $TOPDIR/dumux/patches/opm-parser-2016.04.patch + + echo "Applying patch for opm-common" + cd $TOPDIR/opm-common + patch -p1 < $TOPDIR/dumux/patches/opm-common-2016.04.patch # show additional information echo "In addition, it might be necessary to set manually some" echo "CMake variables in the CMAKE_FLAGS section of the .opts-file:" - echo " -Ddune-cornerpoint_PREFIX=/path/to/dune-cornerpoint \\" + echo " -DOPM_COMMON_ROOT=/path/to/opm-common \\" + echo " -Dopm-grid_PREFIX=/path/to/opm-grid \\" echo " -Dopm-common_PREFIX=/path/to/opm-common \\" echo " -Dopm-core_PREFIX=/path/to/opm-core \\" echo " -Dopm-material_PREFIX=/path/to/opm-material \\" echo " -Dopm-parser_PREFIX=/path/to/opm-parser \\" - echo " -DHAVE_DUNE_CORNERPOINT=1 \\" + echo " -DHAVE_OPM_GRID=1 \\" cd $TOPDIR } @@ -377,7 +401,7 @@ usage() echo "Where PACKAGES is one or more of the following" echo " all Install everything and the kitchen sink." echo " alugrid Download dune-alugrid." - echo " cornerpoint Download and patch dune-cornerpoint." + echo " ert Download and build ert." echo " foamgrid Download dune-foamgrid." echo " gstat Download and install gstat." echo " metis Install the METIS graph partitioner." @@ -443,7 +467,7 @@ for TMP in "$@"; do SOMETHING_DONE="y" createExternalDirectory installAluGrid - installCornerpoint + installErt installFoamGrid installGStat installMETIS @@ -458,9 +482,9 @@ for TMP in "$@"; do SOMETHING_DONE="y" installAluGrid ;; - cornerpoint|dune-cornerpoint) + ert) SOMETHING_DONE="y" - installCornerpoint + installErt ;; foamgrid|dune-foamgrid) SOMETHING_DONE="y" diff --git a/dumux/io/cpgridcreator.hh b/dumux/io/cpgridcreator.hh index 871bc77a39b937a4f3364013b1baa20713d8d4d2..741f9209282119df4793add0092f8719dcc88c51 100644 --- a/dumux/io/cpgridcreator.hh +++ b/dumux/io/cpgridcreator.hh @@ -24,10 +24,10 @@ #ifndef DUMUX_CPGRID_CREATOR_HH #define DUMUX_CPGRID_CREATOR_HH -#if (HAVE_DUNE_CORNERPOINT && HAVE_OPM_PARSER) +#if HAVE_OPM_GRID #include <dune/grid/CpGrid.hpp> #include <opm/parser/eclipse/Parser/Parser.hpp> -#include <opm/parser/eclipse/Parser/ParseMode.hpp> +#include <opm/parser/eclipse/Parser/ParseContext.hpp> #include <opm/parser/eclipse/Deck/Deck.hpp> #include <dumux/common/basicproperties.hh> @@ -59,9 +59,9 @@ public: { std::string fileName = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, std::string, Grid, File); - Opm::ParserPtr parser(new Opm::Parser()); - Opm::ParseMode parseMode; - deck() = *(new Opm::DeckConstPtr(parser->parseFile(fileName, parseMode))); + parser_() = *(new Opm::ParserPtr(new Opm::Parser())); + Opm::ParseContext parseContext; + deck() = *(new Opm::DeckConstPtr(parser_()->parseFile(fileName, parseContext))); gridPtr() = std::make_shared<Grid>(*(new Grid())); gridPtr()->processEclipseFormat(deck(), 0.0, false, false); @@ -102,8 +102,15 @@ public: { gridPtr()->loadBalance(); } + +private: + static Opm::ParserPtr &parser_() + { + static Opm::ParserPtr parser; + return parser; + } }; } -#endif // (HAVE_DUNE_CORNERPOINT && HAVE_OPM_PARSER) +#endif // HAVE_OPM_GRID #endif diff --git a/dune.module b/dune.module index 580744974d945dd915fd455acca3609657b15442..8aa809744949d8add73875dfc6a6a95a1b9f1ec5 100644 --- a/dune.module +++ b/dune.module @@ -2,5 +2,5 @@ Module: dumux Version: 2.10-git Maintainer: dumux@listserv.uni-stuttgart.de Depends: dune-common (>= 2.4.1) dune-grid (>= 2.4) dune-localfunctions (>= 2.4) dune-istl (>= 2.4) -Suggests: dune-alugrid (>=2.4) dune-pdelab (>=2.0) dune-multidomain dune-cornerpoint dune-foamgrid (>=2.4) +Suggests: dune-alugrid (>=2.4) dune-pdelab (>=2.0) dune-multidomain dune-foamgrid (>=2.4) opm-grid Whitespace-Hook: Yes diff --git a/patches/README b/patches/README index 26b9e32e581174ab6430ebd7180aafc97d5208d7..ddf06ffa5bb1a0a4bf4a8eaa3611e42b32c1b010 100644 --- a/patches/README +++ b/patches/README @@ -9,15 +9,17 @@ dune-istl 2.4.1, e.g.: patch -p1 <../dumux/patches/istl-2.4.1.patch -- If dune-cornerpoint has to be used for, e.g., employing the CpGridCreator, - and Opm is compiled from source, it might be necessary to patch opm-parser: - patch -p1 <../dumux/patches/opm-parser-2015.10.patch +- If opm-grid has to be used for, e.g., employing the CpGridCreator, + and Opm is compiled from source, it might be necessary to patch opm-parser and opm-common: + patch -p1 <../dumux/patches/opm-parser-2016.04.patch + patch -p1 <../dumux/patches/opm-common-2016.04.patch In addition, it might be necessary to set manually some CMake variables in the CMAKE_FLAGS section of the .opts-file: - -Ddune-cornerpoint_PREFIX=/path/to/dune-cornerpoint \ + -DOPM_COMMON_ROOT=/path/to/opm-common/ \ + -Dopm-grid_PREFIX=/path/to/opm-grid \ -Dopm-common_PREFIX=/path/to/opm-common \ -Dopm-core_PREFIX=/path/to/opm-core \ -Dopm-material_PREFIX=/path/to/opm-material \ -Dopm-parser_PREFIX=/path/to/opm-parser \ - -DHAVE_DUNE_CORNERPOINT=1 \ - Currently, Dumux is supposed to be compatible with the Opm 2015.10 release. + -DHAVE_OPM_GRID=1 \ + Currently, Dumux is supposed to be compatible with the Opm 2016.04 release. diff --git a/patches/opm-common-2016.04.patch b/patches/opm-common-2016.04.patch new file mode 100644 index 0000000000000000000000000000000000000000..42cc8c3f7be5caea85cb92248ccd7542a05fce62 --- /dev/null +++ b/patches/opm-common-2016.04.patch @@ -0,0 +1,15 @@ +diff --git a/cmake/Modules/Findopm-parser.cmake b/cmake/Modules/Findopm-parser.cmake +index cb08ade..612f669 100644 +--- a/cmake/Modules/Findopm-parser.cmake ++++ b/cmake/Modules/Findopm-parser.cmake +@@ -38,8 +38,8 @@ string(REGEX REPLACE "${PROJECT_SOURCE_DIR}/?(.*)" "\\1" BUILD_DIR_SUFFIX "${PR + # or in relative directories to this one + if (OPM_PARSER_ROOT) + set (_no_default_path "NO_DEFAULT_PATH") +- set (_opm_parser_source "") +- set (_opm_parser_build "") ++ set (_opm_parser_source "${OPM_PARSER_ROOT}") ++ set (_opm_parser_build "${OPM_PARSER_ROOT}/${BUILD_DIR_SUFFIX}") + else () + set (_no_default_path "") + set (_opm_parser_source diff --git a/patches/opm-parser-2015.10.patch b/patches/opm-parser-2016.04.patch similarity index 82% rename from patches/opm-parser-2015.10.patch rename to patches/opm-parser-2016.04.patch index 1ee98b021c211de5a8385c533fd2db7f2f79518b..303b71942a9ed65af9e6c835b8d31f959ca0ab27 100644 --- a/patches/opm-parser-2015.10.patch +++ b/patches/opm-parser-2016.04.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4158c9e..fdf5903 100644 +index 6bdffb9..d1e68a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -157,8 +157,8 @@ include(OpmProject) +@@ -167,9 +167,9 @@ include(OpmProject) include(ConfigVars) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(opm-parser_NAME opm-parser) @@ -14,4 +14,5 @@ index 4158c9e..fdf5903 100644 +#if(NOT BUILD_SHARED_LIBS) +# list(APPEND opm-parser_LIBRARIES cjson) +#endif() + set(opm-parser_TARGET opmparser) opm_cmake_config(opm-parser) diff --git a/test/porousmediumflow/2p/implicit/CMakeLists.txt b/test/porousmediumflow/2p/implicit/CMakeLists.txt index b4b9c1c5690e42015da4a0d79ff6785b70fb65b9..dd3e9357ecb7763276a8a35f423db4ac67a4b301 100644 --- a/test/porousmediumflow/2p/implicit/CMakeLists.txt +++ b/test/porousmediumflow/2p/implicit/CMakeLists.txt @@ -30,7 +30,7 @@ add_dumux_test(test_generalizeddirichlet test_generalizeddirichlet test_generali ${CMAKE_CURRENT_BINARY_DIR}/generalizeddirichlet-00034.vtp --command "${CMAKE_CURRENT_BINARY_DIR}/test_generalizeddirichlet") -if(HAVE_DUNE_CORNERPOINT) +if(HAVE_OPM_GRID) add_dumux_test(test_cc2pcornerpoint test_cc2pcornerpoint test_cc2pcornerpoint.cc python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py --script fuzzy diff --git a/test/porousmediumflow/2p/implicit/cc2pcornerpointproblem.hh b/test/porousmediumflow/2p/implicit/cc2pcornerpointproblem.hh index e6f35521c2f66dcecbfa7f4e400d0ddc95f694e8..181628d61813a0f8c5da35e27715f084e5433fe7 100644 --- a/test/porousmediumflow/2p/implicit/cc2pcornerpointproblem.hh +++ b/test/porousmediumflow/2p/implicit/cc2pcornerpointproblem.hh @@ -19,7 +19,7 @@ #ifndef DUMUX_CC2P_CORNERPOINT_PROBLEM_HH #define DUMUX_CC2P_CORNERPOINT_PROBLEM_HH -#if HAVE_DUNE_CORNERPOINT +#if HAVE_OPM_GRID #include <dumux/material/components/simpleh2o.hh> #include <dumux/material/components/dnapl.hh> #include <dumux/porousmediumflow/2p/implicit/model.hh> @@ -338,6 +338,6 @@ private: }; } //end namespace -#endif // HAVE_DUNE_CORNERPOINT +#endif // HAVE_OPM_GRID #endif diff --git a/test/porousmediumflow/2p/implicit/cc2pcornerpointspatialparams.hh b/test/porousmediumflow/2p/implicit/cc2pcornerpointspatialparams.hh index 99f4276a600ae3f7b8c057be9f8e36297c94f0df..1bf702348e1bd061ceaeb6b9ccda889d571f0f55 100644 --- a/test/porousmediumflow/2p/implicit/cc2pcornerpointspatialparams.hh +++ b/test/porousmediumflow/2p/implicit/cc2pcornerpointspatialparams.hh @@ -94,7 +94,7 @@ public: if (GridCreator::deck()->hasKeyword("PORO")) { std::cout << "Found PORO..." << std::endl; - std::vector<double> eclVector = GridCreator::deck()->getKeyword("PORO")->getRawDoubleData(); + std::vector<double> eclVector = GridCreator::deck()->getKeyword("PORO").getRawDoubleData(); porosity_.resize(globalCell.size()); for (size_t i = 0; i < globalCell.size(); ++i) { @@ -107,7 +107,7 @@ public: if (GridCreator::deck()->hasKeyword("PERMX")) { std::cout << "Found PERMX..." << std::endl; - std::vector<double> eclVector = GridCreator::deck()->getKeyword("PERMX")->getRawDoubleData(); + std::vector<double> eclVector = GridCreator::deck()->getKeyword("PERMX").getRawDoubleData(); permX_.resize(globalCell.size()); for (size_t i = 0; i < globalCell.size(); ++i) { @@ -121,7 +121,7 @@ public: if (GridCreator::deck()->hasKeyword("PERMZ")) { std::cout << "Found PERMZ..." << std::endl; - std::vector<double> eclVector = GridCreator::deck()->getKeyword("PERMZ")->getRawDoubleData(); + std::vector<double> eclVector = GridCreator::deck()->getKeyword("PERMZ").getRawDoubleData(); permZ_.resize(globalCell.size()); for (size_t i = 0; i < globalCell.size(); ++i) { diff --git a/test/porousmediumflow/2p/implicit/test_cc2pcornerpoint.cc b/test/porousmediumflow/2p/implicit/test_cc2pcornerpoint.cc index 790d826193d1e607f805f63544c06ab37dbaab5c..ba154429ce438c6b799f28f7a753848790ee6580 100644 --- a/test/porousmediumflow/2p/implicit/test_cc2pcornerpoint.cc +++ b/test/porousmediumflow/2p/implicit/test_cc2pcornerpoint.cc @@ -24,11 +24,10 @@ */ #include <config.h> -#if (HAVE_DUNE_CORNERPOINT && HAVE_OPM_CORE && HAVE_OPM_PARSER) +#if HAVE_OPM_GRID #include "cc2pcornerpointproblem.hh" #include <dumux/common/start.hh> -#include <opm/core/io/eclipse/EclipseGridInspector.hpp> /*! * \brief Provides an interface for customizing error messages associated with @@ -66,10 +65,11 @@ int main(int argc, char** argv) return Dumux::start<TypeTag>(argc, argv, usage); } #else +#include<iostream> int main(int argc, char** argv) { -#warning You need to have dune-cornerpoint, opm-core and opm-parser installed to run this test - std::cerr << "You need to have dune-cornerpoint, opm-core and opm-parser installed to run this test\n"; +#warning You need to have opm-grid installed to run this test + std::cerr << "You need to have opm-grid installed to run this test\n"; return 77; } #endif