Skip to content
Snippets Groups Projects
Commit 140b61a4 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

Merge branch 'feature/support-opm-2022-10' into 'master'

[opm] support version 2022.10

See merge request !3345
parents 9294ee8b 260b2822
No related branches found
No related tags found
1 merge request!3345[opm] support version 2022.10
Pipeline #24651 passed
...@@ -43,6 +43,12 @@ ...@@ -43,6 +43,12 @@
/* Define the path to dumux */ /* Define the path to dumux */
#define DUMUX_SOURCE_DIR "${CMAKE_SOURCE_DIR}" #define DUMUX_SOURCE_DIR "${CMAKE_SOURCE_DIR}"
/* Define the major version of opm-grid */
#define OPM_GRID_VERSION_MAJOR ${OPM_GRID_VERSION_MAJOR}
/* Define the minor version of opm-grid */
#define OPM_GRID_VERSION_MINOR ${OPM_GRID_VERSION_MINOR}
/* Define to 1 if gnuplot was found */ /* Define to 1 if gnuplot was found */
#cmakedefine HAVE_GNUPLOT 1 #cmakedefine HAVE_GNUPLOT 1
......
...@@ -24,14 +24,25 @@ ...@@ -24,14 +24,25 @@
#ifndef DUMUX_IO_GRID_CPGRIDMANAGER_HH #ifndef DUMUX_IO_GRID_CPGRIDMANAGER_HH
#define DUMUX_IO_GRID_CPGRIDMANAGER_HH #define DUMUX_IO_GRID_CPGRIDMANAGER_HH
#include <config.h>
#if HAVE_OPM_GRID #if HAVE_OPM_GRID
#include <dune/common/version.hh>
#include <dune/common/parallel/mpihelper.hh> #include <dune/common/parallel/mpihelper.hh>
#include <opm/grid/CpGrid.hpp> #include <opm/grid/CpGrid.hpp>
#if DUNE_VERSION_GTE(OPM_GRID, 2022, 10)
#include <opm/input/eclipse/Parser/Parser.hpp>
#include <opm/input/eclipse/Parser/ParseContext.hpp>
#include <opm/input/eclipse/Deck/Deck.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#else
#include <opm/parser/eclipse/Parser/Parser.hpp> #include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp> #include <opm/parser/eclipse/Parser/ParseContext.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>
#endif
#include <dumux/common/parameters.hh> #include <dumux/common/parameters.hh>
......
...@@ -26,7 +26,13 @@ ...@@ -26,7 +26,13 @@
#define DUMUX_TWOP_CORNERPOINT_TEST_SPATIAL_PARAMS_HH #define DUMUX_TWOP_CORNERPOINT_TEST_SPATIAL_PARAMS_HH
#if HAVE_OPM_GRID #if HAVE_OPM_GRID
#include <dune/common/version.hh>
#if DUNE_VERSION_GTE(OPM_GRID, 2022, 10)
#include <opm/input/eclipse/Deck/Deck.hpp>
#else
#include <opm/parser/eclipse/Deck/Deck.hpp> #include <opm/parser/eclipse/Deck/Deck.hpp>
#endif
#include <dumux/porousmediumflow/fvspatialparamsmp.hh> #include <dumux/porousmediumflow/fvspatialparamsmp.hh>
#include <dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh> #include <dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh>
...@@ -66,11 +72,19 @@ public: ...@@ -66,11 +72,19 @@ public:
{ {
homogeneous_ = getParam<bool>("Problem.Homogeneous"); homogeneous_ = getParam<bool>("Problem.Homogeneous");
const auto getDeckData = [&] (const auto& name) {
#if DUNE_VERSION_GTE(OPM_GRID, 2022, 10)
return (*deck_)[deck->index(name)[0]].getRawDoubleData();
#else
return deck_->getKeyword(name).getRawDoubleData();
#endif
};
const std::vector<int>& globalCell = this->gridGeometry().gridView().grid().globalCell(); const std::vector<int>& globalCell = this->gridGeometry().gridView().grid().globalCell();
if (deck_->hasKeyword("PORO")) { if (deck_->hasKeyword("PORO")) {
std::cout << "Found PORO..." << std::endl; std::cout << "Found PORO..." << std::endl;
std::vector<double> eclVector = deck_->getKeyword("PORO").getRawDoubleData(); std::vector<double> eclVector = getDeckData("PORO");
porosity_.resize(globalCell.size()); porosity_.resize(globalCell.size());
for (size_t i = 0; i < globalCell.size(); ++i) { for (size_t i = 0; i < globalCell.size(); ++i) {
...@@ -83,7 +97,7 @@ public: ...@@ -83,7 +97,7 @@ public:
if (deck_->hasKeyword("PERMX")) { if (deck_->hasKeyword("PERMX")) {
std::cout << "Found PERMX..." << std::endl; std::cout << "Found PERMX..." << std::endl;
std::vector<double> eclVector = deck_->getKeyword("PERMX").getRawDoubleData(); std::vector<double> eclVector = getDeckData("PERMX");
permX_.resize(globalCell.size()); permX_.resize(globalCell.size());
for (size_t i = 0; i < globalCell.size(); ++i) { for (size_t i = 0; i < globalCell.size(); ++i) {
...@@ -97,7 +111,7 @@ public: ...@@ -97,7 +111,7 @@ public:
if (deck_->hasKeyword("PERMZ")) { if (deck_->hasKeyword("PERMZ")) {
std::cout << "Found PERMZ..." << std::endl; std::cout << "Found PERMZ..." << std::endl;
std::vector<double> eclVector = deck_->getKeyword("PERMZ").getRawDoubleData(); std::vector<double> eclVector = getDeckData("PERMZ");
permZ_.resize(globalCell.size()); permZ_.resize(globalCell.size());
for (size_t i = 0; i < globalCell.size(); ++i) { for (size_t i = 0; i < globalCell.size(); ++i) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment