From 3fd6a47e1c0ef814fad436bedf6092e3935531e7 Mon Sep 17 00:00:00 2001 From: babrodtk Date: Wed, 20 Apr 2016 09:48:15 +0200 Subject: [PATCH 1/2] Fixed bug where phase_pos was used instead of phase_used --- opm/core/props/BlackoilPropertiesFromDeck.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opm/core/props/BlackoilPropertiesFromDeck.cpp b/opm/core/props/BlackoilPropertiesFromDeck.cpp index 0795d3f2..97d0a6e6 100644 --- a/opm/core/props/BlackoilPropertiesFromDeck.cpp +++ b/opm/core/props/BlackoilPropertiesFromDeck.cpp @@ -322,8 +322,8 @@ namespace Opm this->compute_R_(n, p, T, z, cells, &R_[0]); } const auto& pu = phaseUsage(); - bool oil_and_gas = pu.phase_pos[BlackoilPhases::Liquid] && - pu.phase_pos[BlackoilPhases::Vapour]; + bool oil_and_gas = pu.phase_used[BlackoilPhases::Liquid] && + pu.phase_used[BlackoilPhases::Vapour]; const int o = pu.phase_pos[BlackoilPhases::Liquid]; const int g = pu.phase_pos[BlackoilPhases::Vapour]; From 466e721e0b6e577e028d68b3f4d95e54505206f6 Mon Sep 17 00:00:00 2001 From: babrodtk Date: Tue, 6 Sep 2016 07:50:02 +0200 Subject: [PATCH 2/2] Fixed warnings --- opm/core/grid/GridHelpers.hpp | 5 ----- opm/core/linalg/LinearSolverIstl.cpp | 6 +++--- opm/core/utility/Units.hpp | 12 ++++++++++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/opm/core/grid/GridHelpers.hpp b/opm/core/grid/GridHelpers.hpp index cb78562f..9ecb7727 100644 --- a/opm/core/grid/GridHelpers.hpp +++ b/opm/core/grid/GridHelpers.hpp @@ -190,10 +190,6 @@ const double* beginCellVolumes(const UnstructuredGrid& grid); /// \brief Get an iterator over the cell volumes of a grid positioned after the last cell. const double* endCellVolumes(const UnstructuredGrid& grid); -/// \brief Get the cell centroid of a face. -/// \param grid The grid whose cell centroid we query. -/// \param face_index The index of the corresponding face. -const double* faceCentroid(const UnstructuredGrid& grid, int face_index); /// \brief Traits of the face centroids of a grid. @@ -220,7 +216,6 @@ beginFaceCentroids(const UnstructuredGrid& grid); /// \brief Get a coordinate of a specific face centroid. /// \param grid The grid. /// \param face_index The index of the specific face. -/// \param coordinate The coordinate index. FaceCentroidTraits::ValueType faceCentroid(const UnstructuredGrid& grid, int face_index); diff --git a/opm/core/linalg/LinearSolverIstl.cpp b/opm/core/linalg/LinearSolverIstl.cpp index 26a7102e..fa63e2fd 100644 --- a/opm/core/linalg/LinearSolverIstl.cpp +++ b/opm/core/linalg/LinearSolverIstl.cpp @@ -466,8 +466,8 @@ namespace Opm double linsolver_prolongate_factor) { // Solve with AMG solver. - typedef Dune::MatrixAdapter Operator; - Operator sOpA(opA.getmat()); + typedef Dune::MatrixAdapter AMGOperator; + AMGOperator sOpA(opA.getmat()); #if FIRST_DIAGONAL typedef Dune::Amg::FirstDiagonal CouplingMetric; @@ -482,7 +482,7 @@ namespace Opm #endif typedef Dune::Amg::CoarsenCriterion Criterion; - typedef Dune::Amg::FastAMG Precond; + typedef Dune::Amg::FastAMG Precond; // Construct preconditioner. Criterion criterion; diff --git a/opm/core/utility/Units.hpp b/opm/core/utility/Units.hpp index 75bee386..55432717 100644 --- a/opm/core/utility/Units.hpp +++ b/opm/core/utility/Units.hpp @@ -35,6 +35,8 @@ #ifndef OPM_UNITS_HEADER #define OPM_UNITS_HEADER + + /** * \file * Constants and routines to assist in handling units of measurement. These are @@ -216,6 +218,16 @@ namespace Opm return q / unit; } } // namespace convert + + +#ifndef HAS_ATTRIBUTE_UNUSED + namespace detail { + // Some units are sometimes unused, and generate a (potentially) large number of warnings + // Adding them here silences these warnings, and should have no side-effects + double __attribute__((unused)) unused_units = stb + liter + barsa + psia + darcy; + } // namespace detail +#endif + } // namespace unit } // namespace Opm #endif // OPM_UNITS_HEADER