From bd2f65977053bca049e97a5421121771f4b90799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Tue, 17 Feb 2015 13:22:43 +0100 Subject: [PATCH 1/8] Adapt to API change in WellsManager. --- opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp index 7723bc0b2..83c70c74d 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoil_impl.hpp @@ -248,7 +248,6 @@ namespace Opm Opm::UgGridHelpers::globalCell(grid_), Opm::UgGridHelpers::cartDims(grid_), Opm::UgGridHelpers::dimensions(grid_), - Opm::UgGridHelpers::beginCellCentroids(grid_), Opm::UgGridHelpers::cell2Faces(grid_), Opm::UgGridHelpers::beginFaceCentroids(grid_), props_.permeability()); From 75d98c7e3b80238c18f20e6262dd9d1b38539e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Tue, 17 Feb 2015 13:40:09 +0100 Subject: [PATCH 2/8] Remove uneeded function argument. --- examples/opm_init_check.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/opm_init_check.cpp b/examples/opm_init_check.cpp index ba848ad35..b899acf2b 100644 --- a/examples/opm_init_check.cpp +++ b/examples/opm_init_check.cpp @@ -315,7 +315,7 @@ void initEclipseTrans(TransGraph& eclipseTrans , const ecl_grid_type * ecl_grid -void dump_transGraph( DeckConstPtr deck , std::shared_ptr eclipseState , const ecl_grid_type * ecl_grid , const ecl_file_type * ecl_init , size_t verbosity) { +void dump_transGraph( DeckConstPtr deck , std::shared_ptr eclipseState , const ecl_grid_type * ecl_grid , const ecl_file_type * ecl_init) { int nx = ecl_grid_get_nx( ecl_grid ); int ny = ecl_grid_get_ny( ecl_grid ); int nz = ecl_grid_get_nz( ecl_grid ); @@ -354,7 +354,7 @@ int main(int argc, char** argv) { std::cout << "Loading eclipse EGRID file ....: " << grid_file << std::endl; ecl_grid_type * ecl_grid = ecl_grid_alloc( grid_file.c_str() ); - dump_transGraph( deck , state , ecl_grid , ecl_init , 3); + dump_transGraph( deck , state , ecl_grid , ecl_init); ecl_file_close( ecl_init ); ecl_grid_free( ecl_grid ); From 7cdb65cff39de921b24d89a21e9e07202451b940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Tue, 17 Feb 2015 13:41:00 +0100 Subject: [PATCH 3/8] Suppress unused argument warnings. --- opm/autodiff/BlackoilPropsAd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opm/autodiff/BlackoilPropsAd.cpp b/opm/autodiff/BlackoilPropsAd.cpp index e7da7df3f..436d7ca85 100644 --- a/opm/autodiff/BlackoilPropsAd.cpp +++ b/opm/autodiff/BlackoilPropsAd.cpp @@ -94,6 +94,7 @@ namespace Opm const double* BlackoilPropsAd::surfaceDensity(int regionIdx) const { // this class only supports a single PVT region for now... + static_cast(regionIdx); assert(regionIdx == 0); return props_.surfaceDensity(); } @@ -433,7 +434,7 @@ namespace Opm /// \param[in] cells Array of n cell indices to be associated with the pressure values. /// \return Array of n formation volume factor values. V BlackoilPropsAd::bGas(const V& pg, - const V& T, + const V& /* T */, const Cells& cells) const { if (!pu_.phase_used[Gas]) { From 355bfb0e70ce1724fd9f32bdcaf8ff1cbdfc0482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Tue, 17 Feb 2015 13:41:31 +0100 Subject: [PATCH 4/8] Suppress signed/unsigned warning. Also fix formatting. --- opm/autodiff/BlackoilPropsAdFromDeck.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/opm/autodiff/BlackoilPropsAdFromDeck.cpp b/opm/autodiff/BlackoilPropsAdFromDeck.cpp index 9191b6889..a5a8ac2a1 100644 --- a/opm/autodiff/BlackoilPropsAdFromDeck.cpp +++ b/opm/autodiff/BlackoilPropsAdFromDeck.cpp @@ -71,10 +71,13 @@ namespace Opm BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(const BlackoilPropsAdFromDeck& props, const int number_of_cells) { - if(number_of_cells>props.cellPvtRegionIdx_.size()) + const int original_size = props.cellPvtRegionIdx_.size(); + if (number_of_cells > original_size) { OPM_THROW(std::runtime_error, "The number of cells is larger than the one of the original grid!"); - if(number_of_cells<0) + } + if (number_of_cells < 0) { OPM_THROW(std::runtime_error, "The number of cells is has to be larger than 0."); + } // Copy properties that do not depend on the postion within the grid. rock_ = props.rock_; satprops_ = props.satprops_; From a4024a3f9efb35c81c50d3952c30d1987b03218b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Tue, 17 Feb 2015 13:42:26 +0100 Subject: [PATCH 5/8] Remove unused functions. --- opm/autodiff/NewtonIterationBlackoilCPR.cpp | 36 --------------------- 1 file changed, 36 deletions(-) diff --git a/opm/autodiff/NewtonIterationBlackoilCPR.cpp b/opm/autodiff/NewtonIterationBlackoilCPR.cpp index 11107f5e1..09ec30bf5 100644 --- a/opm/autodiff/NewtonIterationBlackoilCPR.cpp +++ b/opm/autodiff/NewtonIterationBlackoilCPR.cpp @@ -77,14 +77,6 @@ namespace Opm /// \return solution to complete system. V recoverVariable(const ADB& equation, const V& partial_solution, const int n); - /// Determine diagonality of a sparse matrix. - /// If there are off-diagonal elements in the sparse - /// structure, this function returns true if they are all - /// equal to zero. - /// \param[in] matrix the matrix under consideration - /// \return true if matrix is diagonal - bool isDiagonal(const M& matrix); - /// Form an elliptic system of equations. /// \param[in] num_phases the number of fluid phases /// \param[in] eqs the equations @@ -98,11 +90,6 @@ namespace Opm Eigen::SparseMatrix& A, V& b); - /// Create a dune-istl matrix from an Eigen matrix. - /// \param[in] matrix input Eigen::SparseMatrix - /// \return output Dune::BCRSMatrix - Mat makeIstlMatrix(const Eigen::SparseMatrix& matrix); - } // anonymous namespace @@ -382,29 +369,6 @@ namespace Opm - - bool isDiagonal(const M& matr) - { - M matrix = matr; - matrix.makeCompressed(); - for (int k = 0; k < matrix.outerSize(); ++k) { - for (M::InnerIterator it(matrix, k); it; ++it) { - if (it.col() != it.row()) { - // Off-diagonal element. - if (it.value() != 0.0) { - // Nonzero off-diagonal element. - // std::cout << "off-diag: " << it.row() << ' ' << it.col() << std::endl; - return false; - } - } - } - } - return true; - } - - - - /// Form an elliptic system of equations. /// \param[in] num_phases the number of fluid phases /// \param[in] eqs the equations From 17ade0457f5118df2eaf71a07274a67e1f9b2b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Tue, 17 Feb 2015 13:44:33 +0100 Subject: [PATCH 6/8] Suppress unused argument errors. --- opm/autodiff/BackupRestore.hpp | 11 ++++++----- opm/autodiff/RedistributeDataHandles.hpp | 2 +- opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp | 6 ++++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/opm/autodiff/BackupRestore.hpp b/opm/autodiff/BackupRestore.hpp index 62b4fdff2..775d04bbc 100644 --- a/opm/autodiff/BackupRestore.hpp +++ b/opm/autodiff/BackupRestore.hpp @@ -80,8 +80,9 @@ namespace Opm { } template - void resizeContainer( std::array& a, size_t size ) + void resizeContainer( std::array& /* a */, size_t size ) { + static_cast(size); assert( int(size) == int(n) ); } @@ -142,16 +143,16 @@ namespace Opm { BlackoilStateId = 2, WellStateFullyImplicitBackoilId = 3 }; - inline int objectId( const SimulatorState& state ) { + inline int objectId( const SimulatorState& /* state */) { return SimulatorStateId; } - inline int objectId( const WellState& state ) { + inline int objectId( const WellState& /* state */) { return WellStateId; } - inline int objectId( const BlackoilState& state ) { + inline int objectId( const BlackoilState& /* state */) { return BlackoilStateId; } - inline int objectId( const WellStateFullyImplicitBlackoil& state ) { + inline int objectId( const WellStateFullyImplicitBlackoil& /* state */) { return WellStateFullyImplicitBackoilId; } diff --git a/opm/autodiff/RedistributeDataHandles.hpp b/opm/autodiff/RedistributeDataHandles.hpp index 11a569d84..1e4f34c19 100644 --- a/opm/autodiff/RedistributeDataHandles.hpp +++ b/opm/autodiff/RedistributeDataHandles.hpp @@ -89,7 +89,7 @@ public: { assert( T::codimension == 0); assert( size == 2 * recvState_.numPhases() +4+2*recvGrid_.numCellFaces(e.index())); - (void) size; + static_cast(size); for ( int i=0; i Date: Tue, 17 Feb 2015 13:44:52 +0100 Subject: [PATCH 7/8] Suppress re-declaration warning. --- opm/autodiff/RedistributeDataHandles.hpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/opm/autodiff/RedistributeDataHandles.hpp b/opm/autodiff/RedistributeDataHandles.hpp index 1e4f34c19..1d860bff6 100644 --- a/opm/autodiff/RedistributeDataHandles.hpp +++ b/opm/autodiff/RedistributeDataHandles.hpp @@ -91,13 +91,12 @@ public: assert( size == 2 * recvState_.numPhases() +4+2*recvGrid_.numCellFaces(e.index())); static_cast(size); + double val; for ( int i=0; i Date: Tue, 17 Feb 2015 13:45:14 +0100 Subject: [PATCH 8/8] Remove const from bool return type. Since it has no effect for value types, and generates a warning. --- opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp index b05cb7c9b..74b85690d 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp @@ -202,7 +202,7 @@ namespace Opm const std::string& outputDirectory() const { return outputDir_; } /** \brief return true if output is enabled */ - const bool output () const { return output_; } + bool output () const { return output_; } void restore(SimulatorTimerInterface& timer, BlackoilState& state,