From 4fe22ea13757f770ddafad6a409911f2547eac68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Wed, 9 Apr 2014 23:58:34 +0200 Subject: [PATCH 1/4] Don't include "config.h" in public header That's always an error. Presumably, this was a left-over from conversion to templates. --- opm/core/pressure/tpfa/TransTpfa_impl.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/opm/core/pressure/tpfa/TransTpfa_impl.hpp b/opm/core/pressure/tpfa/TransTpfa_impl.hpp index ebdf36c7..bf81d21f 100644 --- a/opm/core/pressure/tpfa/TransTpfa_impl.hpp +++ b/opm/core/pressure/tpfa/TransTpfa_impl.hpp @@ -1,4 +1,3 @@ -#include "config.h" #include #include #include From 51c664800f3ea15dc535f6581368c8059db8dde5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Thu, 10 Apr 2014 00:00:14 +0200 Subject: [PATCH 2/4] Prefer C++ headers Also, remove a couple of headers that were no longer needed. --- opm/core/pressure/tpfa/TransTpfa_impl.hpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/opm/core/pressure/tpfa/TransTpfa_impl.hpp b/opm/core/pressure/tpfa/TransTpfa_impl.hpp index bf81d21f..4f806654 100644 --- a/opm/core/pressure/tpfa/TransTpfa_impl.hpp +++ b/opm/core/pressure/tpfa/TransTpfa_impl.hpp @@ -1,12 +1,9 @@ -#include -#include -#include -#include - #include #include #include +#include + namespace Dune { class CpGrid; @@ -105,7 +102,7 @@ tpfa_htrans_compute(const Grid* G, const double *perm, double *htrans) assert (denom > 0); htrans[i] /= denom; - htrans[i] = fabs(htrans[i]); + htrans[i] = std::abs(htrans[i]); } // Move to next cell centroid. cc = increment(cc, 1, d); From 89f282f19fd35f96840f37df6447027434dd9cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Thu, 10 Apr 2014 00:03:10 +0200 Subject: [PATCH 3/4] Implement Dune::CpGrid operations when needed only The functions multiplyFaceNormalWithArea maybeFreeFaceNormal operating on Dune::CpGrids must not be implemented unless they are actually used. Otherwise we get link failures if (e.g.,) opm-autodiff is being built without CpGrid support. Hide the definitions behind "#ifdef HAVE_DUNE_CORNERPOINT". --- opm/core/pressure/tpfa/TransTpfa_impl.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/opm/core/pressure/tpfa/TransTpfa_impl.hpp b/opm/core/pressure/tpfa/TransTpfa_impl.hpp index 4f806654..2e77b1c0 100644 --- a/opm/core/pressure/tpfa/TransTpfa_impl.hpp +++ b/opm/core/pressure/tpfa/TransTpfa_impl.hpp @@ -21,6 +21,7 @@ double faceArea(const Dune::CpGrid&, int); namespace { +#ifdef HAVE_DUNE_CORNERPOINT const double* multiplyFaceNormalWithArea(const Dune::CpGrid& grid, int face_index, const double* in) { int d=Opm::UgGridHelpers::dimensions(grid); @@ -32,15 +33,16 @@ const double* multiplyFaceNormalWithArea(const Dune::CpGrid& grid, int face_inde return out; } -inline const double* multiplyFaceNormalWithArea(const UnstructuredGrid&, int, const double* in) -{ - return in; -} - inline void maybeFreeFaceNormal(const Dune::CpGrid&, const double* array) { delete[] array; } +#endif // HAVE_DUNE_CORNERPOINT + +inline const double* multiplyFaceNormalWithArea(const UnstructuredGrid&, int, const double* in) +{ + return in; +} inline void maybeFreeFaceNormal(const UnstructuredGrid&, const double*) {} From 18624766f278ca9b62a8a258f3594c3e2cb792e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Thu, 10 Apr 2014 00:51:28 +0200 Subject: [PATCH 4/4] Declare initBlackoilStateFromDeck(DeckConstPtr) This was missing in commit 4c2120c and produced some build failures that were hard to analyse. I'm not convinced that the underlying problem is solved, but this does at least restore the build. --- opm/core/simulator/initState.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/opm/core/simulator/initState.hpp b/opm/core/simulator/initState.hpp index 7f323d00..4c3a8cc6 100644 --- a/opm/core/simulator/initState.hpp +++ b/opm/core/simulator/initState.hpp @@ -20,6 +20,8 @@ #ifndef OPM_INITSTATE_HEADER_INCLUDED #define OPM_INITSTATE_HEADER_INCLUDED +#include // DeckConstPtr + struct UnstructuredGrid; namespace Opm @@ -225,6 +227,20 @@ namespace Opm const EclipseGridParser& deck, const double gravity, State& state); + + /// Initialize a blackoil state from input deck. + template + void initBlackoilStateFromDeck(int number_of_cells, + const int* global_cell, + int number_of_faces, + FaceCells face_cells, + FCI begin_face_centroids, + CCI begin_cell_centroids, + int dimensions, + const Props& props, + Opm::DeckConstPtr newParserDeck, + const double gravity, + State& state); } // namespace Opm #include