Merge pull request #376 from rolk/376_warn

Quelch needless warnings (found by Clang)
This commit is contained in:
Atgeirr Flø Rasmussen 2013-09-19 05:05:00 -07:00
commit 3ef57842a9
6 changed files with 32 additions and 19 deletions

View File

@ -226,6 +226,9 @@ try
Opm::WellState well_state;
well_state.init(wells->c_wells(), state);
// Check if we have misspelled anything
warnIfUnusedParams(param);
// Main solvers.
Opm::time::StopWatch pressure_timer;
double ptime = 0.0;

View File

@ -249,13 +249,16 @@ namespace Opm
template<typename C>
void setUpCriterion(C& criterion, double linsolver_prolongate_factor,
int verbosity)
int verbosity, std::size_t linsolver_smooth_steps)
{
criterion.setDebugLevel(verbosity);
#if ANISOTROPIC_3D
criterion.setDefaultValuesAnisotropic(3, 2);
#endif
criterion.setProlongationDampingFactor(linsolver_prolongate_factor);
criterion.setNoPreSmoothSteps(linsolver_smooth_steps);
criterion.setNoPostSmoothSteps(linsolver_smooth_steps);
criterion.setGamma(1); // V-cycle; this is the default
}
LinearSolverInterface::LinearSolverReport
@ -288,9 +291,9 @@ namespace Opm
Criterion criterion;
Precond::SmootherArgs smootherArgs;
Operator opA(A);
setUpCriterion(criterion, linsolver_prolongate_factor, verbosity);
Precond precond(opA, criterion, smootherArgs, 1, linsolver_smooth_steps,
linsolver_smooth_steps);
setUpCriterion(criterion, linsolver_prolongate_factor, verbosity,
linsolver_smooth_steps);
Precond precond(opA, criterion, smootherArgs);
// Construct linear solver.
Dune::CGSolver<Vector> linsolve(opA, precond, tolerance, maxit, verbosity);
@ -339,9 +342,9 @@ namespace Opm
Operator opA(A);
Precond::SmootherArgs smootherArgs;
Criterion criterion;
setUpCriterion(criterion, linsolver_prolongate_factor, verbosity);
Precond precond(opA, criterion, smootherArgs, 1, linsolver_smooth_steps,
linsolver_smooth_steps);
setUpCriterion(criterion, linsolver_prolongate_factor, verbosity,
linsolver_smooth_steps);
Precond precond(opA, criterion, smootherArgs);
// Construct linear solver.
Dune::GeneralizedPCGSolver<Vector> linsolve(opA, precond, tolerance, maxit, verbosity);

View File

@ -40,6 +40,8 @@ namespace Opm
namespace
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunneeded-internal-declaration"
// Find the cells that are below and above a depth.
// TODO: add 'anitialiasing', obtaining a more precise split
// by f. ex. subdividing cells cut by the split depths.
@ -61,6 +63,7 @@ namespace Opm
}
}
}
#pragma clang diagnostic pop
enum WaterInit { WaterBelow, WaterAbove };

View File

@ -282,6 +282,12 @@ namespace Opm {
template <typename StringArray>
void parseCommandLineArguments(int argc, StringArray argv);
void recursiveSetIsOutputEnabled(bool output_is_enabled);
// helper routines to do textual I/O
template <typename T>
static std::string to_string(const T& val);
static std::pair<std::string, std::string>
filename_split(const std::string& filename);
};
} // namespace parameter
} // namespace Opm

View File

@ -67,18 +67,18 @@ namespace Opm {
static std::string type() {return "ParameterGroup";}
};
namespace {
template <typename T>
inline std::string
to_string(const T& val)
ParameterGroup::to_string(const T& val)
{
std::ostringstream os;
os << val;
return os.str();
}
template <>
inline std::string
to_string(const bool b) {
ParameterGroup::to_string(const bool& b) {
if (b) {
return ID_true;
} else {
@ -86,14 +86,15 @@ namespace Opm {
}
}
template <>
inline std::string
to_string(const ParameterGroup&)
ParameterGroup::to_string(const ParameterGroup&)
{
return std::string("<parameter group>");
}
std::pair<std::string, std::string>
filename_split(const std::string& filename)
inline std::pair<std::string, std::string>
ParameterGroup::filename_split(const std::string& filename)
{
int fpos = filename.rfind('.');
std::string name = filename.substr(0, fpos);
@ -101,10 +102,6 @@ namespace Opm {
return std::make_pair(name, type);
}
}
template <typename StringArray>
ParameterGroup::ParameterGroup(int argc, StringArray argv, bool verify_syntax)
: path_(ID_path_root), parent_(0), output_is_enabled_(true)

View File

@ -62,7 +62,8 @@ namespace
}
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunneeded-internal-declaration"
// Compute flux corresponding to a velocity vector v = v0 + x*v1.
void computeFluxLinear(const UnstructuredGrid& grid,
const std::vector<double>& v0,
@ -81,7 +82,7 @@ namespace
flux[face] = std::inner_product(v.begin(), v.end(), grid.face_normals + face*dim, 0.0);
}
}
#pragma clang diagnostic pop
double vectorDiff2(const std::vector<double>& v1, const std::vector<double>& v2)
{