Skip to content

Commit

Permalink
Merge pull request #303 from andlaus/fix_extra_warnings
Browse files Browse the repository at this point in the history
Fix extra warnings
  • Loading branch information
atgeirr authored Jul 5, 2018
2 parents c15019e + 5f4d8ff commit 3edf76f
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 29 deletions.
14 changes: 7 additions & 7 deletions bin/genEvalSpecializations.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ class Evaluation<ValueT, {{ numDerivs }}>
// derivatives being zero.
{% if numDerivs < 0 %}\
template <class RhsValueType>
Evaluation(int numVars, const RhsValueType& c, int varPos)
: data_(1 + numVars, 0.0)
Evaluation(int nVars, const RhsValueType& c, int varPos)
: data_(1 + nVars, 0.0)
{
// The variable position must be in represented by the given variable descriptor
assert(0 <= varPos && varPos < size());
Expand Down Expand Up @@ -301,18 +301,18 @@ class Evaluation<ValueT, {{ numDerivs }}>
static Evaluation createBlank(const Evaluation& x)
{ return Evaluation(x.size()); }
{% else %}\
static Evaluation createBlank(const Evaluation& x)
static Evaluation createBlank(const Evaluation& x OPM_UNUSED)
{ return Evaluation(); }
{% endif %}\
// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
{% if numDerivs < 0 %}\
template <class RhsValueType>
static Evaluation createVariable(int numVars, const RhsValueType& value, int varPos)
static Evaluation createVariable(int nVars, const RhsValueType& value, int varPos)
{
// copy function value and set all derivatives to 0, except for the variable
// which is represented by the value (which is set to 1.0)
return Evaluation(numVars, value, varPos);
return Evaluation(nVars, value, varPos);
}
{% else %}\
template <class RhsValueType>
Expand All @@ -329,9 +329,9 @@ class Evaluation<ValueT, {{ numDerivs }}>
// "evaluate" a constant function (i.e. a function that does not depend on the set of
// relevant variables, f(x) = c).
template <class RhsValueType>
static Evaluation createConstant(int numVars, const RhsValueType& value)
static Evaluation createConstant(int nVars, const RhsValueType& value)
{
return Evaluation(numVars, value);
return Evaluation(nVars, value);
}
{% else %}\
// "evaluate" a constant function (i.e. a function that does not depend on the set of
Expand Down
4 changes: 3 additions & 1 deletion opm/material/common/MathToolbox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#ifndef OPM_MATERIAL_MATH_TOOLBOX_HPP
#define OPM_MATERIAL_MATH_TOOLBOX_HPP

#include <opm/material/common/Unused.hpp>

#include <cmath>
#include <algorithm>
#include <type_traits>
Expand Down Expand Up @@ -97,7 +99,7 @@ struct MathToolbox
* This basically boils down to creating an uninitialized object of sufficient size.
* This is method only non-trivial for dynamically-sized Evaluation objects.
*/
static Scalar createBlank(Scalar value)
static Scalar createBlank(Scalar value OPM_UNUSED)
{ return Scalar(); }

/*!
Expand Down
12 changes: 6 additions & 6 deletions opm/material/densead/DynamicEvaluation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ class Evaluation<ValueT, DynamicSize>
// i.e., f(x) = c. this implies an evaluation with the given value and all
// derivatives being zero.
template <class RhsValueType>
Evaluation(int numVars, const RhsValueType& c, int varPos)
: data_(1 + numVars, 0.0)
Evaluation(int nVars, const RhsValueType& c, int varPos)
: data_(1 + nVars, 0.0)
{
// The variable position must be in represented by the given variable descriptor
assert(0 <= varPos && varPos < size());
Expand Down Expand Up @@ -170,20 +170,20 @@ class Evaluation<ValueT, DynamicSize>

// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
template <class RhsValueType>
static Evaluation createVariable(int numVars, const RhsValueType& value, int varPos)
static Evaluation createVariable(int nVars, const RhsValueType& value, int varPos)
{
// copy function value and set all derivatives to 0, except for the variable
// which is represented by the value (which is set to 1.0)
return Evaluation(numVars, value, varPos);
return Evaluation(nVars, value, varPos);
}


// "evaluate" a constant function (i.e. a function that does not depend on the set of
// relevant variables, f(x) = c).
template <class RhsValueType>
static Evaluation createConstant(int numVars, const RhsValueType& value)
static Evaluation createConstant(int nVars, const RhsValueType& value)
{
return Evaluation(numVars, value);
return Evaluation(nVars, value);
}

// print the value and the derivatives of the function evaluation
Expand Down
2 changes: 1 addition & 1 deletion opm/material/densead/Evaluation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class Evaluation
// is equivalent to creating an uninitialized object using the default
// constructor, while for dynamic evaluations, it creates an Evaluation
// object which exhibits the same number of derivatives as the argument.
static Evaluation createBlank(const Evaluation& x)
static Evaluation createBlank(const Evaluation& x OPM_UNUSED)
{ return Evaluation(); }

// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
Expand Down
2 changes: 1 addition & 1 deletion opm/material/densead/Evaluation1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class Evaluation<ValueT, 1>
// is equivalent to creating an uninitialized object using the default
// constructor, while for dynamic evaluations, it creates an Evaluation
// object which exhibits the same number of derivatives as the argument.
static Evaluation createBlank(const Evaluation& x)
static Evaluation createBlank(const Evaluation& x OPM_UNUSED)
{ return Evaluation(); }

// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
Expand Down
2 changes: 1 addition & 1 deletion opm/material/densead/Evaluation10.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class Evaluation<ValueT, 10>
// is equivalent to creating an uninitialized object using the default
// constructor, while for dynamic evaluations, it creates an Evaluation
// object which exhibits the same number of derivatives as the argument.
static Evaluation createBlank(const Evaluation& x)
static Evaluation createBlank(const Evaluation& x OPM_UNUSED)
{ return Evaluation(); }

// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
Expand Down
2 changes: 1 addition & 1 deletion opm/material/densead/Evaluation11.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class Evaluation<ValueT, 11>
// is equivalent to creating an uninitialized object using the default
// constructor, while for dynamic evaluations, it creates an Evaluation
// object which exhibits the same number of derivatives as the argument.
static Evaluation createBlank(const Evaluation& x)
static Evaluation createBlank(const Evaluation& x OPM_UNUSED)
{ return Evaluation(); }

// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
Expand Down
2 changes: 1 addition & 1 deletion opm/material/densead/Evaluation12.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class Evaluation<ValueT, 12>
// is equivalent to creating an uninitialized object using the default
// constructor, while for dynamic evaluations, it creates an Evaluation
// object which exhibits the same number of derivatives as the argument.
static Evaluation createBlank(const Evaluation& x)
static Evaluation createBlank(const Evaluation& x OPM_UNUSED)
{ return Evaluation(); }

// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
Expand Down
2 changes: 1 addition & 1 deletion opm/material/densead/Evaluation2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class Evaluation<ValueT, 2>
// is equivalent to creating an uninitialized object using the default
// constructor, while for dynamic evaluations, it creates an Evaluation
// object which exhibits the same number of derivatives as the argument.
static Evaluation createBlank(const Evaluation& x)
static Evaluation createBlank(const Evaluation& x OPM_UNUSED)
{ return Evaluation(); }

// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
Expand Down
2 changes: 1 addition & 1 deletion opm/material/densead/Evaluation3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Evaluation<ValueT, 3>
// is equivalent to creating an uninitialized object using the default
// constructor, while for dynamic evaluations, it creates an Evaluation
// object which exhibits the same number of derivatives as the argument.
static Evaluation createBlank(const Evaluation& x)
static Evaluation createBlank(const Evaluation& x OPM_UNUSED)
{ return Evaluation(); }

// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
Expand Down
2 changes: 1 addition & 1 deletion opm/material/densead/Evaluation4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class Evaluation<ValueT, 4>
// is equivalent to creating an uninitialized object using the default
// constructor, while for dynamic evaluations, it creates an Evaluation
// object which exhibits the same number of derivatives as the argument.
static Evaluation createBlank(const Evaluation& x)
static Evaluation createBlank(const Evaluation& x OPM_UNUSED)
{ return Evaluation(); }

// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
Expand Down
2 changes: 1 addition & 1 deletion opm/material/densead/Evaluation5.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class Evaluation<ValueT, 5>
// is equivalent to creating an uninitialized object using the default
// constructor, while for dynamic evaluations, it creates an Evaluation
// object which exhibits the same number of derivatives as the argument.
static Evaluation createBlank(const Evaluation& x)
static Evaluation createBlank(const Evaluation& x OPM_UNUSED)
{ return Evaluation(); }

// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
Expand Down
2 changes: 1 addition & 1 deletion opm/material/densead/Evaluation6.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class Evaluation<ValueT, 6>
// is equivalent to creating an uninitialized object using the default
// constructor, while for dynamic evaluations, it creates an Evaluation
// object which exhibits the same number of derivatives as the argument.
static Evaluation createBlank(const Evaluation& x)
static Evaluation createBlank(const Evaluation& x OPM_UNUSED)
{ return Evaluation(); }

// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
Expand Down
2 changes: 1 addition & 1 deletion opm/material/densead/Evaluation7.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class Evaluation<ValueT, 7>
// is equivalent to creating an uninitialized object using the default
// constructor, while for dynamic evaluations, it creates an Evaluation
// object which exhibits the same number of derivatives as the argument.
static Evaluation createBlank(const Evaluation& x)
static Evaluation createBlank(const Evaluation& x OPM_UNUSED)
{ return Evaluation(); }

// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
Expand Down
2 changes: 1 addition & 1 deletion opm/material/densead/Evaluation8.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class Evaluation<ValueT, 8>
// is equivalent to creating an uninitialized object using the default
// constructor, while for dynamic evaluations, it creates an Evaluation
// object which exhibits the same number of derivatives as the argument.
static Evaluation createBlank(const Evaluation& x)
static Evaluation createBlank(const Evaluation& x OPM_UNUSED)
{ return Evaluation(); }

// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
Expand Down
2 changes: 1 addition & 1 deletion opm/material/densead/Evaluation9.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class Evaluation<ValueT, 9>
// is equivalent to creating an uninitialized object using the default
// constructor, while for dynamic evaluations, it creates an Evaluation
// object which exhibits the same number of derivatives as the argument.
static Evaluation createBlank(const Evaluation& x)
static Evaluation createBlank(const Evaluation& x OPM_UNUSED)
{ return Evaluation(); }

// create a function evaluation for a "naked" depending variable (i.e., f(x) = x)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,6 @@ class EclMaterialLawManager
bool hasOil = deck.hasKeyword("OIL");
bool hasWater = deck.hasKeyword("WATER");

const auto& imbnumData = eclState.get3DProperties().getIntGridProperty("IMBNUM").getData();
assert(numCompressedElems == satnumRegionArray.size());
assert(!enableHysteresis() || numCompressedElems == imbnumRegionArray.size());
for (unsigned elemIdx = 0; elemIdx < numCompressedElems; ++elemIdx) {
Expand Down Expand Up @@ -615,7 +614,7 @@ class EclMaterialLawManager
}

if (enableHysteresis()) {
unsigned imbRegionIdx = static_cast<unsigned>(imbnumData[elemIdx]) - 1;
unsigned imbRegionIdx = imbnumRegionArray[elemIdx];

if (hasGas && hasOil) {
auto gasOilImbParamsHyst = std::make_shared<GasOilEpsTwoPhaseParams>();
Expand Down

0 comments on commit 3edf76f

Please sign in to comment.