From d04fcbfd5bd260c898ddbe5d55183e5f9e9f0c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 27 Aug 2014 19:42:11 +0200 Subject: [PATCH 1/3] Fix: eclipseState no longer shadowed. --- examples/sim_2p_incomp.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/sim_2p_incomp.cpp b/examples/sim_2p_incomp.cpp index d74e439f..64c4b793 100644 --- a/examples/sim_2p_incomp.cpp +++ b/examples/sim_2p_incomp.cpp @@ -113,7 +113,6 @@ try std::string deck_filename = param.get("deck_filename"); deck = parser->parseFile(deck_filename); - EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck)); eclipseState.reset( new EclipseState(deck)); // Grid init grid.reset(new GridManager(deck)); From 5059f66badf2ece79e308d2d33038343624a862d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 27 Aug 2014 19:43:53 +0200 Subject: [PATCH 2/3] Squash warnings by removing or commenting out unused parameters. --- opm/core/io/eclipse/EclipseWriter.cpp | 15 ++++++--------- opm/core/props/BlackoilPropertiesBasic.cpp | 6 +++--- opm/core/props/pvt/PvtDead.cpp | 8 ++++---- opm/core/props/pvt/PvtLiveGas.cpp | 2 +- opm/core/props/pvt/PvtLiveOil.cpp | 2 +- tests/test_EclipseWriter.cpp | 16 ++++++++-------- 6 files changed, 23 insertions(+), 26 deletions(-) diff --git a/opm/core/io/eclipse/EclipseWriter.cpp b/opm/core/io/eclipse/EclipseWriter.cpp index 9b1eedc1..2db5bbc7 100644 --- a/opm/core/io/eclipse/EclipseWriter.cpp +++ b/opm/core/io/eclipse/EclipseWriter.cpp @@ -286,7 +286,6 @@ public: int nx, int ny, int nz, - const int *compressedToCartesianCellIdx, const PhaseUsage uses) { ecl_rst_file_fwrite_header(restartFileHandle_, @@ -544,8 +543,7 @@ public: { return ertHandle_; } protected: - void updateTimeStepWellIndex_(const SimulatorTimer& timer, - const std::map& nameToIdxMap) + void updateTimeStepWellIndex_(const std::map& nameToIdxMap) { const std::string& wellName = well_->name(); @@ -669,12 +667,12 @@ public: "SM3/DAY" /* surf. cub. m. per day */) { } - virtual double retrieveValue(const SimulatorTimer& timer, + virtual double retrieveValue(const SimulatorTimer& /*timer*/, const WellState& wellState, const std::map& wellNameToIdxMap) { // find the index for the quantity in the wellState - this->updateTimeStepWellIndex_(timer, wellNameToIdxMap); + this->updateTimeStepWellIndex_(wellNameToIdxMap); if (this->flatIdx_ < 0) { // well not active in current time step return 0.0; @@ -718,7 +716,7 @@ public: } // find the index for the quantity in the wellState - this->updateTimeStepWellIndex_(timer, wellNameToIdxMap); + this->updateTimeStepWellIndex_(wellNameToIdxMap); if (this->flatIdx_ < 0) { // well not active in current time step return 0.0; @@ -759,12 +757,12 @@ public: "Pascal") { } - virtual double retrieveValue(const SimulatorTimer& timer, + virtual double retrieveValue(const SimulatorTimer& /*timer*/, const WellState& wellState, const std::map& wellNameToIdxMap) { // find the index for the quantity in the wellState - this->updateTimeStepWellIndex_(timer, wellNameToIdxMap); + this->updateTimeStepWellIndex_(wellNameToIdxMap); if (this->flatIdx_ < 0) { // well not active in current time step return 0.0; @@ -932,7 +930,6 @@ void EclipseWriter::writeTimeStep(const SimulatorTimer& timer, cartesianSize_[0], cartesianSize_[1], cartesianSize_[2], - compressedToCartesianCellIdx_, phaseUsage_); EclipseWriterDetails::Solution sol(restartHandle); diff --git a/opm/core/props/BlackoilPropertiesBasic.cpp b/opm/core/props/BlackoilPropertiesBasic.cpp index 9634d9aa..7ca21ca2 100644 --- a/opm/core/props/BlackoilPropertiesBasic.cpp +++ b/opm/core/props/BlackoilPropertiesBasic.cpp @@ -243,9 +243,9 @@ namespace Opm /// \param[in] cell Cell index. /// \param[in] pcow P_oil - P_water. /// \param[in/out] swat Water saturation. / Possibly modified Water saturation. - void BlackoilPropertiesBasic::swatInitScaling(const int cell, - const double pcow, - double & swat) + void BlackoilPropertiesBasic::swatInitScaling(const int /*cell*/, + const double /*pcow*/, + double& /*swat*/) { OPM_THROW(std::runtime_error, "BlackoilPropertiesBasic::swatInitScaling() -- not implemented."); } diff --git a/opm/core/props/pvt/PvtDead.cpp b/opm/core/props/pvt/PvtDead.cpp index 09dc32d3..889620bf 100644 --- a/opm/core/props/pvt/PvtDead.cpp +++ b/opm/core/props/pvt/PvtDead.cpp @@ -217,7 +217,7 @@ namespace Opm } void PvtDead::rsSat(const int n, - const int* pvtTableIdx, + const int* /*pvtTableIdx*/, const double* /*p*/, double* output_rsSat, double* output_drsSatdp) const @@ -227,7 +227,7 @@ namespace Opm } void PvtDead::rvSat(const int n, - const int* pvtTableIdx, + const int* /*pvtTableIdx*/, const double* /*p*/, double* output_rvSat, double* output_drvSatdp) const @@ -237,7 +237,7 @@ namespace Opm } void PvtDead::R(const int n, - const int* pvtTableIdx, + const int* /*pvtTableIdx*/, const double* /*p*/, const double* /*z*/, double* output_R) const @@ -246,7 +246,7 @@ namespace Opm } void PvtDead::dRdp(const int n, - const int* pvtTableIdx, + const int* /*pvtTableIdx*/, const double* /*p*/, const double* /*z*/, double* output_R, diff --git a/opm/core/props/pvt/PvtLiveGas.cpp b/opm/core/props/pvt/PvtLiveGas.cpp index 7c59cc3a..dd6b437c 100644 --- a/opm/core/props/pvt/PvtLiveGas.cpp +++ b/opm/core/props/pvt/PvtLiveGas.cpp @@ -217,7 +217,7 @@ namespace Opm } void PvtLiveGas::rsSat(const int n, - const int* pvtRegionIdx, + const int* /*pvtRegionIdx*/, const double* /*p*/, double* output_rsSat, double* output_drsSatdp) const diff --git a/opm/core/props/pvt/PvtLiveOil.cpp b/opm/core/props/pvt/PvtLiveOil.cpp index 9ab6b054..e73a1fdc 100644 --- a/opm/core/props/pvt/PvtLiveOil.cpp +++ b/opm/core/props/pvt/PvtLiveOil.cpp @@ -266,7 +266,7 @@ namespace Opm } void PvtLiveOil::rvSat(const int n, - const int* pvtTableIdx, + const int* /*pvtTableIdx*/, const double* /*p*/, double* output_rvSat, double* output_drvSatdp) const diff --git a/tests/test_EclipseWriter.cpp b/tests/test_EclipseWriter.cpp index a9351591..0dd9635d 100644 --- a/tests/test_EclipseWriter.cpp +++ b/tests/test_EclipseWriter.cpp @@ -155,7 +155,7 @@ void createBlackoilState(int timeStepIdx) } } -void createWellState(int timeStepIdx) +void createWellState(int /*timeStepIdx*/) { // allocate a new BlackoilState object wellState.reset(new Opm::WellState); @@ -314,8 +314,8 @@ void checkRestartFile(int timeStepIdx) getErtData(eclKeyword, resultData); // convert the data from ERT from Metric to SI units (bar to Pa) - for (size_t i = 0; i < resultData.size(); ++i) { - resultData[i] *= 1e5; + for (size_t ii = 0; ii < resultData.size(); ++ii) { + resultData[ii] *= 1e5; } compareErtData(sourceData, resultData, /*percentTolerance=*/1e-4); @@ -328,9 +328,9 @@ void checkRestartFile(int timeStepIdx) // extract the water saturation from the black-oil state sourceData.resize(numCells); - for (size_t i = 0; i < sourceData.size(); ++i) { + for (size_t ii = 0; ii < sourceData.size(); ++ii) { // again, fun with direct index manipulation... - sourceData[i] = blackoilState->saturation()[i*numActivePhases + waterPhaseIdx]; + sourceData[ii] = blackoilState->saturation()[ii*numActivePhases + waterPhaseIdx]; } compareErtData(sourceData, resultData, /*percentTolerance=*/1e-4); @@ -343,9 +343,9 @@ void checkRestartFile(int timeStepIdx) // extract the water saturation from the black-oil state sourceData.resize(numCells); - for (size_t i = 0; i < sourceData.size(); ++i) { + for (size_t ii = 0; ii < sourceData.size(); ++ii) { // again, fun with direct index manipulation... - sourceData[i] = blackoilState->saturation()[i*numActivePhases + gasPhaseIdx]; + sourceData[ii] = blackoilState->saturation()[ii*numActivePhases + gasPhaseIdx]; } compareErtData(sourceData, resultData, /*percentTolerance=*/1e-4); @@ -356,7 +356,7 @@ void checkRestartFile(int timeStepIdx) } } -void checkSummaryFile(int timeStepIdx) +void checkSummaryFile(int /*timeStepIdx*/) { // TODO } From e1be710526e9538f7e8a7d9406532ff18b43361c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 27 Aug 2014 19:44:32 +0200 Subject: [PATCH 3/3] Suppress unused argument warning. The eclState argument was added in PR#634, and may be needed later. Until then, this silences the warning generated. --- opm/core/props/satfunc/SaturationPropsFromDeck_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/core/props/satfunc/SaturationPropsFromDeck_impl.hpp b/opm/core/props/satfunc/SaturationPropsFromDeck_impl.hpp index 684ef70c..f039def2 100644 --- a/opm/core/props/satfunc/SaturationPropsFromDeck_impl.hpp +++ b/opm/core/props/satfunc/SaturationPropsFromDeck_impl.hpp @@ -63,7 +63,7 @@ namespace Opm template template void SaturationPropsFromDeck::init(Opm::DeckConstPtr deck, - Opm::EclipseStateConstPtr eclState, + Opm::EclipseStateConstPtr /*eclState*/, int number_of_cells, const int* global_cell, const T& begin_cell_centroids,