From 5f00467f029cf080f8f9647dc3d4e3cba14994a7 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Thu, 19 Sep 2013 10:32:49 +0200 Subject: [PATCH 1/2] Set linear solver steps in criterion instead of ctor The constructor that takes the number of steps is deprecated; this generates needless warnings. --- opm/core/linalg/LinearSolverIstl.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/opm/core/linalg/LinearSolverIstl.cpp b/opm/core/linalg/LinearSolverIstl.cpp index 167de42da..8ad7dde24 100644 --- a/opm/core/linalg/LinearSolverIstl.cpp +++ b/opm/core/linalg/LinearSolverIstl.cpp @@ -249,13 +249,16 @@ namespace Opm template 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 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 linsolve(opA, precond, tolerance, maxit, verbosity); From 1341903bb705e3cdccdd33bada58e5e65f799ac6 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Thu, 19 Sep 2013 10:59:41 +0200 Subject: [PATCH 2/2] Don't warn about functions not emitted If a function is used by a template but this template is not instantiated, the function will still be defined in the header of a module but it won't be callable because it is in an anonymous namespace and thus we get a warning. This only happens in Clang; GCC consider functions referenced from templates as used. fixup! Don't warn about functions not emitted --- opm/core/simulator/initState_impl.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opm/core/simulator/initState_impl.hpp b/opm/core/simulator/initState_impl.hpp index 34cf08bbb..94398feab 100644 --- a/opm/core/simulator/initState_impl.hpp +++ b/opm/core/simulator/initState_impl.hpp @@ -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 };